Newbie question regarding string.split()

2007-04-20 Thread kevinliu23
Hey guys, So I have a question regarding the split() function in the string module. Let's say I have an string... input = "2b 3 4bx 5b 2c 4a 5a 6" projectOptions = (input.replace(" ", "")).split('2') print projectOptions ['', 'b34bx5b', 'c4a5a6'] My question is, why is the first element of proj

Re: Newbie question regarding string.split()

2007-04-21 Thread kevinliu23
On Apr 21, 3:30 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > kevinliu23 a écrit :> Hey guys, > > > So I have a question regarding the split() function in the string > > module. Let's say I have an string... > > > input = "2b 3 4bx 5b 2

Best way to wait for string input

2007-03-29 Thread kevinliu23
Hi guys, Python newbie here for some expert help. So basically I want to design a menu system that waits for a string input. I'm not sure what the best way of going about this is. The current system waits for a single character input using msvcrt.kbhit( ) and msvcrt.getch( ). Is there something eq

Inserting '-' character in front of all numbers in a string

2007-03-30 Thread kevinliu23
Hey guys, I want to be able to insert a '-' character in front of all numeric values in a string. I want to insert the '-' character to use in conjunction with the getopt.getopt() function. Rigt now, I'm implementing a menu system where users will be able to select a set of options like "2a 3ab"

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread kevinliu23
Hey guys, thanks for the quick replies. I'm looking for something more generic than adding it to "2a 3ab". For example, under the menu option 2, there can be upwards of 8 other suboptions. I'll see what's suggested here and post back if I run into more problems. Thanks guys! -- http://mail.python

How to check for remaining hard drive space in Windows?

2007-02-28 Thread kevinliu23
HI, I am new to Python and wanted to know how to check for the remaining disk space on my Windows machine using Python? I was thinking of using the command line "dir" and trying to extract the output from there. But I'm not sure how to extract command line strings using Python either. Anyway help

Re: How to check for remaining hard drive space in Windows?

2007-02-28 Thread kevinliu23
Thanks so much for the help guys. I got the code Sick Monkey provided to work on my computer. Now I"m more confused than ever though. :) I thought the only standard modules provided by Python are listed here: http://docs.python.org/modindex.html But it appears that there are other modules availab

Re: How to check for remaining hard drive space in Windows?

2007-02-28 Thread kevinliu23
t leave it blank and the function will automatically use the rootPath of where the .py file resides? Both have returned the correct result. Kevin On Feb 28, 4:24 pm, "kevinliu23" <[EMAIL PROTECTED]> wrote: > Thanks so much for the help guys. I got the code Sick Monkey provided

Re: How to check for remaining hard drive space in Windows?

2007-02-28 Thread kevinliu23
H, right now...I'm doing multiplication on the index values returned by GetDiskFreeSpace. According to the documentation... tuple[0]: sectors per cluster tuple[1]: number of bytes per sector tuple[2]: total number of free clusters tuple[3]: total number of clusters on the disk So I'm multiply

Re: How to check for remaining hard drive space in Windows?

2007-03-01 Thread kevinliu23
AIL PROTECTED]> wrote: > kevinliu23 wrote: > > Just tried your solution Tim, worked like a charm. :) > > > It's great because I don't even have to worry about the computer name. > > A question regarding the rootPath parameter...how would I be passing