directory - python raw input delete the zero in the begining? -


I use this code to create a directory with input from the user, but when entering the perfix like 00 or 011 , Then ask for the first inputs: except for numRan = int (raw_input ("how many perfix do you want to start? \" ")): Print" perfix should be a number "sys.exit ()

Any explanation?

The function ignores any leading zeros in the string.

But it seems that you can simply leave inpt as a string in your code:

  inpt = raw_input ("perfix % D: "% (i + 1))  

If you want to allow only numbers, you can use it.


Comments

Popular posts from this blog

python - Strange behavior using PyQt4's 'pyqtSlot' decorator before another decorator -

c# - UnhandledExceptionMode.ThrowException for AppDomain.UnhandledException -

c# - Process.Kill() returns access denied -