Feng_Liu,_Wei_Qi_Yan_auth_Visual.pdf
7.2 MB
#cryptography #image #security
#رمزنگاری ویژوال برای #پردازش_تصویر و #امنیت
انتشارات اشپرینگر
@raspberry_python
#رمزنگاری ویژوال برای #پردازش_تصویر و #امنیت
انتشارات اشپرینگر
@raspberry_python
🌟ساخت کامل ایستگاه هواشناسی توسط رزبری پای با امکان ترسیم گراف عملکرد
http://www.trainelectronics.com/RaspberryPi/WX_Station/index.htm
@raspberry_python
http://www.trainelectronics.com/RaspberryPi/WX_Station/index.htm
@raspberry_python
#آموزش 1 📚
جهت #unzip کردن فایل های #zip در پایتون از دستور زیر استفاده می شود.
file_unzip = 'filename.zip'
unzip = zipfile.ZipFile(file_unzip, 'r')
unzip.extractall()
unzip.close()
@raspberry_python
جهت #unzip کردن فایل های #zip در پایتون از دستور زیر استفاده می شود.
file_unzip = 'filename.zip'
unzip = zipfile.ZipFile(file_unzip, 'r')
unzip.extractall()
unzip.close()
@raspberry_python
#آموزش 2 📚
برای خواندن فایل در پایتون به صورت خط به خط از دستور زیر استفاده می شود.
with open('myfile.txt', 'r') as fp:
for line in fp:
print(line)
@raspberry_python
برای خواندن فایل در پایتون به صورت خط به خط از دستور زیر استفاده می شود.
with open('myfile.txt', 'r') as fp:
for line in fp:
print(line)
@raspberry_python
#آموزش 3 📚
#Itertools
ماژول itertools در پایتون :
این ماژول تمام ترکیبات ممکن k تایی در یک لیست را نشان می دهد.
در مثال زیر k=2 می باشد.
import itertools
a = [1,2,3,4,5]
b = list(itertools.combinations(a, 2))
print(b)
Output:
[(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)]
اگر k=3 باشد داریم :
import itertools
a = [1,2,3,4,5]
b = list(itertools.combinations(a, 3))
print(b)
Output:
[(1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4),
(1, 3, 5), (1, 4, 5), (2, 3, 4), (2, 3, 5),
(2, 4, 5), (3, 4, 5)]
@raspberry_python
#Itertools
ماژول itertools در پایتون :
این ماژول تمام ترکیبات ممکن k تایی در یک لیست را نشان می دهد.
در مثال زیر k=2 می باشد.
import itertools
a = [1,2,3,4,5]
b = list(itertools.combinations(a, 2))
print(b)
Output:
[(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)]
اگر k=3 باشد داریم :
import itertools
a = [1,2,3,4,5]
b = list(itertools.combinations(a, 3))
print(b)
Output:
[(1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4),
(1, 3, 5), (1, 4, 5), (2, 3, 4), (2, 3, 5),
(2, 4, 5), (3, 4, 5)]
@raspberry_python
#آموزش 4 📚
تبدیل #لیست به #دیکشنری در پایتون
l = ['alpha', 'beta', 'gamma', 'delta']
a = dict(zip(range(len(l)), l))
print(a)
output:
{0: 'alpha', 1: 'beta', 2: 'gamma', 3: 'delta'}
@raspberry_python
تبدیل #لیست به #دیکشنری در پایتون
l = ['alpha', 'beta', 'gamma', 'delta']
a = dict(zip(range(len(l)), l))
print(a)
output:
{0: 'alpha', 1: 'beta', 2: 'gamma', 3: 'delta'}
@raspberry_python
#آموزش 5
#function
🔴 توصیف توابع ،بسیار کاربردی🔴
📌int(x [,base])
Converts x to an integer. base specifies the base if x is a string.
〰〰〰〰〰〰〰〰〰〰〰〰
📌long(x [,base] )
Converts x to a long integer. base specifies the base if x is a string.
〰〰〰〰〰〰〰〰〰〰〰〰
📌float(x)
Converts x to a floating-point number.
〰〰〰〰〰〰〰〰〰〰〰
📌complex(real [,imag])
Creates a complex number.
〰〰〰〰〰〰〰〰〰〰〰〰
📌str(x)
Converts object x to a string representation.
〰〰〰〰〰〰〰〰〰〰〰〰
📌🌟repr(x)
Converts object x to an expression string.
〰〰〰〰〰〰〰〰〰〰〰
📌eval(str)
Evaluates a string and returns an object.
〰〰〰〰〰〰〰〰〰〰〰〰
📌tuple(s)
Converts s to a tuple.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌list(s)
Converts s to a list.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌set(s)
Converts s to a set.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌dict(d)
Creates a dictionary. d must be a sequence of (key,value) tuples.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌frozenset(s)
Converts s to a frozen set.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌chr(x)
Converts an integer to a character.
〰〰〰〰〰〰〰〰〰〰〰〰
📌unichr(x)
Converts an integer to a Unicode character.
〰〰〰〰〰〰〰〰〰〰〰〰
📌ord(x)
Converts a single character to its integer value.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌hex(x)
Converts an integer to a hexadecimal string.
〰〰〰〰〰〰〰〰〰〰〰
📌oct(x)
Converts an integer to an octal string.
@raspberry_python
#function
🔴 توصیف توابع ،بسیار کاربردی🔴
📌int(x [,base])
Converts x to an integer. base specifies the base if x is a string.
〰〰〰〰〰〰〰〰〰〰〰〰
📌long(x [,base] )
Converts x to a long integer. base specifies the base if x is a string.
〰〰〰〰〰〰〰〰〰〰〰〰
📌float(x)
Converts x to a floating-point number.
〰〰〰〰〰〰〰〰〰〰〰
📌complex(real [,imag])
Creates a complex number.
〰〰〰〰〰〰〰〰〰〰〰〰
📌str(x)
Converts object x to a string representation.
〰〰〰〰〰〰〰〰〰〰〰〰
📌🌟repr(x)
Converts object x to an expression string.
〰〰〰〰〰〰〰〰〰〰〰
📌eval(str)
Evaluates a string and returns an object.
〰〰〰〰〰〰〰〰〰〰〰〰
📌tuple(s)
Converts s to a tuple.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌list(s)
Converts s to a list.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌set(s)
Converts s to a set.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌dict(d)
Creates a dictionary. d must be a sequence of (key,value) tuples.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌frozenset(s)
Converts s to a frozen set.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌chr(x)
Converts an integer to a character.
〰〰〰〰〰〰〰〰〰〰〰〰
📌unichr(x)
Converts an integer to a Unicode character.
〰〰〰〰〰〰〰〰〰〰〰〰
📌ord(x)
Converts a single character to its integer value.
〰〰〰〰〰〰〰〰〰〰〰〰〰
📌hex(x)
Converts an integer to a hexadecimal string.
〰〰〰〰〰〰〰〰〰〰〰
📌oct(x)
Converts an integer to an octal string.
@raspberry_python
from gpiozero import LED, Button
from signal import pause
led=LED(17)
button=Button(2)
button.when_pressed = led.on button.when_released = led.off
while True:
button.wait_for_press()
@raspberry_python
from signal import pause
led=LED(17)
button=Button(2)
button.when_pressed = led.on button.when_released = led.off
while True:
button.wait_for_press()
@raspberry_python
from gpiozero import LED, Button
from time import sleep
led=LED(17)
button=Button(2)
while True:
button.wait_for_press()
led.toggle()
@raspberry_python
from time import sleep
led=LED(17)
button=Button(2)
while True:
button.wait_for_press()
led.toggle()
@raspberry_python
اتصال رزبری پای به اینترنت با ماژول sim800 و sim900 👇
http://www.rhydolabz.com/wiki/?p=16325
@raspberry_python
http://www.rhydolabz.com/wiki/?p=16325
@raspberry_python