Re: [Tutor] string to integer

2006-01-05 Thread Brian van den Broek
Alan Gauld said unto the world upon 05/01/06 04:16 PM: >>Here is how it should work: >>val(7) = 7 >>val(bbab7) = 7 >>val(aa7aa) = 7 >>val( 7) = 7 > > > There is no direct equivalent for val() as shpwn above the > nearest is int() or float() but that will only work with the first > and last e

[Tutor] Python upgrade from 2.3 to 2.4

2006-01-05 Thread Srinivas Iyyer
Hi, I might be asking this question out of context. however, eversince I started working with Python, the only mailing list that I used ever is this. So this could be also the other reason that I am posting here. I am currently using Python 2.3 for windows XP. I wanted to use PyExcellerator modu

Re: [Tutor] Disabling a frame in Tkinter

2006-01-05 Thread Hans Dushanthakumar
Thanks John, Yup the code you provided disables all child-widgets: def setState(self, widget, state='disabled'): print type(widget) try: widget.configure(state=state) except Tkinter.TclError: pass for child in widget.winfo_children():

Re: [Tutor] Syntax Error

2006-01-05 Thread Kris Kerwin
> On 06/01/06, Kris Kerwin <[EMAIL PROTECTED]> wrote: > > unix_name = string.replace(new_file_name, ' ', '\ ' > > Well, there seems to be a closing parenthesis missing on this line > :-) Oh. :-) > By the way --- starting with python2.2 (?), most of the functions > in the string module are

Re: [Tutor] Syntax Error

2006-01-05 Thread John Fouhy
On 06/01/06, Kris Kerwin <[EMAIL PROTECTED]> wrote: > unix_name = string.replace(new_file_name, ' ', '\ ' Well, there seems to be a closing parenthesis missing on this line :-) By the way --- starting with python2.2 (?), most of the functions in the string module are deprecated in favour

[Tutor] Syntax Error

2006-01-05 Thread Kris Kerwin
Hi all, I'm working on a little script, but every time that I run it, it comes back as a syntax error around line 24. However, I can't find anything wrong with it. I figure that maybe I just need another set of eyes. Please take a look at this code, and let me know if you can find anything wro

Re: [Tutor] Excel files to Tab delim files

2006-01-05 Thread Danny Yoo
> >From that, you should be able to easliy produce a tab delimited file > (or anything else you want). There's even a 'csv' module in Python's Standard Library to handle some of the awkward cases in generating tab-delimited data: http://www.python.org/doc/lib/module-csv.html

Re: [Tutor] Disabling a frame in Tkinter

2006-01-05 Thread John Fouhy
On 06/01/06, Hans Dushanthakumar <[EMAIL PROTECTED]> wrote: > Hi, >Is there any way to disable an entire frame (and all its included > widgets) in Tkinter. It does not seem to support state=DISABLED. Not that I'm aware of... You could try maybe something like this (untested): def setState(wi

Re: [Tutor] Excel files to Tab delim files

2006-01-05 Thread John Fouhy
On 06/01/06, Srinivas Iyyer <[EMAIL PROTECTED]> wrote: > Dear group, > is there any library available that would convert > over 2000 .xls files to tab delim text files. Check out pyExcelerator: http://sourceforge.net/projects/pyexcelerator The documentation is a bit light, but basically, if you

[Tutor] Excel files to Tab delim files

2006-01-05 Thread Srinivas Iyyer
Dear group, is there any library available that would convert over 2000 .xls files to tab delim text files. I have over 2000 Excel files and I want to convert them to tab delim files, which has become a pain in brain. Thanks Srini __

Re: [Tutor] string to integer

2006-01-05 Thread Boyan R.
Thank you both I think I'll manage to continue with my program :) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] string to integer

