Re: [Tutor] create an xls file using data from a txt file

2011-05-12 Thread Peter Otten
Steve Willoughby wrote: On 11-May-11 15:54, Prasad, Ramit wrote: Core windows commands don't generally accept it, including native Windows applications (although sometimes they're lenient in what they accept). It'll work for command-line Python script usage because it's *python* that allows

Re: [Tutor] create an xls file using data from a txt file

2011-05-12 Thread Tim Golden
To confirm: Python does *nothing* to convert automatically from one form of path separator to another. Windows from very early on, has accepted /-slashes as path separators to API calls. Where they don't work is: at the command shell itself presumably since slashes are commonly used to introduce

Re: [Tutor] create an xls file using data from a txt file

2011-05-12 Thread Prasad, Ramit
| Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -Original Message- From: Steve Willoughby [mailto:st...@alchemy.com] Sent: Wednesday, May 11, 2011 6:24 PM To: Prasad, Ramit; tutor@python.org Subject: Re: [Tutor] create an xls file using data from

Re: [Tutor] create an xls file using data from a txt file

2011-05-12 Thread Steve Willoughby
Maybe we're splitting hairs over semantics then. I thought there was confusion about what the CLI shell was doing with file separators as opposed to just handing the arguments as-is to the applications (which is true... the CLI doesn't really process them much, it's up to the application.

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Dave Angel
On 01/-10/-28163 02:59 PM, tax botsis wrote: I have the following txt file that has 4 fields that are tab separated: the first is the id and the other three show the results per test. 152 TEST1 valid TEST3 good TEST2 bad 158 TEST2 bad TEST1 bad TEST4 valid . . . Based on the above txt I need

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Walter Prins
On 11 May 2011 03:57, tax botsis taxbot...@gmail.com wrote: I tried to work that out with xlwt but couldn't. Actually, I started working on the following script but I couldn't even split the line for further processing: OK, I've thrown together a quick sample demonstrating all the concepts

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread tee chwee liong
('output.csv','w')) AttributeError: 'module' object has no attribute 'writer' i'm using Python 2.5 and Win XP. pls help advise. thanks tcl Date: Wed, 11 May 2011 14:05:12 +0100 From: wpr...@gmail.com To: taxbot...@gmail.com CC: tutor@python.org Subject: Re: [Tutor] create an xls file using data from

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Walter Prins
On 11 May 2011 14:34, tee chwee liong tc...@hotmail.com wrote: hi all, thanks for this sharing. when i copy and run this code, i got this error: Traceback (most recent call last): File C:/Python25/myscript/excel/sampleexcel.py, line 1, in module import csv File

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread James Reynolds
your \ is a / when writing out a string, such as 'C:\test.xls', the / is an escape in python. So you have two choices, You can either write out path = 'C:\\test.xls', which will be 'C:\test.xls' or you can write out path = r'C:\test.xls' the r bit tells python that the following is a regular

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Joel Goldstick
On Wed, May 11, 2011 at 1:26 PM, James Reynolds eire1...@gmail.com wrote: your \ is a / when writing out a string, such as 'C:\test.xls', the / is an escape in python. So you have two choices, You can either write out path = 'C:\\test.xls', which will be 'C:\test.xls' or you can write out

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Prasad, Ramit
your \ is a / when writing out a string, such as 'C:\test.xls', the / is an escape in python. So you have two choices, You can either write out path = 'C:\\test.xls', which will be 'C:\test.xls' or you can write out path = r'C:\test.xls' the r bit tells python that the following is a regular

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread James Reynolds
Yes, thank you. Actually, I never knew that about the windows separators, since I've just always used the '\' out of habit. On Wed, May 11, 2011 at 2:39 PM, Prasad, Ramit ramit.pra...@jpmchase.comwrote: your \ is a / when writing out a string, such as 'C:\test.xls', the / is an escape

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Steve Willoughby
On 11-May-11 12:14, James Reynolds wrote: Actually, I never knew that about the windows separators, since I've just always used the '\' out of habit. If you want your code to run everywhere, you should use the functions in os.path to manipulate and build paths. Otherwise, using \ all the

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread davidheiserca
. - Original Message - From: Steve Willoughby st...@alchemy.com To: tutor@python.org Sent: Wednesday, May 11, 2011 12:48 PM Subject: Re: [Tutor] create an xls file using data from a txt file On 11-May-11 12:14, James Reynolds wrote: Actually, I never knew that about the windows separators, since

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Prasad, Ramit
Core windows commands don't generally accept it, including native Windows applications (although sometimes they're lenient in what they accept). It'll work for command-line Python script usage because it's *python* that allows them, not *windows*. They work in *Windows* command prompt

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread Steve Willoughby
On 11-May-11 15:54, Prasad, Ramit wrote: Core windows commands don't generally accept it, including native Windows applications (although sometimes they're lenient in what they accept). It'll work for command-line Python script usage because it's *python* that allows them, not *windows*. They

Re: [Tutor] create an xls file using data from a txt file

2011-05-11 Thread tee chwee liong
excellent it works. tq Date: Wed, 11 May 2011 14:58:39 +0100 Subject: Re: [Tutor] create an xls file using data from a txt file From: wpr...@gmail.com To: tc...@hotmail.com CC: taxbot...@gmail.com; tutor@python.org On 11 May 2011 14:34, tee chwee liong tc...@hotmail.com wrote: hi all