- Codice: Seleziona tutto
# this program is open source.
a="pydos"
print " PY-DOS 0.1 "
print "Welcome to PY-DOS,A Distro of WIN-DOS.Type creditsPY,licensePY,infoPY,ThanksPY or helpPY for various info"
f=raw_input("Command?")
if f=="licensePY":
print "THIS PROGRAM IS OPEN SOURCE.YOU ARE ALLOWED TO REDISTRIBUTE VERBATIM COPIES OF THIS SCRIPT."
if f== "creditsPY":
print " © Tech Develop X 2010."
if f=="infoPY":
print "This program Is a modification of WIN-DOS,Created be Tech Develop X.You'll need IDLE(PHYTON GUI) 2.X to run this script, personalize the App launcher And The Text creating."
if f=="ThanksPY":
print "Thanks to Guido van rossum,Creator of Phyton Programming Language."
if f=="helpPY":
print "COMMANDS;Calculator:type calc(Addition type +;Subtraction type -;Multiplication type x;Division type /);App Launcher:type apps;Type something in a text file:txt;Any other word:Close Py-Dos."
if f=="calc":
b=raw_input("Operation?")
if b=="+":
num1=input("Number?")
num2=input("Number?")
num3=input("Number?")
print"Total sum of inserted numbers is:",num1+num2+num3
if b=="-":
num1=input("Number?")
num2=input("Number?")
num3=input("Number?")
print"Total sum of inserted numbers is:",num1-num2-num3
if b=="x":
num1=input("Number?")
num2=input("Number?")
num3=input("Number?")
print"Total sum of inserted numbers is:",num1*num2*num3
if b=="/":
num1=input("Number?")
num2=input("Number?")
num3=input("Number?")
print"Total sum of inserted numbers is:",num1/num2/num3
if a=="txt":
fileHandle = open ( 'testexample.txt', 'wb' )
fileHandle.write ( 'EXAMPLE.' )
fileHandle.close()
si avvia ma...
- Codice: Seleziona tutto
Welcome to PY-DOS,A Distro of WIN-DOS.Type creditsPY,licensePY,infoPY,ThanksPY or helpPY for various info
Number?1
Number?1
Number?1
Total sum of inserted numbers is: 3
Total sum of inserted numbers is: -1
Total sum of inserted numbers is: 1
Total sum of inserted numbers is: 1
Traceback (most recent call last):
File "C:\Documents and Settings\GIORGIO\Desktop\WIN-DOS\winpy.py", line 38, in <module>
os.chdir('C:\program files\Mozilla Firefox')
NameError: name 'os' is not defined
Grazie in anticipo =)