Re: [Tutor] Python help

2009-04-25 Thread Alan Gauld
IT_ForMe snice14...@aol.com wrote cart = {apple:2.00, orange:2.50, banana:1.75} You set this up but then don't use it. Also your problem statement said *some* items were taxable, implying some were not. You might want to record whether an item is taxable in the dictionary too. print cart

[Tutor] Is it syntactic,semantic or runtime?

2009-04-25 Thread prasad rao
helloI wrote a function to fetch data using urllib and displaying the data using internet Explorer. it is not preparing the html file So opening blank Explorer after complaining th html file not found. Where is the problem? Can I display the data read from a site without preparing a html file?

Re: [Tutor] Is it syntactic,semantic or runtime?

2009-04-25 Thread Sander Sweers
2009/4/25 prasad rao prasadarao...@gmail.com: So opening blank Explorer after complaining th html file not found. Where is the problem? There are typing errors on the below... code def pp(): @@@ import urllib @@@ import subprocess @@@ so=urllib.urlopen('http://www.asstr.org') @@@

[Tutor] output formatting

2009-04-25 Thread Matt Domeier
Hello, I have a series of lists that I need to output into files with a specific format. Specifically, I need to have line breaks after each entry of the list, and I need to do away with the ['..'] that accompany the data after I transform the list into a string. Can I simply append a

Re: [Tutor] output formatting

2009-04-25 Thread W W
On Fri, Apr 24, 2009 at 10:57 PM, Matt Domeier dome...@umich.edu wrote: Hello, I have a series of lists that I need to output into files with a specific format. Specifically, I need to have line breaks after each entry of the list, and I need to do away with the ['..'] that accompany the

Re: [Tutor] Threading...

2009-04-25 Thread Kent Johnson
On Fri, Apr 24, 2009 at 5:26 PM, Spencer Parker inthefri...@gmail.com wrote: I have a script that I want to test MySQL sonnections with.  The way I have the script working is to just create connections, but I realized that it is going to wait for the first one to stop before starting a new

Re: [Tutor] Is it syntactic,semantic or runtime?

2009-04-25 Thread Alan Gauld
prasad rao prasadarao...@gmail.com wrote helloI wrote a function to fetch data using urllib and displaying the data using internet Explorer. it is not preparing the html file So opening blank Explorer after complaining th html file not found. The specific problem has been addressed but in

Re: [Tutor] output formatting

2009-04-25 Thread Dave Angel
Matt Domeier wrote: Hello, I have a series of lists that I need to output into files with a specific format. Specifically, I need to have line breaks after each entry of the list, and I need to do away with the ['..'] that accompany the data after I transform the list into a string. Can

[Tutor] Working with lines from file and printing to another keeping sequential order

2009-04-25 Thread Dan Liang
Dear Tutors, I have a file from which I want to extract lines that end in certain strings and print to a second file. More specifically, I want to: 1) iterate over each line in the file, and if it ends in yes, print it. 2) move to the line following the one described in #1 above, and if it ends

Re: [Tutor] Working with lines from file and printing to another keeping sequential order

2009-04-25 Thread bob gailer
Dan Liang wrote: Dear Tutors, I have a file from which I want to extract lines that end in certain strings and print to a second file. More specifically, I want to: 1) iterate over each line in the file, and if it ends in yes, print it. 2) move to the line following the one described in #1

[Tutor] # what do I do now to kill the the Windows program which has finished its work?

2009-04-25 Thread Ian Campbell
I am converting a Windows ProComm script into Python and need help. ; previous Procomm script here run c:\buy.exe taskId; this runs the c:\buy.exe program and assigns the task identification number to the integer variable called taskId pause 1

Re: [Tutor] output formatting

2009-04-25 Thread spir
Le Sat, 25 Apr 2009 11:02:47 -0400, Matt Domeier dome...@umich.edu s'exprima ainsi: Hi Wayne, Yes, that should work perfectly, but it is in writing files that I'm having the problem. I'm still very new to python, so I only know to use something like filename.write(str(listname)) to

Re: [Tutor] output formatting

2009-04-25 Thread Matt Domeier
Hi Wayne, Yes, that should work perfectly, but it is in writing files that I'm having the problem. I'm still very new to python, so I only know to use something like filename.write(str(listname)) to write my list to a file.. Is there a straightforward method of combining the ease of the

Re: [Tutor] Working with lines from file and printing to another keeping sequential order

2009-04-25 Thread Dan Liang
Hi Bob and tutors, Thanks Bob for your response! currently I have the current code, but it does not work: ListLines= [] for line in open('test.txt'): line = line.rstrip() ListLines.append(line) for i in range(len(ListLines)): if ListLines[i].endswith(yes) and

Re: [Tutor] Working with lines from file and printing to another keeping sequential order

2009-04-25 Thread Shantanoo Mahajan (शंत नू महा जन)
On 25-Apr-09, at 11:41 PM, Dan Liang wrote: Hi Bob and tutors, Thanks Bob for your response! currently I have the current code, but it does not work: ListLines= [] for line in open('test.txt'): line = line.rstrip() ListLines.append(line) for i in range(len(ListLines)): if

Re: [Tutor] # what do I do now to kill the the Windows program which has finished its work?

2009-04-25 Thread Alan Gauld
Ian Campbell ian-campb...@shaw.ca wrote os.startfile(c:\\buy.exe , 'OPEN')# THIS WORKS and returns but does not return the taskID Take a look at the subprocess module. # what do I do now to kill the the Windows program which has finished its work? This is trickier, if the program

Re: [Tutor] python books

2009-04-25 Thread chinmaya
On Mon, Apr 13, 2009 at 11:07 PM, sudhanshu gautam sudhanshu9...@gmail.comwrote: I am new in python , so need a good books , previously read python Bible and swaroop but not satisfied . so tell me good books in pdf format those contents good problems also

Re: [Tutor] python books

2009-04-25 Thread Dayo Adewunmi
chinmaya wrote: On Mon, Apr 13, 2009 at 11:07 PM, sudhanshu gautam sudhanshu9...@gmail.com mailto:sudhanshu9...@gmail.com wrote: I am new in python , so need a good books , previously read python Bible and swaroop but not satisfied . so tell me good books in pdf format those

[Tutor] I may have solved my problem with killing tasks in Windows

2009-04-25 Thread Ian Campbell
I am trying to use this so maybe no one has to reply... sorry to inconvenience anyone. I got it from Google but did not copy his name and cannot give my thanks to original author, sorry. import subprocess from win32event import WaitForSingleObject, WAIT_TIMEOUT from win32api import

Re: [Tutor] Working with lines from file and printing to another keeping sequential order

2009-04-25 Thread bob gailer
Dan Liang wrote: Hi Bob and tutors, Thanks Bob for your response! currently I have the current code, but it does not work: [snip] Thank you for code, sample data and more complete specs. Lines in the file look like following: word1 word2 word3 word4 yes word1 word2 word3 word4 no

Re: [Tutor] # what do I do now to kill the the Windows program which has finished its work?

2009-04-25 Thread Kent Johnson
On Sat, Apr 25, 2009 at 11:35 AM, Ian Campbell ian-campb...@shaw.ca wrote: I am converting a Windows ProComm script into Python and  need help. ;  previous Procomm  script here run c:\buy.exe taskId                ; this runs the c:\buy.exe program and assigns the  task identification number