Re: [Tutor] slashes in paths

2013-07-23 Thread Jim Mooney
On 23 July 2013 00:42, Steven D'Aprano wrote: My, that is simple. The Python docs should start with simple explanations like that so people would keep on reading instead of throwing up their hands in despair ;') > > - use the encode method to go from text to bytes, and decode to go the > other w

Re: [Tutor] slashes in paths

2013-07-23 Thread Steven D'Aprano
On 23/07/13 04:33, Marc Tompkins wrote: On Mon, Jul 22, 2013 at 11:30 AM, Jim Mooney wrote: On 22 July 2013 11:26, Marc Tompkins wrote: If you haven't already read it, may I suggest Joel's intro to Unicode? http://www.joelonsoftware.com/articles/Unicode.html I had a bad feeling I'd end

Re: [Tutor] slashes in paths

2013-07-22 Thread Jim Mooney
On 22 July 2013 15:12, Alan Gauld wrote: When I used an old VT220 on a VAX I always used to reverse the display to > show black characters on a light (green or amber) screen. It used to freak > out my colleagues who were traditionalist green on black men... > I think a lot of old sonar guys went

Re: [Tutor] slashes in paths

2013-07-22 Thread Alan Gauld
On 22/07/13 22:50, Jim Mooney wrote: I'm sticking to 20 pt Lucida Console on a big, full screen DOS box with navy letters and cyan background. If you have a big screen might as well use it. Why the DOS box defaults to being so tiny is beyond me. Depends what you mean by tiny. On a 1024x768 di

Re: [Tutor] slashes in paths

2013-07-22 Thread Jim Mooney
> Just to clarify, tree isn't completely Unicode naive. It writes > Unicode to the console, presuming you're using a font that supports > it, such as Consolas. > I'm sticking to 20 pt Lucida Console on a big, full screen DOS box with navy letters and cyan background. If you have a big screen migh

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 2:34 PM, eryksun wrote: > > Just to clarify, tree isn't completely Unicode naive. It writes > Unicode to the console, presuming you're using a font that supports > it, such as Consolas. > Interesting! Indeed - I just moved my test Cyrillic file to a different folder (so

Re: [Tutor] slashes in paths

2013-07-22 Thread Jim Mooney
On 22 July 2013 14:15, Marc Tompkins wrote: > > > You could do worse... Again, my issue with TREE is that it willfully > throws away information (non-ASCII characters in filenames) before passing > it on to you. As a result, the tree you print out may not correspond to > the actual filesystem s

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 2:00 PM, Jim Mooney wrote: > so I should just walk the python27 tree and write my own box drawing > chars? Or is there a more global alternative to DOS box-drawing chars to > illustrate a tree structure, other than graphic processing? > You could do worse... Again, my is

Re: [Tutor] slashes in paths

2013-07-22 Thread Jim Mooney
On 22 July 2013 12:48, Marc Tompkins wrote: > > > You'd be better off skipping TREE entirely and going pure-Python. TREE - > being Unicode-naive - can't deal with any foreign-alphabet characters > beyond the few baked in alongside the box-drawing characters; they all get > turned into question m

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 11:57 AM, Jim Mooney wrote: > I had a bad feeling I'd end up learning Unicode ;') > >> >> >> It's not as painful as you might think! Try it - you'll like it! >> Actually, once you start getting used to working in Unicode by default, >> having to deal with programs that are

Re: [Tutor] slashes in paths

2013-07-22 Thread Jim Mooney
I had a bad feeling I'd end up learning Unicode ;') > > > It's not as painful as you might think! Try it - you'll like it! > Actually, once you start getting used to working in Unicode by default, > having to deal with programs that are non-Unicode-aware feels extremely > irritating. > I'll have

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 11:30 AM, Jim Mooney wrote: > On 22 July 2013 11:26, Marc Tompkins wrote: > >> >> >> >> If you haven't already read it, may I suggest Joel's intro to Unicode? >> http://www.joelonsoftware.com/articles/Unicode.html >> > > I had a bad feeling I'd end up learning Unicode ;')

