Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如果int(lista[2])==0:indexer错误:列表索引超出范围 导入序列号 导入时间 导入smtplib 从email.mime.text导入MIMEText #序列号:dmesg | grep-v断开| grep-Eo“tty(ACM | USB)。| tail-1 ser=serial.serial('/dev/ttyACM0',9600) flushInput爵士() 定义iluminacion(列表a): #移动机器人 dato='5' #科德纳达斯gmail环境 如果int(lista[2])==0: correo_origen='***********' 反之亦然,'********' correo_destino='***********' a=”https://www.google.com/maps?q=" b=列表A[3] texto=a+str(b) msg=MIMEText(texto) msg['Subject']='COORDENADAS DE LA PERSONA' msg['From']=correo_origen msg['To']=correo_destino server=smtplib.SMTP('SMTP.gmail.com',587) server.starttls() 服务器登录(correo_origen,contraseña) sendmail(correo\u origen、correo\u destino、msg.as\u string()) 打印(文本) server.quit() 返回达托 返回列表a 尽管如此: 尝试: lineBytes=ser.readline() line=lineBytes.decode('latin-1').strip() lista=line.split(“,”) 打印(列表A) mensaje=iluminacion(lista).encode('latin-1') 斯莱特爵士(门萨耶) 睡眠时间(0.5) 除键盘中断外: 打破_Python_String - Fatal编程技术网

Python 如果int(lista[2])==0:indexer错误:列表索引超出范围 导入序列号 导入时间 导入smtplib 从email.mime.text导入MIMEText #序列号:dmesg | grep-v断开| grep-Eo“tty(ACM | USB)。| tail-1 ser=serial.serial('/dev/ttyACM0',9600) flushInput爵士() 定义iluminacion(列表a): #移动机器人 dato='5' #科德纳达斯gmail环境 如果int(lista[2])==0: correo_origen='***********' 反之亦然,'********' correo_destino='***********' a=”https://www.google.com/maps?q=" b=列表A[3] texto=a+str(b) msg=MIMEText(texto) msg['Subject']='COORDENADAS DE LA PERSONA' msg['From']=correo_origen msg['To']=correo_destino server=smtplib.SMTP('SMTP.gmail.com',587) server.starttls() 服务器登录(correo_origen,contraseña) sendmail(correo\u origen、correo\u destino、msg.as\u string()) 打印(文本) server.quit() 返回达托 返回列表a 尽管如此: 尝试: lineBytes=ser.readline() line=lineBytes.decode('latin-1').strip() lista=line.split(“,”) 打印(列表A) mensaje=iluminacion(lista).encode('latin-1') 斯莱特爵士(门萨耶) 睡眠时间(0.5) 除键盘中断外: 打破

Python 如果int(lista[2])==0:indexer错误:列表索引超出范围 导入序列号 导入时间 导入smtplib 从email.mime.text导入MIMEText #序列号:dmesg | grep-v断开| grep-Eo“tty(ACM | USB)。| tail-1 ser=serial.serial('/dev/ttyACM0',9600) flushInput爵士() 定义iluminacion(列表a): #移动机器人 dato='5' #科德纳达斯gmail环境 如果int(lista[2])==0: correo_origen='***********' 反之亦然,'********' correo_destino='***********' a=”https://www.google.com/maps?q=" b=列表A[3] texto=a+str(b) msg=MIMEText(texto) msg['Subject']='COORDENADAS DE LA PERSONA' msg['From']=correo_origen msg['To']=correo_destino server=smtplib.SMTP('SMTP.gmail.com',587) server.starttls() 服务器登录(correo_origen,contraseña) sendmail(correo\u origen、correo\u destino、msg.as\u string()) 打印(文本) server.quit() 返回达托 返回列表a 尽管如此: 尝试: lineBytes=ser.readline() line=lineBytes.decode('latin-1').strip() lista=line.split(“,”) 打印(列表A) mensaje=iluminacion(lista).encode('latin-1') 斯莱特爵士(门萨耶) 睡眠时间(0.5) 除键盘中断外: 打破,python,string,Python,String,列表数组的大小小于3 您正在尝试访问不存在的数组(或列表)的位置 数组的索引从0开始,在大小为1时结束 例如,如果arr[]数组的大小为5,则可访问位置为0到4。如果您试图访问位置5或大于5,那么它将给您索引错误pero la lista tiene 4 valores[“0”、“0”、“0”、“0.00.000”]el problema es que la lista llamada line va moviendo sus valores osea primero muestra[“0”、“

列表数组的大小小于3

您正在尝试访问不存在的数组(或列表)的位置

数组的索引从0开始,在大小为1时结束


例如,如果arr[]数组的大小为5,则可访问位置为0到4。如果您试图访问位置5或大于5,那么它将给您索引错误

pero la lista tiene 4 valores[“0”、“0”、“0”、“0.00.000”]el problema es que la lista llamada line va moviendo sus valores osea primero muestra[“0”、“0”、“0”、“0.00.000”]despues[“0”、“0”、“0”、“0.00.000”]luego[“0”、“0.00.00.000”]你的意思是:“-”但是列表有4个值[“0”、“0”、“0”、“0.00.000”]问题是称为line的列表首先移动它的值,它显示[“0”、“0”、“0”、“0.00.000”]然后是[“0”、“0”、“0.00.000”]然后是[“0”、“0.00.000”]等等”。我不懂西班牙语。我用谷歌翻译的。请不要破坏你的帖子。