[Pydev-code] pydev problems?
Brought to you by:
fabioz
|
From: hadrien a. <had...@ya...> - 2008-01-17 15:32:35
|
Hi,
I'm a newbie in Python and I'm trying to use the Eclipse IDE for start programming with this language, so I installed the Pydev plugin 1.3.11 on Eclipse 3.3.0.
I prove with this downloaded script example:
import os, sys
seguir=""
nota=0
deci=0
car=1
chon=0
rem=""
inversion=""
er=deci
hex=0
no=""
noe=""
while car==1:
try:
option=raw_input("Chose an option:\n a) Convert a Binary number to Decimal.\n b) Convert a Decimal number to Binary.\n c) Convert a Decimal number to Hexadecimal.\nWrite an option: ")
if option=="a":
bin=str(raw_input("Write a binary number: "))
try:
print int(bin,2), "This is the Decimal"
except:
print "This is not binary"
seguir=raw_input("Continue (s/n): ")
if option=="b":
try:
num=int(raw_input("Write a Decimal number: "))
while num>0:
chon=num%2
rem+=str(chon)
num/=2
for caracter in rem:
inversion=caracter+inversion
print inversion, "This is the Binary"
except:
print "This is not a Decimal"
inversion=""
rem=""
seguir=raw_input("Continue(s/n): ")
if option=="c":
try:
deci=int(raw_input("Write a Decimal number: "))
while deci>0:
hex=deci%16
if hex<10:
no=str(hex)
if hex==10:
no="A"
if hex==11:
no="B"
if hex==12:
no="C"
if hex==13:
no="D"
if hex==14:
no="E"
if hex==15:
no="F"
noe+=no
deci/=16
for caracter in noe:
inversion=caracter+inversion
print inversion,"This is the Hexadecimal."
inversion=""
noe=""
except:
print "This is not a decimal number"
segeuir=raw_input("Continue(s/n): ")
except:
print "Invalid option"
seguir=raw_input("Continue(s/n): ")
if seguir=="s":
car=1
elif seguir=="n":
print "ENDED"
car=0
else:
print "Invalid option"
When I try to run it with Pydev the console doesn't read the letters I write (for the options: a, b, c) so the option is always wrong, but when I run the program with the IDLE, I have no problem and all it's ok. Where is the problem? What can I do?
Thanks!
---------------------------------
Web Revelación Yahoo! 2007:
Premio Favorita del Público - ¡Vota tu preferida! |