en
Feedback

Don't get caught by a cheater! Telemetrio finds and tags such channels 👉 If you want to see the tag, subscribe

🐍 Python & Raspberry 🐍

🐍 Python & Raspberry 🐍

Open in Telegram

Python- Raspberry Pi-AI-IOT ادمین : فرهاد ناصری زاده @farhad_naserizadeh @farhad3412 گروه پایتون @Python_QA تبادل @mmtahmasbi کانال مرتبط @new_mathematical @micropython_iot @c_micro اینستاگرام http://Instagram.com/python_raspberry

Show more
8 216
Subscribers
No data24 hours
-177 days
-8330 days
Posts Archive
اجرای اتوماتیک اسکریپت های پایتون در هنگام بوت شدن رزبری ۱.ابتدا وارد LXTerminal شده سپس دستور Sudo crontab -e راوارد کرده اگر برای بار اول این دستور را بزنید از شما میخواهد که یکی از ویرایشگر هارا انتخاب نمایید که پیشنهاد ما ویرایشگر nano گزینه ۲ می باشد ۲-پس از ورود به محیط ویرایشگر به انتهای خطوط رفته و دستور زیر را به فایل اضافه نمایید @Reboot python file_name.py & به عنوان مثال @reboot python /home/pi/desktop/raspberry.py & سپس با کلید ترکیبی Ctrl.x فایل را ذخیره نمایید رزبری را ریست کنید خواهید دید بلافاصله پس از بوت شدن رزبری اسکریپت شما آغاز به کار میکند . @Raspberryproject @Raspberry_python

#آموزش 8 #pyserial 🔴 ارتباطات سریال در پایتون🔴 برای دریافت یک لیست از درگاه های سریال از دستور زیر در cli استفاده می شود. python -m serial.tools.list_ports 🌟 دستورات ارتباط سریال در پایتون🌟 import serial تابع Serial دو پارامتر میگیرد : ۱_ دستگاه سریال ۲_ بادریت که معمولا 9600 می باشد. ser = serial.Serial('/dev/ttyUSB0', 9600) برای خواندن تک بایت از دستگاه سریال: data = ser.read() برای خواندن تعدادی بایت از دستگاه سریال : data = ser.read(size=5) برای خواندن یک خط از دستگاه سریال : data = ser.readline() برای خواندن داده ها از دستگاه سریال هنگامی که چیزی روی آن نوشته شده است : در پایتون 2.7 data = ser.read(ser.inWaiting()) در پایتون 3 ser.read(ser.inWaiting) @raspberry_python

اسکریپت پایتون جهت برقراری ارتباط سوکت با ماژول سیم کام و رزبری پای نویسنده اسکریپت : مهندس مزدارانی @raspberryproject @raspberry_python

اتصال رزبری پای به اینترنت با ماژول sim800 و sim900 👇 http://www.rhydolabz.com/wiki/?p=16325 @raspberry_python
اتصال رزبری پای به اینترنت با ماژول sim800 و sim900 👇 http://www.rhydolabz.com/wiki/?p=16325 @raspberry_python

Python Testing with #pytest 🌟🌟 سال انتشار 2017 @raspberry_python

Python Testing with #pytest 🌟🌟 سال انتشار 2017 @raspberry_python
Python Testing with #pytest 🌟🌟 سال انتشار 2017 @raspberry_python

پردازش تصویر با رزبری پای 🌟🌟 سال انتشار 2017 @raspberry_python

پردازش تصویر با رزبری پای 👇 🌟🌟 سال انتشار 2017 @raspberry_python
پردازش تصویر با رزبری پای 👇 🌟🌟 سال انتشار 2017 @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

#آموزش 7 کد پایتون👇 @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

#آموزش 6 کد پایتون 👇 @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

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

نحوه راه اندازی پورت #سریال رزبری پای #serial #uart @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

#آموزش 2 📚 برای خواندن فایل در پایتون به صورت خط به خط از دستور زیر استفاده می شود. with open('myfile.txt', 'r') as fp: for line in fp: print(line) @raspberry_python