我如何将python programm作为后台进程运行,并仅显示cmd用于输入和输出操作。 考虑以下代码:
import pyttsx3;
import pickle;
import speech_recognition as sr
engine = pyttsx3.init();
rate = engine.getProperty('rate')
engine.setProperty('rate', rate-25)
volume = engine.getProperty('volume')
engine.setProperty('volume', volume+0.50)
mic_name = "USB Device 0x46d:0x825: Audio (hw:1, 0)"
sample_rate = 8000
chunk_size = 128
r = sr.Recognizer()
mic_list = sr.Microphone.list_microphone_names()
engine.say(" Hello Mr.amit , welcome to the first project");
engine.runAndWait();
engine.say("please enter username and password ");
engine.runAndWait();
print("please enter username and password")
c=input("Username:")
d=input("Password:")
ss=0
pickle_in = open("dictpersonal.pickle","rb")
users= pickle.load(pickle_in)
for us in users:
if(c==us):
engine.say("log in successfully");
engine.runAndWait();
print("log in successfully as =",c);
ss=ss+1;
break;
if(ss==0):
engine.say("Username not found.Want to sign up using this username,enter y ");
我只想在需要输入或输出操作时打开cmd。如果我使用pythonw.exe运行此程序
pythonw.exe C:\Users\amit\Desktop\MachineLearning\Projects\Personal\f3.py
我无法插入用户名和密码