Python sh:1:start:not found是什么意思?
我正在用谷歌文本转换语音制作一个树莓皮聊天机器人。这是我的密码:Python sh:1:start:not found是什么意思?,python,python-3.x,raspberry-pi3,gtts,Python,Python 3.x,Raspberry Pi3,Gtts,我正在用谷歌文本转换语音制作一个树莓皮聊天机器人。这是我的密码: import os from gtts import gTTS import time text_to_read = "Hello my name is Alex. What's your name? " language = 'en' slow_audio_speed = False filename = '1.mp3' filename2 = '2.mp3' filename3 = '3.mp3' f
import os
from gtts import gTTS
import time
text_to_read = "Hello my name is Alex. What's your name? "
language = 'en'
slow_audio_speed = False
filename = '1.mp3'
filename2 = '2.mp3'
filename3 = '3.mp3'
filename4 = '4.mp3'
filename5 = '5.mp3'
filename6 = '6.mp3'
filename7 = '7.mp3'
filename8 = '8.mp3'
filename9 = '9.mp3'
filename10 = '10.mp3'
filename11 = '11.mp3'
filename12 = '12.mp3'
def reading_from_string():
audio_created = gTTS(text=text_to_read, lang=language,
slow=slow_audio_speed)
audio_created.save(filename)
os.system(f'start {filename}')
def reading_from_string2():
audio_created2 = gTTS(text=text_to_read2, lang=language,
slow=slow_audio_speed)
audio_created2.save(filename2)
os.system(f'start {filename2}')
def reading_from_string3():
audio_created3 = gTTS(text=text_to_read3, lang=language,
slow=slow_audio_speed)
audio_created3.save(filename3)
os.system(f'start {filename3}')
def reading_from_string4():
audio_created4 = gTTS(text=text_to_read4, lang=language,
slow=slow_audio_speed)
audio_created4.save(filename4)
os.system(f'start {filename4}')
def reading_from_string5():
audio_created5 = gTTS(text=text_to_read5, lang=language,
slow=slow_audio_speed)
audio_created5.save(filename5)
os.system(f'start {filename5}')
def reading_from_string6():
audio_created6 = gTTS(text=text_to_read6, lang=language,
slow=slow_audio_speed)
audio_created6.save(filename6)
os.system(f'start {filename6}')
def reading_from_string11():
audio_created11 = gTTS(text=text_to_read11, lang=language,
slow=slow_audio_speed)
audio_created11.save(filename11)
os.system(f'start {filename11}')
def reading_from_string12():
audio_created12 = gTTS(text=text_to_read12, lang=language,
slow=slow_audio_speed)
audio_created12.save(filename12)
os.system(f'start {filename12}')
f=open('name.txt','r+')
x=f.read()
f.close()
answer = input (reading_from_string())
if answer == x :
text_to_read11 = "Hello again"
reading_from_string11()
f=open('name.txt','r')
g=f.read()
text_to_read12 = g
time.sleep(0.5)
reading_from_string12()
f.close()
else:
name=answer
f=open('name.txt', 'w')
f.write(name)
f.close()
text_to_read2 = 'Hello'
reading_from_string2()
text_to_read3 = (name)
time.sleep(0.5)
reading_from_string3()
text_to_read4= 'What do you like'
text_to_read6 = input (reading_from_string4())
y=open('likes.txt','w')
x=text_to_read6
y.write(x)
y.close()
text_to_read5 = 'storing memory'
reading_from_string5()
time.sleep(1)
reading_from_string6()
顺便说一下,它直接从text_到_read6到text_到_read11,因为我删除了一段不必要的代码
以下是它打开读取和写入的文件:
下面是代码产生的错误(在它说none是我输入的地方,当它说sh:1:start:not found是它应该使用gTTS模块说话的地方,我使用pip3安装gTTS安装了gTTS)
你知道什么地方出了问题,我该怎么解决
谢谢。此错误是由于
start
不是您试图在其上运行脚本的操作系统上的命令所致<代码>开始仅在Windows上的cmd.exe下可用
打开。您对os.system(f'start{filename12}')
的调用-找不到名为start
的命令。谢谢。你知道我该如何解决这个问题吗?我在我的华为笔记本电脑上运行了这个代码,它工作正常,那么我的raspberry pi有什么问题吗?我猜我还没有安装软件包或其他东西。我想我问错了问题,应该是这个代码或其他东西有什么问题
sh: 1: start: not found
Nonearthur
sh: 1: start: not found
sh: 1: start: not found
sh: 1: start: not found
Nonephysics maths and piano
sh: 1: start: not found
sh: 1: start: not found