I'm beginner in Python. I'am using Pycharm community for Python script. The code i run have some custom packages imported, from that IDE(Pycharm) code runs as expected the output is good. The problem is if I ran that code file from local drive by double click the prompt says package not found.Why so?. requesting help.
// The file I'm Trying To Run
from StackOverflow import Speak
import datetime
def time_compare():
now = datetime.datetime.now()
today12pm = now.replace(hour=12,minute=0,second=0,microsecond=1)
today4pm = now.replace(hour=15,minute=0,second=0,microsecond=0)
today6pm = now.replace(hour=18, minute=0, second=0, microsecond=0)
if now < today12pm:
Speak.Sen_speak ("Good Morning Shiv!")
elif today12pm <= now and now < today4pm:
Speak.Sen_speak("Good Afternoon Shiv")
elif today4pm <= now and now <today6pm:
Speak.Sen_speak("Good Evening Shiv")
else:
Speak.Sen_speak("It seems to be night, are we really going to work")
input("Press Enter To exit")
time_compare()
The File I'am Importing
import pyttsx
def Sen_speak(msg):
try:
engine = pyttsx.init()
engine.setProperty('voice', 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_ZIRA_11.0')
engine.say(msg)
engine.runAndWait()
return 'said'
except:
return 'Err'
def Testing_method():
message = raw_input("Enter To Speak")
result = Sen_speak(message)
if result == 'said':
print ("Said Successfully")
else:
print ("Error With Sound")
#Testing_method()