Re: [Tutor] Permissions Error

2012-03-25 Thread Steven D'Aprano
Michael Lewis wrote: Hi everyone, If I've created a folder, why would I receive a permissions error when trying to copy the file. My source code is here: http://pastebin.com/1iX7pGDw The usual answer to "why would I receive a permissions error" is that you don't actually have permission to ac

Re: [Tutor] Permissions Error

2012-03-25 Thread Evert Rol
> Hi everyone, > > If I've created a folder, why would I receive a permissions error when trying > to copy the file. My source code is here: > http://pastebin.com/1iX7pGDw What's the permission error you get? Can't you copy the file, or not create the destination directory? Or you may not be al

[Tutor] Permissions Error

2012-03-25 Thread Michael Lewis
Hi everyone, If I've created a folder, why would I receive a permissions error when trying to copy the file. My source code is here: http://pastebin.com/1iX7pGDw When I check the properties/security of the file in question, the system says I have full control. Thanks. -- Michael Lewis _

Re: [Tutor] Error Handling

2012-03-25 Thread Joel Goldstick
On Sun, Mar 25, 2012 at 12:54 PM, Michael Lewis wrote: > In the below block, why is the if statement e.errno != errno.EEXIST? > Why can the errno be both before and after the "."? > > > > import os, errno > try: >     os.makedirs('a/b/c') > except OSError, e: >     if e.errno != errno.EEXIST: >  

[Tutor] Error Handling

2012-03-25 Thread Michael Lewis
In the below block, why is the if statement e.errno != errno.EEXIST? Why can the errno be both before and after the "."? import os, errno try: os.makedirs('a/b/c') except OSError, e: if e.errno != errno.EEXIST: raise -- Michael J. Lewis mjole...@gmail.com 415.815.7257

Re: [Tutor] Question about input

2012-03-25 Thread Joel Goldstick
On Sun, Mar 25, 2012 at 11:52 AM, Asif Kazmi wrote: > The odd thing is that the same code runs perfectly in the Mac terminal, but > incorrectly in Komodo Edit. In the latter, the input prompts are somehow > being included  into the variables themselves somehow due to the way Komodo > works. > > Th

Re: [Tutor] Error handling

2012-03-25 Thread Mark Lawrence
On 25/03/2012 08:22, Russel Winder wrote: Michael, On Sat, 2012-03-24 at 15:20 -0700, Michael Lewis wrote: [...] It is perhaps worth noting that in Python 3, the syntax has changed: import os, errno try: os.makedirs('a/b/c') except OSError, e: except OSError as e : if e.errno

Re: [Tutor] Question about input

2012-03-25 Thread Asif Kazmi
The odd thing is that the same code runs perfectly in the Mac terminal, but incorrectly in Komodo Edit. In the latter, the input prompts are somehow being included into the variables themselves somehow due to the way Komodo works. Thanks for the help. I've just taken to running the code in the Ma

Re: [Tutor] Question about input

2012-03-25 Thread Joel Goldstick
On Sun, Mar 25, 2012 at 1:31 AM, Asif Kazmi wrote: > 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 >

Re: [Tutor] getUncPath(mappedDrive)

2012-03-25 Thread Tim Golden
On 25/03/2012 09:12, Albert-Jan Roskam wrote: Thank you so much for this! I think this would also be a valuable addition to os.path (where I'd expect it to be). You call WNetGetConnection twice: one time with a 'dummy' string buffer, and one time with a buffer of the exact require

Re: [Tutor] getUncPath(mappedDrive)

2012-03-25 Thread Albert-Jan Roskam
> > From: Tim Golden >To: Albert-Jan Roskam >Cc: Python Mailing List >Sent: Saturday, March 24, 2012 11:25 PM >Subject: Re: [Tutor] getUncPath(mappedDrive) > >On 24/03/2012 21:29, Albert-Jan Roskam wrote: >>    Thanks! This seems a feasible approach. I ha

Re: [Tutor] Error handling

2012-03-25 Thread Russel Winder
Michael, On Sat, 2012-03-24 at 15:20 -0700, Michael Lewis wrote: [...] It is perhaps worth noting that in Python 3, the syntax has changed: > import os, errno > try: > > os.makedirs('a/b/c') > except OSError, e: except OSError as e : > > if e.errno != errno.EEXIST: > > raise