Re: [Tutor] slashes in paths

2013-07-22 Thread Marc Tompkins
On Mon, Jul 22, 2013 at 10:47 AM, Jim Mooney wrote: I forgot about TREE. But figured piping C:\Python27>tree /f > pytree.txt > might be illuminating. I piped since it took forever to print because I > have python(x,y). Unfortunately, I got tiny numbers and A with umlauts > instead of the nice path

Re: [Tutor] slashes in paths

2013-07-22 Thread Jim Mooney
On 22 July 2013 11:26, Marc Tompkins wrote: > > > > If you haven't already read it, may I suggest Joel's intro to Unicode? > http://www.joelonsoftware.com/articles/Unicode.html > I had a bad feeling I'd end up learning Unicode ;') -- Jim ___ Tutor ma

Re: [Tutor] slashes in paths

2013-07-22 Thread Jim Mooney
On 22 July 2013 03:51, eryksun wrote: > On Sun, Jul 21, 2013 at 9:18 PM, Marc Tompkins > wrote: > > CP/M itself didn't use '/' switches in its internal CCP commands, even > if some 3rd party programs did. Neither did COMMAND.COM in Tim > Paterson's 86-DOS. Microsoft added the switches (but Pater

Re: [Tutor] slashes in paths

2013-07-21 Thread Marc Tompkins
On Sun, Jul 21, 2013 at 7:41 PM, Jim Mooney wrote: > On 21 July 2013 18:18, Marc Tompkins wrote: > > > But back in the late 1970s, no way in Hell did Gates see Linux on the > > horizon. He saw CP/M, and the choices that he (and MS in general) made > at > > that time were intended to be compatibl

Re: [Tutor] slashes in paths

2013-07-21 Thread Marc Tompkins
On Sat, Jul 20, 2013 at 4:37 PM, Jim Mooney wrote: > If only Bill Gates hadn't chosen '\', which is awkward to type and > hard to make compatible - but I think he figured his wonderful DOS > would be a Unix-killer, reign supreme, and there would be no > compatibility problem. All I can say to tha

Re: [Tutor] slashes in paths

2013-07-20 Thread Dave Angel
On 07/20/2013 08:24 PM, Steve Willoughby wrote: On 20-Jul-2013, at 16:37, Jim Mooney wrote: If only Bill Gates hadn't chosen '\', which is awkward to type and hard to make compatible - but I think he figured his wonderful DOS would be a Unix-killer, reign supreme, and there would be no compati

Re: [Tutor] slashes in paths

2013-07-20 Thread Dominik George
Hi, the base path is \, and one exists for every drive. C:\foo is foo in C:'s root, C:foo is foo in C:'s current working directory. -nik Jim Mooney schrieb: >On 20 July 2013 13:46, Alan Gauld wrote: > >> The fact that you gave it a prefix containing forward >> slashes is confusing things.

Re: [Tutor] slashes in paths

2013-07-20 Thread Dominik George
Hi Jim, > But oddly, it makes all slashes forward if I end the path with a > forward slash, so it's not consistent with itself. It is, in the sense that it preserves any form of seperator that is already there. It just doesn't throw away what you want to be there: >>> import ntpath >>> ntpath.

Re: [Tutor] slashes in paths

2013-07-20 Thread Alan Gauld
On 20/07/13 19:24, Jim Mooney wrote: I was looking at os.path.join, which is supposed to join paths intelligently. It does including taking account of OS specific separators. Which in the case of Windows is notionally the backslash. The fact that you gave it a prefix containing forward slashes

Re: [Tutor] slashes in paths

2013-07-20 Thread Dominik George
Hi, > >>> soundfile13 > 'c:/python27/jimprogs/wav\\bicycle_bell.wav' > >>> > > with single forward slashes mixed with a double backslash > > it comes out even worse if I print it > > c:/python27/jimprogs/wav\bicycle_bell.wav - no double backslash, > which could create a mess if someone copied