Re: [Tutor] Error handling

2012-03-24 Thread Sithembewena Lloyd Dube
That is because 'errno' is a property on the exception object called 'e', not the other way around. On Sun, Mar 25, 2012 at 7:12 AM, Michael Lewis wrote: > > > On Sat, Mar 24, 2012 at 3:51 PM, Colton Myers wrote: > >> I am having a bit of trouble understanding what is going on below. What >> do

[Tutor] Question about input

2012-03-24 Thread Asif Kazmi
Hello, I'm going through Python Programming for the Absolute Beginner, 3rd edition, on a Mac with Python 3.2. In the second chapter, the book gives sample code that shows how a logical error can occur: # Trust Fund Buddy - Bad # Demonstrates a logical error print( """ Trust Fund Bud

Re: [Tutor] Error handling

2012-03-24 Thread Michael Lewis
On Sat, Mar 24, 2012 at 3:51 PM, Colton Myers wrote: > I am having a bit of trouble understanding what is going on below. What > does the "e" in "except OSError, e:" do? > Any other help you can provide regarding errno would be extremely > appreciated. I've done help() and dir() on it, but I am n

Re: [Tutor] Library of Module for Analyzing Answer Cards

2012-03-24 Thread bob gailer
Remember to always reply-all so a copy goes to the list. On 3/24/2012 7:49 AM, Khalid Al-Ghamdi wrote: thanks a lot that was extremely helpful.  On Fri, Mar 23, 2012 at 3:58 AM, bob gailer wrote:

Re: [Tutor] Error handling

2012-03-24 Thread Colton Myers
> I am having a bit of trouble understanding what is going on below. What does > the "e" in "except OSError, e:" do? > Any other help you can provide regarding errno would be extremely > appreciated. I've done help() and dir() on it, but I am not really > understanding what's going on with "e.e

Re: [Tutor] getUncPath(mappedDrive)

2012-03-24 Thread Tim Golden
On 24/03/2012 21:29, Albert-Jan Roskam wrote: Thanks! This seems a feasible approach. I have found this Python project that exposes some of the functions of mpr.dll: http://sourceforge.net/projects/wnetconnect/ WNetGetConnection is not among the functions, but the code will help.

[Tutor] Error handling

2012-03-24 Thread Michael Lewis
Hi everyone, I am having a bit of trouble understanding what is going on below. What does the "e" in "except OSError, e:" do? Any other help you can provide regarding errno would be extremely appreciated. I've done help() and dir() on it, but I am not really understanding what's going on with "e.e

Re: [Tutor] getUncPath(mappedDrive)

2012-03-24 Thread Albert-Jan Roskam
From: Tim Golden >To: >Cc: Python Mailing List >Sent: Saturday, March 24, 2012 9:22 PM >Subject: Re: [Tutor] getUncPath(mappedDrive) > >On 24/03/2012 20:13, Albert-Jan Roskam wrote: >> Hi, >> >> Is there a function that takes a file path with a mapped drive >> (z:\blah) and returns the ass

Re: [Tutor] getUncPath(mappedDrive)

2012-03-24 Thread Tim Golden
On 24/03/2012 20:13, Albert-Jan Roskam wrote: Hi, Is there a function that takes a file path with a mapped drive (z:\blah) and returns the associated UNC path (\\server\share\ding\dang\dong\blah)? I looked in os.path, but it doesn't seem to have this. The link below seems to be a solution (code

[Tutor] getUncPath(mappedDrive)

2012-03-24 Thread Albert-Jan Roskam
Hi, Is there a function that takes a file path with a mapped drive (z:\blah) and returns the associated UNC path (\\server\share\ding\dang\dong\blah)? I looked in os.path, but it doesn't seem to have this. The link below seems to be a solution (code in the bottom of the page), but I can't insta

Re: [Tutor] working with c_byte?

2012-03-24 Thread Dave Angel
On 03/24/2012 04:14 AM, Alan Gauld wrote: On 24/03/12 03:51, Alex Hall wrote: Of course, 9 means the battery is high and charging, but how do I interpret an arbitrary integer as the sum of its flags? Is there a binary trick I can use? Dave has given the immediate answer which is a subset of a

Re: [Tutor] working with c_byte?

2012-03-24 Thread Alan Gauld
On 24/03/12 03:51, Alex Hall wrote: Of course, 9 means the battery is high and charging, but how do I interpret an arbitrary integer as the sum of its flags? Is there a binary trick I can use? Dave has given the immediate answer which is a subset of a general technique known as bitwise maskin