2006-01-05 Thread Alan Gauld
> Here is how it should work: > val(7) = 7 > val(bbab7) = 7 > val(aa7aa) = 7 > val( 7) = 7 There is no direct equivalent for val() as shpwn above the nearest is int() or float() but that will only work with the first and last examples. (It is a pretty arbitrary functionn to convert aa7aa to

Re: [Tutor] Avoiding repetetive pattern match in re module (fwd)

2006-01-05 Thread Adam
On 05/01/06, Danny Yoo <[EMAIL PROTECTED]> wrote: -- Forwarded message --Date: Fri, 6 Jan 2006 01:53:41 +0530From: Intercodes <[EMAIL PROTECTED]>To: Danny Yoo < [EMAIL PROTECTED]>Subject: Re: [Tutor] Avoiding repetetive pattern match in re moduleHello Danny,Thanks for the response.

Re: [Tutor] string to integer

2006-01-05 Thread bob
At 12:40 PM 1/5/2006, Boyan R. wrote: >I need program to convert my string in integer. >I remember in BASIC I used val(string) command >Is there a Python equivalent ? > >Here is how it should work: >val(7) = 7 >val(bbab7) = 7 >val(aa7aa) = 7 >val( 7) = 7 > >This last is most important, currently

Re: [Tutor] string to integer

2006-01-05 Thread Danny Yoo
On Thu, 5 Jan 2006, Boyan R. wrote: > I need program to convert my string in integer. > I remember in BASIC I used val(string) command > Is there a Python equivalent ? > > Here is how it should work: > val(7) = 7 > val(bbab7) = 7 > val(aa7aa) = 7 > val( 7) = 7 Hi Boyan, Python has a functi

[Tutor] Disabling a frame in Tkinter

2006-01-05 Thread Hans Dushanthakumar
Hi, Is there any way to disable an entire frame (and all its included widgets) in Tkinter. It does not seem to support state=DISABLED. Another Tkinter question: In a listbox, how do I intially set a "selected" item? What I want to do here is have the 1st item in a listbox selected (ie highlight

Re: [Tutor] Avoiding repetetive pattern match in re module (fwd)

2006-01-05 Thread Danny Yoo
-- Forwarded message -- Date: Fri, 6 Jan 2006 01:53:41 +0530 From: Intercodes <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Avoiding repetetive pattern match in re module Hello Danny, Thanks for the response. The read() and join() method worked like

[Tutor] string to integer

2006-01-05 Thread Boyan R.
I need program to convert my string in integer. I remember in BASIC I used val(string) command Is there a Python equivalent ? Here is how it should work: val(7) = 7 val(bbab7) = 7 val(aa7aa) = 7 val( 7) = 7 This last is most important, currently I don't know how to convert string " 7" to

Re: [Tutor] Avoiding repetetive pattern match in re module

2006-01-05 Thread Danny Yoo
> >From a technical standpoint, it has "quadratic" complexity in terms of > what work the computer is doing. It's related to the mathematical idea > that 1 + 2 + 3 + 4 + ... + n = n(n+1). > > http://en.wikipedia.org/wiki/Triangle_number Gaa, where did my division sign go? *grin* Sorry, tha

Re: [Tutor] Avoiding repetetive pattern match in re module

2006-01-05 Thread Danny Yoo
> Instead of writing a new 'for,if' loop to filter the repetetive tags > from the list, is there something that I can add in the re itself to > match the pattern only once? Hi Intercodes, As far as I know, no: regular expressions don't have the capacity to remember what tags they've matched in p

Re: [Tutor] Further help needed!

2006-01-05 Thread John Corry
Notepad opens and prints the text file. Regards, John. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John Fouhy Sent: 04 January 2006 21:54 To: Tutor Subject: Re: [Tutor] Further help needed! [resending 'cause I forgot to address to tutor..] On 05/01/0

Re: [Tutor] Avoiding repetetive pattern match in re module

2006-01-05 Thread bob
At 02:41 AM 1/5/2006, Intercodes wrote: Hello everyone,     Iam new to this mailing list as well as python(uptime-3 weeks).Today I learnt about RE from http://www.amk.ca/python/howto/regex/.This one was really helpful. I started working out with few examples on my own. The first one was to colle

[Tutor] Avoiding repetetive pattern match in re module

2006-01-05 Thread Intercodes
Hello everyone,    Iam new to this mailing list as well as python(uptime-3 weeks).Today I learnt about RE from http://www.amk.ca/python/howto/regex/.This one was really helpful. I started working out with few examples on my own. The first one was to collect all the HTML tags used in an HTML file.