On Sun, 31 Jul 2005 00:24:08 -0700, KB wrote:

> Thanks, John.
> 
> But my point is how to keep the leading zero in 0777,
> in order to be used in os.chmod('myfile', 0777)?

os.chmod('myfile', 0777)

Python will recognise integers written in octal if you leave a
leading zero, and in hex if you use a leading 0x or 0X.

>>> 010
8
>>> 0x10
16
>>> 010 + 0x10
24

As John pointed out, you don't have to use octal for chmod. You can use
decimal, or hex -- anything that is an integer.

-- 
Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to