Re: [Tutor] How to install BeautifulSoup?

2010-10-28 Thread Richard D. Moores
On Thu, Oct 28, 2010 at 23:18, Abhijeet Rastogi wrote: > > In command prompt, do something like > > $python setup.py install Yes, that did it. Thanks! Dick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://ma

[Tutor] How to install BeautifulSoup?

2010-10-28 Thread Richard D. Moores
64-bit Vista Python 2.6.4 I just downloaded BeautifulSoup-3.0.8.1, which is a folder containing setup.py. Does anyone know how to run setup,py? I've already tried C:\Python26\Lib\site-packages\BeautifulSoup-3.0.8.1>setup.py File "C:\Python26\Lib\site-packages\BeautifulSoup-3.0.8.1\setup.py", li

Re: [Tutor] (no subject)

2010-10-28 Thread Steven D'Aprano
Luke Paireepinart wrote: On Thu, Oct 28, 2010 at 8:11 PM, Steven D'Aprano wrote: postPos=words[3] This like will fail with NameError, because words is not defined anywhere. This is not the code you are running. We can't tell what is wrong with the code you run when you show us something compl

Re: [Tutor] (no subject)

2010-10-28 Thread Luke Paireepinart
On Thu, Oct 28, 2010 at 8:11 PM, Steven D'Aprano wrote: > >> postPos=words[3] > > This like will fail with NameError, because words is not defined anywhere. > > This is not the code you are running. We can't tell what is wrong with the > code you run when you show us something completely different

Re: [Tutor] (no subject)

2010-10-28 Thread Steven D'Aprano
Terry Green wrote: def main(): pass Useless function, does nothing. Why is it here? if __name__ == '__main__': main() Also does nothing useful. Why is it here? postPos=words[3] This like will fail with NameError, because words is not defined anywhere. This is not the code you

Re: [Tutor] (no subject)

2010-10-28 Thread Luke Paireepinart
This code shouldn't even actually execute, you should get an indexerror exception. Close your IDE and try it again. Should make the issue more clear. - Sent from a mobile device with a bad e-mail client. - On Oct 27, 2010, at 1:04 PM, "Terr

[Tutor] (no subject)

2010-10-28 Thread Terry Green
Need Help!] def main(): pass if __name__ == '__main__': main() postPos=words[3] f = open ("c:/users/terry/downloads/tup1012k/tup1012x.drf","r") lines = f.readlines() for line in lines: words = line.split(",") print (words[3],postPos) close = f When I run the abo

[Tutor] Python: 27 times faster than bash

2010-10-28 Thread Sean Carolan
I rewrote a bash script that gathers data from a bunch of text files. The script uses grep, sed, and awk to parse the data and takes around 5.5 seconds to run. After rewriting the script in python, it now takes a little over 0.2 seconds to run. Thanks to those of you who helped me with some quest

Re: [Tutor] compare two souce files

2010-10-28 Thread Steven D'Aprano
Jojo Mwebaze wrote: Hello Tutor I would like to compare two souce code files but ignoring doc strings, comments and space (and perharps in future statement by statement comparision) e.g class Foo def foo(): # prints my name return 'my name' class Boo def boo(): print 'my

[Tutor] compare two souce files

2010-10-28 Thread Jojo Mwebaze
Hello Tutor I would like to compare two souce code files but ignoring doc strings, comments and space (and perharps in future statement by statement comparision) e.g class Foo def foo(): # prints my name return 'my name' class Boo def boo(): print 'my name' Want to check i