首页 > 编程语言 >Python errors All In One

Python errors All In One

时间:2023-03-29 18:57:40浏览次数:50  
标签:errors led Python python sleep xgqfrms com

Python errors All In One

errors ❌

  1. from: can't read /var/mail/gpiozero

https://stackoverflow.com/questions/16069816/getting-python-error-from-cant-read-var-mail-bio

  1. 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

image

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)


(

标签:errors,led,Python,python,sleep,xgqfrms,com
From: https://www.cnblogs.com/xgqfrms/p/17269990.html

相关文章