How to convert a string like '777' to an octal integer like 0777?

KB kbchung at hongik.ac.kr
Sun Jul 31 07:27:45 CEST 2005


Hi,

This may be a rudimentary question:

How to convert a string like '777' to an octal integer like 0777,
so that it can be used in os.chmod('myfile',0777)?

I know the leading zero is important in os.chmod.

KB




More information about the Python-list mailing list