By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,585 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,585 IT Pros & Developers. It's quick & easy.

Re: Why gives "k = 09" a syntax error ?

P: n/a
Guilherme Polo wrote:
On 10/29/08, Stef Mientki <st**********@gmail.comwrote:
>hello,

Why gives "k = 09" a syntax error ?


09 is not a valid octal number. Instead use 011.

Ok, I guess you were not aware that prefixing a number with a '0'
would cause python to parse it as an octal and now you know.
thanks guys,
I didn't realize there were still people using octal notation ;-)

cheers,
Stef
Oct 29 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Oct 29, 2:44*pm, Stef Mientki <stef.mien...@gmail.comwrote:
Guilherme Polo wrote:
On 10/29/08, Stef Mientki <stef.mien...@gmail.comwrote:
hello,
*Why gives "k = 09" *a syntax error ?
09 is not a valid octal number. Instead use 011.
Ok, I guess you were not aware that prefixing a number with a '0'
would cause python to parse it as an octal and now you know.

thanks guys,
I didn't realize there were still people using octal notation ;-)
Windows users don't have much need for it, but it's still
popular with the 'Nix crowd.
>
cheers,
Stef
Oct 29 '08 #2

P: n/a
In article <67**********************************@34g2000hsh.g ooglegroups.com>,
Mensanator <me********@aol.comwrote:
>On Oct 29, 2:44*pm, Stef Mientki <stef.mien...@gmail.comwrote:
>Guilherme Polo wrote:
On 10/29/08, Stef Mientki <stef.mien...@gmail.comwrote:
>hello,
>*Why gives "k = 09" *a syntax error ?
09 is not a valid octal number. Instead use 011.
Ok, I guess you were not aware that prefixing a number with a '0'
would cause python to parse it as an octal and now you know.

thanks guys,
I didn't realize there were still people using octal notation ;-)

Windows users don't have much need for it, but it's still
popular with the 'Nix crowd.
Oct 29 '08 #3

P: n/a
On Oct 29, 4:17�pm, cla...@lairds.us (Cameron Laird) wrote:
In article <6772c5db-cdcc-4f79-9a24-1da8e849c...@34g2000hsh.googlegroups.com>,

Mensanator �<mensana...@aol.comwrote:
On Oct 29, 2:44�pm, Stef Mientki <stef.mien...@gmail.comwrote:
Guilherme Polo wrote:
On 10/29/08, Stef Mientki <stef.mien...@gmail.comwrote:
hello,
�Why gives "k = 09" �a syntax error ?
09 is not a valid octal number. Instead use 011.
Ok, I guess you were not aware that prefixing a number with a '0'
would cause python to parse it as an octal and now you know.
thanks guys,
I didn't realize there were still people using octal notation ;-)
Windows users don't have much need for it, but it's still
popular with the 'Nix crowd.

� � � � � � � � � � � � .
� � � � � � � � � � � � .
� � � � � � � � � � � � .
I contest that; my observation is that it's entirely an artifact
of legacy software,
Really? Don't they still use octal for this stuff?

$ ls -l
total 1717
-r-xr-x---+ 1 mensanator Users 57 Mar 29 2008 Cygwin.bat
-r-xr-x---+ 1 mensanator Users 7022 Mar 29 2008 Cygwin.ico
d---------+ 5 mensanator None 0 Apr 21 2008 Seed7
-rwxr-xr-x 1 mensanator None 15870 Apr 11 2008 a.exe
|
This would be 0755, wouldn't it? You certainly wouldn't want
to try to figure out the decimal equivalent.

? and regarded as no better than a distraction
by even the most narrow human 'Nixers,
Appears necessary to me.
or the hardware types who
might at one time have found octal natural. �My own origins were
in hardware, Unix, and other DEC OSs, so I consider myself as
likely as anyone to think in octal--and I rarely do.

While I can't accept the "popular" part,
I meant popular as in ubiquitous, not that I imagined there was
anybody who liked to use it.
I agree with you that
Unix people are at least more likely to recognize the 0-prefix.
Oct 30 '08 #4

P: n/a
Cameron Laird wrote:
In article <67**********************************@34g2000hsh.g ooglegroups.com>,
Mensanator <me********@aol.comwrote:
>On Oct 29, 2:44 pm, Stef Mientki <stef.mien...@gmail.comwrote:
>>Guilherme Polo wrote:
On 10/29/08, Stef Mientki <stef.mien...@gmail.comwrote:
hello,
Why gives "k = 09" a syntax error ?
09 is not a valid octal number. Instead use 011.
Ok, I guess you were not aware that prefixing a number with a '0'
would cause python to parse it as an octal and now you know.
thanks guys,
I didn't realize there were still people using octal notation ;-)
Windows users don't have much need for it, but it's still
popular with the 'Nix crowd.
.
.
.
I contest that; my observation is that it's entirely an artifact
of legacy software, and regarded as no better than a distraction
by even the most narrow human 'Nixers, or the hardware types who
might at one time have found octal natural. My own origins were
in hardware, Unix, and other DEC OSs, so I consider myself as
likely as anyone to think in octal--and I rarely do.

While I can't accept the "popular" part, I agree with you that
Unix people are at least more likely to recognize the 0-prefix.
They are also more likely to write

chmod 330 file

than

chmod ug=rw file

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Oct 30 '08 #5

P: n/a
Mensanator wrote:
On Oct 29, 4:17�pm, cla...@lairds.us (Cameron Laird) wrote:
>I contest that; my observation is that it's entirely an artifact
of legacy software,

Really? Don't they still use octal for this stuff?

$ ls -l
total 1717
-r-xr-x---+ 1 mensanator Users 57 Mar 29 2008 Cygwin.bat
-r-xr-x---+ 1 mensanator Users 7022 Mar 29 2008 Cygwin.ico
d---------+ 5 mensanator None 0 Apr 21 2008 Seed7
-rwxr-xr-x 1 mensanator None 15870 Apr 11 2008 a.exe
|
This would be 0755, wouldn't it? You certainly wouldn't want
to try to figure out the decimal equivalent.
There was a suggestion to dump octal literals. The above is why they
were not.

Oct 30 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.