pippin418
05-09-2010, 07:21 AM
I feel like a huge newbie.
I can't figure out what's going wrong here.
if com == 'remf':
rem = raw_input("What file: ")
rea = raw_input("Really remove %s? (y/n): " % rem)
if rea in ('y'):
try:
os.remove(rem)
except OSError as (errno, strerror):
if errno == 256:
print "That is a directory, del deletes files. Use remd."
pen()
goto .home
elif errno == 2:
print "File does not exist."
pen()
goto .home
else:
goto .home
elif rea in ('n'):
goto .home
In that, see where rea = raw_input("Really remove %s? (y/n): " % rem) is? When I try to stimulate the 256 error, it tells me that the command I tried to input does not exist (an error message I put in my code)
So it processes my "y" as com == "y", I think.
Where is it wrong?
http://i44.tinypic.com/wiq64z.png
Above shows what happens, at '>>>' if I typed something that is not a command that error would've shown.
I can't figure out what's going wrong here.
if com == 'remf':
rem = raw_input("What file: ")
rea = raw_input("Really remove %s? (y/n): " % rem)
if rea in ('y'):
try:
os.remove(rem)
except OSError as (errno, strerror):
if errno == 256:
print "That is a directory, del deletes files. Use remd."
pen()
goto .home
elif errno == 2:
print "File does not exist."
pen()
goto .home
else:
goto .home
elif rea in ('n'):
goto .home
In that, see where rea = raw_input("Really remove %s? (y/n): " % rem) is? When I try to stimulate the 256 error, it tells me that the command I tried to input does not exist (an error message I put in my code)
So it processes my "y" as com == "y", I think.
Where is it wrong?
http://i44.tinypic.com/wiq64z.png
Above shows what happens, at '>>>' if I typed something that is not a command that error would've shown.