HomeForum
Best View on: Firefox Chrome Opera Edge

Problemo python

Qui puoi commentare o postare una qualunque idea che ti viene in mente. Tuttavia non sono ammesse richieste.

QUESTO POST TI E/' PIACIUTO? DILLO A TUTTI I TUOI AMICI!

Condividi su Facebook Facebook Condividi su Twitter Twitter Condividi su Orkut Orkut Condividi su MySpace MySpace Condividi su Delicious Delicious Condividi su Technorati Technorati
Avatar utente
Wii User
Wii User
    Windows XP Mozilla
Messaggi: 143
Iscritto il: 02/06/2010, 11:53
Località: CatHouse
Grz inviati: 17 volte
Grz ricevuti: 2 volte
Messaggio Problemo python 
Inviato: 17/08/2010, 19:33
Salve a tutti.Ho compilato una shell in batch che si chiama win-dos.ora pero la vorrei fare in python.Codice scritto,ma non funziona bene!ve lo faccio vedere:
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 =)
Ultima modifica di ciaox il 17/08/2010, 21:25, modificato 2 volte in totale.
Wii bianca 4.1E,ovviamente PAL
Bootmii as IOS
cIOS Rev. 21 D2X V4
cIOS Hermes V5
Homebrew channel(Aka HBC) 1.0.8
Neogamma R9 Beta 43
Mighty channels + un sacco di WiiWare e giochi VC
Sneek

Immagine
Avatar utente
Moderatore
Moderatore
    Windows Vista Chrome
Messaggi: 7160
Iscritto il: 10/01/2010, 18:52
Località: Sassari
Grz inviati: 163 volte
Grz ricevuti: 791 volte
Sesso:
Messaggio Re: Problemo python
Inviato: 17/08/2010, 20:12
è sbagliato il nome del percorso o del file (hai compilato in modo non del tutto esatto). Ti sta dicendo che non hai definito il nome del file. Comunque codice davvero ben fatto.
QUI TROVERETE I LINK DEI GIOCHI PER WII!!!

Lista completa delle guide


ImmagineImmagine
http://www.pikky.net/images/1251107544107.gif
http://i40.tinypic.com/2zovpl1.gif

http://img828.imageshack.us/img828/1003/hni0027h.jpg

Immagine
Se uno vuole aiutare lo fa perchè vuole farlo non solo per ricevere un thanks.
Immagine
Avatar utente
Wii User
Wii User
    Windows XP Mozilla
Messaggi: 143
Iscritto il: 02/06/2010, 11:53
Località: CatHouse
Grz inviati: 17 volte
Grz ricevuti: 2 volte
Messaggio Re: Problemo python
Inviato: 17/08/2010, 21:10
mi dice che il nome OS non e definito...anche togliendo la stringa di "apps" va male lo script.
non dovrebbe subito eseguire la calcolatrice,ma dovrebbe stamare a schermo py-dos e restare in attesa per un input di dati.
Wii bianca 4.1E,ovviamente PAL
Bootmii as IOS
cIOS Rev. 21 D2X V4
cIOS Hermes V5
Homebrew channel(Aka HBC) 1.0.8
Neogamma R9 Beta 43
Mighty channels + un sacco di WiiWare e giochi VC
Sneek

Immagine
Avatar utente
Wii User
Wii User
    Windows XP Mozilla
Messaggi: 143
Iscritto il: 02/06/2010, 11:53
Località: CatHouse
Grz inviati: 17 volte
Grz ricevuti: 2 volte
Messaggio Re: Problemo python
Inviato: 17/08/2010, 21:22
sistemato il problema dell'avvio automatico della calc,bastava impostare alla variabile a un raw_input...la stringa dell'avviare un programma la ho cancellata,solo che mi da un altro errore:
Codice: Seleziona tutto
                                                                                               PY-DOS 0.1                                                                                                                       
Welcome to PY-DOS,A Distro of WIN-DOS.Type creditsPY,licensePY,infoPY,ThanksPY or helpPY for various info
Command?creditsPY
© Tech Develop X 2010.
Total sum of inserted numbers is: 6
Total sum of inserted numbers is: -2
Number?23
Number?34
Number?32
Total sum of inserted numbers is: 25024
Total sum of inserted numbers is: 0
cosa cavolo significa!?! non ho mica calcolato qualcosa io che dopo aver inserito un comando mi dai una risposta,pure sbagliata.Se volete guardate il source code,magari ho sbagliato li
Wii bianca 4.1E,ovviamente PAL
Bootmii as IOS
cIOS Rev. 21 D2X V4
cIOS Hermes V5
Homebrew channel(Aka HBC) 1.0.8
Neogamma R9 Beta 43
Mighty channels + un sacco di WiiWare e giochi VC
Sneek

Immagine
Avatar utente
Noob (active) User
Noob (active) User
    Windows XP Chrome
Messaggi: 95
Iscritto il: 19/07/2010, 16:08
Località: Possagno - Udine
Grz inviati: 4 volte
Grz ricevuti: 1 volte
Messaggio Re: Problemo python
Inviato: 18/08/2010, 11:39
Se volete guardate il source code,magari ho sbagliato li


E' quello del primo post?
Hai fatto ulteriori modifiche?

Dicci un po' come funge e che vuoi che faccia ... scrivi il man insomma! :P
Yes, I am a criminal. My crime is that of curiosity.

May the source be with you.

-mf
Avatar utente
Wii User
Wii User
    Windows XP Mozilla
Messaggi: 143
Iscritto il: 02/06/2010, 11:53
Località: CatHouse
Grz inviati: 17 volte
Grz ricevuti: 2 volte
Messaggio Re: Problemo python
Inviato: 23/08/2010, 15:59
Grazie raga,Ma progetto rimandato.
Wii bianca 4.1E,ovviamente PAL
Bootmii as IOS
cIOS Rev. 21 D2X V4
cIOS Hermes V5
Homebrew channel(Aka HBC) 1.0.8
Neogamma R9 Beta 43
Mighty channels + un sacco di WiiWare e giochi VC
Sneek

Immagine

Sponsor

Sponsor
 


Torna a Programmazione

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite

cron