473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
5 1634
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the...
6
by: vips | last post by:
Page_Load datagrid1.datasource=dataset1 //I am filling the datagrid and it works fine when page is displayed end ---------------
0
by: Pixie | last post by:
We are successfully getting a handle to a drive using createfile then using that handle to query the change journal using DeviceIOControl with the paramter FSCTL_QUERY_USN_DATA. However when we try...
12
by: arnuld | last post by:
in C++ Primer 4/3 Lippman says in chapter 3, section 3.3.1: vector<stringsvec(10); // 10 elements, each an empty string here is the the code output & output from my Debian box running "gcc...
4
by: rukkie | last post by:
Hi, I have some problems with a PHP reference in a <SCRIPTtag, but only with the Internet Explorer, which gives a "Error on page" message in the Status Bar. The code is as follows : <script>...
3
by: mohammadazim | last post by:
Hi guys I wrote a socket program in c++ and used blocking system call read () for receiving data on socket. But it gives following error while compilation g++ -Wall -g -I`pwd`/../include...
6
by: ranesmitas | last post by:
Hi ,I am using Visual Basic Backend SQL I create form in which i create Command button NEW ,MODIFY, VIEW,SAVE,EXIT all my programme is running but when i add new record and save and then i...
1
by: Stef Mientki | last post by:
hello, Why gives "k = 09" a syntax error ? thanks, Stef Mientki
0
by: Guilherme Polo | last post by:
On 10/29/08, Stef Mientki <stef.mientki@gmail.comwrote: 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...
3
by: Terry Reedy | last post by:
Stef Mientki wrote: You have gotten the 2.x answer. In 3.0, 0b,0o,0x prefixes are valid and required for binary, octal, and hexadecimal literals. 0digits is invalid. tjr
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.