Re: Doubled backslashes in Windows paths

2016-10-28 Thread eryk sun
On Fri, Oct 28, 2016 at 8:04 PM, Gilmeh Serda wrote: > > You can use forward slash to avoid the messy problem. There are cases in which you need to use backslash, such as extended paths and command lines. Python 3's pathlib automatically normalizes a Windows

Re: Doubled backslashes in Windows paths [Resolved]

2016-10-07 Thread BartC
On 07/10/2016 18:41, Oz-in-DFW wrote: On 10/7/2016 12:30 AM, Oz-in-DFW wrote: I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on Windows 7 I'm trying to write some file processing that looks at file size, extensions, and several other things and

Re: Doubled backslashes in Windows paths [Resolved]

2016-10-07 Thread Oz-in-DFW
On 10/7/2016 12:30 AM, Oz-in-DFW wrote: > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > v.1900 32 bit (Intel)] on Windows 7 > > I'm trying to write some file processing that looks at file size, > extensions, and several other things and I'm having trouble getting a >

Re: Doubled backslashes in Windows paths

2016-10-07 Thread BartC
On 07/10/2016 13:39, BartC wrote: On 07/10/2016 06:30, Oz-in-DFW wrote: I'm getting an error message on an os.path.getsize call; But the main error appears to be due to the presence of quotes, whether at each end, or inside the path, enclosing an element with spaces for example. Try using

Re: Doubled backslashes in Windows paths

2016-10-07 Thread eryk sun
On Fri, Oct 7, 2016 at 10:46 AM, Steve D'Aprano wrote: > That's because > > "C: > > is an illegal volume label (disk name? I'm not really a Windows user, and > I'm not quite sure what the correct terminology here would be). It's not an illegal device name, per se.

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Ned Batchelder
On Friday, October 7, 2016 at 8:39:55 AM UTC-4, BartC wrote: > On 07/10/2016 06:30, Oz-in-DFW wrote: > > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > > v.1900 32 bit (Intel)] on Windows 7 > > > > I'm trying to write some file processing that looks at file size, > >

Re: Doubled backslashes in Windows paths

2016-10-07 Thread eryk sun
On Fri, Oct 7, 2016 at 9:27 AM, Peter Otten <__pete...@web.de> wrote: > To fix the problem either use forward slashes (which are understood by > Windows, too) Using forward slash in place of backslash is generally fine, but you need to be aware of common exceptions, such as the following: (1)

Re: Doubled backslashes in Windows paths

2016-10-07 Thread BartC
On 07/10/2016 06:30, Oz-in-DFW wrote: I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on Windows 7 I'm trying to write some file processing that looks at file size, extensions, and several other things and I'm having trouble getting a reliably

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Steve D'Aprano
On Fri, 7 Oct 2016 04:30 pm, Oz-in-DFW wrote: > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > v.1900 32 bit (Intel)] on Windows 7 > > I'm trying to write some file processing that looks at file size, > extensions, and several other things and I'm having trouble

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Peter Otten
Oz-in-DFW wrote: > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC > v.1900 32 bit (Intel)] on Windows 7 > > I'm trying to write some file processing that looks at file size, > extensions, and several other things and I'm having trouble getting a > reliably usable path

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Stephen Tucker
Hi Oz, This might only be tangential to your actual issue, but, there again, it might be the tiny clue that you actually need. In Python, I use raw strings and single backslashes in folder hierarchy strings to save the problem of the backslash in ordinary strings. Even with this policy, however,

Doubled backslashes in Windows paths

2016-10-07 Thread Oz-in-DFW
I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on Windows 7 I'm trying to write some file processing that looks at file size, extensions, and several other things and I'm having trouble getting a reliably usable path to files. The problem *seems*