Re: Couple of noobish question

2009-02-05 Thread Tim Rowe
2009/2/5 Bruno Desthuilliers : > Thanks for the correction - as you may have guessed, I have not used windows > for years !-) And I can't get Linux running (more precisely, I can't /keep/ X-Windows running). Isn't it a good job that Python is cross-platform -- as long as we stay clear of the os m

Re: Couple of noobish question

2009-02-05 Thread Bruno Desthuilliers
Tim Rowe a écrit : 2009/2/4 Bruno Desthuilliers : # somemodule.py import os if os.uname()[0] == "Linux": On an MS Windows system, os.uname()[0] raises an AttributeError Thanks for the correction - as you may have guessed, I have not used windows for years !-) -- http://mail.python.org/m

Re: Couple of noobish question

2009-02-04 Thread afriere
On Feb 5, 11:45 am, Tim Rowe wrote: [snip] > Python in a Nutshell states that os.uname "exists only on certain > platforms", and in the code sample wraps it in a try statement. That > seems to be the safe way to go -- except (and I don't know much about > this) wouldn't code have to be digging

Re: Couple of noobish question

2009-02-04 Thread Tim Rowe
2009/2/5 : > On Feb 5, 11:14 am, Tim Rowe wrote: > > ... > >> On an MS Windows system, os.uname()[0] raises an AttributeError -- sys >> doesn't seem to contain uname. Is that a Linux thing? Would os.name >> work on Linux? Or would one have to use exception handling and catch >> the Windows case?

Re: Couple of noobish question

2009-02-04 Thread afriere
On Feb 5, 11:14 am, Tim Rowe wrote: ... > On an MS Windows system, os.uname()[0] raises an AttributeError -- sys > doesn't seem to contain uname. Is that a Linux thing? Would os.name > work on Linux? Or would one have to use exception handling and catch > the Windows case? It seems to be a Wind

Re: Couple of noobish question

2009-02-04 Thread Tim Rowe
2009/2/4 Bruno Desthuilliers : > # somemodule.py > > import os > > if os.uname()[0] == "Linux": On an MS Windows system, os.uname()[0] raises an AttributeError -- sys doesn't seem to contain uname. Is that a Linux thing? Would os.name work on Linux? Or would one have to use exception handling and

Re: Couple of noobish question

2009-02-04 Thread Bruno Desthuilliers
Catherine Heathcote a écrit : Firstly hi, I don't know any of you yet but am picking up Python and will be lurking here a lot lol. I am a hobbiest coder (did 3 out of 4 years of a comp tech degree, long story) and am learning Python, 'cos I saw some code and it just looks a really nice language

Re: Couple of noobish question

2009-02-04 Thread Gary Herron
Catherine Heathcote wrote: > Firstly hi, I don't know any of you yet but am picking up Python and > will be lurking here a lot lol. I am a hobbiest coder (did 3 out of 4 > years of a comp tech degree, long story) and am learning Python, 'cos > I saw some code and it just looks a really nice languag

Re: Couple of noobish question

2009-02-04 Thread Catherine Heathcote
Mike Driscoll wrote: On Feb 4, 10:47 am, Catherine Heathcote wrote: Firstly hi, I don't know any of you yet but am picking up Python and will be lurking here a lot lol. I am a hobbiest coder (did 3 out of 4 years of a comp tech degree, long story) and am learning Python, 'cos I saw some code an

Re: Couple of noobish question

2009-02-04 Thread Mike Driscoll
On Feb 4, 10:47 am, Catherine Heathcote wrote: > Firstly hi, I don't know any of you yet but am picking up Python and > will be lurking here a lot lol. I am a hobbiest coder (did 3 out of 4 > years of a comp tech degree, long story) and am learning Python, 'cos I > saw some code and it just looks