🐍 Python & Raspberry 🐍
8.21K subscribers
1.92K photos
125 videos
623 files
1.23K links
Python- Raspberry Pi-AI-IOT
ادمین : فرهاد ناصری زاده
@farhad_naserizadeh
@farhad3412

گروه پایتون
@Python_QA
تبادل
@mmtahmasbi
کانال مرتبط
@new_mathematical
@micropython_iot
@c_micro
اینستاگرام
http://Instagram.com/python_raspberry
Download Telegram
🌟ساخت کامل ایستگاه هواشناسی توسط رزبری پای با امکان ترسیم گراف عملکرد
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
#آموزش 2 📚

برای خواندن فایل در پایتون به صورت خط به خط از دستور زیر استفاده می شود.

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
pi_sample_code.pdf
51.7 KB
نحوه راه اندازی پورت #سریال رزبری پای

#serial #uart

@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
General logic gates

@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
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 gpiozero import LED, Button
from time import sleep

led=LED(17)
button=Button(2)
while True:

button.wait_for_press()
led.toggle()

@raspberry_python
پردازش تصویر با رزبری پای 👇

🌟🌟 سال انتشار 2017

@raspberry_python
Ashwin_Pajankar_auth_Raspberry_Pi.pdf
3.8 MB
پردازش تصویر با رزبری پای

🌟🌟 سال انتشار 2017

@raspberry_python
Python Testing with #pytest

🌟🌟 سال انتشار 2017

@raspberry_python
The_pragmatic_programmers_Brian.pdf
2.9 MB
Python Testing with #pytest

🌟🌟 سال انتشار 2017

@raspberry_python
اتصال رزبری پای به اینترنت با ماژول sim800 و sim900 👇

http://www.rhydolabz.com/wiki/?p=16325

@raspberry_python