Python errors All In One
errors ❌
from: can't read /var/mail/gpiozero
https://stackoverflow.com/questions/16069816/getting-python-error-from-cant-read-var-mail-bio
SyntaxError: Non-ASCII character '\xe6' in file ./test.py on line 32, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
http://python.org/dev/peps/pep-0263/
不支持中文
和 emoji
❌
demos
#!/usr/bin/env python
# coding: utf8
from gpiozero import LED
from time import sleep
led = LED(12)
# Change 12 to your GPIO pin
# block comments
"""
led.on()
sleep(3)
led.off()
"""
def run(time):
led.on()
sleep(time)
led.off()
def init(n):
i = 0
while i < n:
print(i)
i += 1
sleep(1)
run(1)
# python 接收命令行参数❓
init(7)