Re: need help with python syntax

2005-12-24 Thread Mike Meyer
[EMAIL PROTECTED] writes: > if i have a piece of html that looks like this > > cnn.com > and i want to scrape out cnn.com , what syntax would i use? i have > tried this and it doesn't work > for incident in bs('td', {'class' : 'rulesbody'}, {'class' : > 'rulesbody'} ): If you're using BeautifulS

Re: need help with python syntax

2005-12-24 Thread gene tani
gene tani wrote: > [EMAIL PROTECTED] wrote: > > if i have a piece of html that looks like this > > > > > > cnn.com > > > > and i want to scrape out cnn.com , what syntax would i use? i have > > tried this and it doesn't work > > > > for incident in bs('td', {'class' : 'rulesbody'}, {'class' : >

Re: What is unique about Python?

2005-12-24 Thread Szabolcs Nagy
>> identation > >Feh. A red herring. At best, syntactic sugar. At worst, something for >potential adopters to get hung up about. i always ident my code, but in python i don't need to bother with the {} and the ; (which is redundant if i ident anyway) so i like it because i need to type less, an

Re: Python IDE's

2005-12-24 Thread Szabolcs Nagy
it's a very common question here. try to search for an answer http://groups.google.com/group/comp.lang.python/search?q=python+ide&start=0&scoring=d&; also see http://wiki.python.org/moin/PythonEditors and http://wiki.python.org/moin/IntegratedDevelopmentEnvironments -- http://mail.python.org/mai

Re: need help with python syntax

2005-12-24 Thread gene tani
[EMAIL PROTECTED] wrote: > if i have a piece of html that looks like this > > > cnn.com > > and i want to scrape out cnn.com , what syntax would i use? i have > tried this and it doesn't work > > for incident in bs('td', {'class' : 'rulesbody'}, {'class' : > 'rulesbody'} ): Did you try Beautifu

Python IDE's

2005-12-24 Thread J. D. Leach
Quick question as I am rather new to Python. What is the preferred tool amongst you gurus to use in coding Python? I have ran across Eric3 and found it to be pretty well full-featured. Any comments or suggestions for better tools/IDE's? J.D. Leach -- http://mail.python.org/mailman/listinfo/python

need help with python syntax

2005-12-24 Thread homepricemaps
if i have a piece of html that looks like this cnn.com and i want to scrape out cnn.com , what syntax would i use? i have tried this and it doesn't work for incident in bs('td', {'class' : 'rulesbody'}, {'class' : 'rulesbody'} ): -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2005-12-24 Thread James Tanis
On 24 Dec 2005 18:36:32 -0800, Joe <[EMAIL PROTECTED]> wrote: > My original post was based on reading on Pythons developer list that it > was seriously considering some alternate grouping scheme, just because > "so many people keep asking". But, it seems that never happened. > > As for me, I'm not

Re: scrape url out of brackets?

2005-12-24 Thread Ravi Teja
Regular Expressions are the most common way. http://docs.python.org/lib/module-re.html HTML parser is another http://docs.python.org/lib/module-htmllib.html -- http://mail.python.org/mailman/listinfo/python-list

Re: pyQt for windows

2005-12-24 Thread relativity
"relativity" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Bill" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> relativity wrote: >>> I have downloaded and installed pyQt 3.14 educational but when I run any >>> of >>> the examples I get an error saying qt-mte

Re: Indentation/whitespace

2005-12-24 Thread Joe
My original post was based on reading on Pythons developer list that it was seriously considering some alternate grouping scheme, just because "so many people keep asking". But, it seems that never happened. As for me, I'm not suggesting that braces are better than indentation. In fact, requiring

Re: What is unique about Python?

2005-12-24 Thread Roy Smith
"Szabolcs Nagy" <[EMAIL PROTECTED]> wrote: > iterpreter (very useful for learning) In my mind, this is the coolest feature of all. Most of the time, I don't even bother looking stuff up in the docs; it's faster to just fire up an interpreter and try something. Functions like: > dir(obj) / va

Re: scrape url out of brackets?

2005-12-24 Thread Mike Meyer
[EMAIL PROTECTED] writes: > any idea how to scrape a url out of a file? for instance if i want to > scrape out the href at the end which is "www.cnn.com" is there a way to > do it? > href="www.cnn.com"> BeautifulSoup. http://www.mired.org/home/mwm/ Independent WWW/Per

Re: What is unique about Python?

2005-12-24 Thread Szabolcs Nagy
i don't know if they are unique, but my favourite features are: readable and short code (consistent syntax, few keywords) iterpreter (very useful for learning) dir(obj) / vars(obj) (very useful for learning) identation dynamic typing lightweight oo (no public/protected/private) built-in types (lis

scrape url out of brackets?

2005-12-24 Thread homepricemaps
any idea how to scrape a url out of a file? for instance if i want to scrape out the href at the end which is "www.cnn.com" is there a way to do it? -- http://mail.python.org/mailman/listinfo/python-list

I am seeing your project "HTMLTemplate"

2005-12-24 Thread LocaWapp
Hi Hamish Sanderson. I am seeing your project "HTMLTemplate". I like it. You see my project: LocaWapp: localhost web applications V.0.0.2 (2005 Dec 20) http://LocaWapp.blogspot.com - Run with: python run.py - and browse with: http://localhost:8080/locawapp/main.p

Re: program with raw_input prompt behaves differently after compile

2005-12-24 Thread Hans Nowak
tim wrote: > I want to write a program that looks into a given folder, groups files > that have a certain part of the filename in common and then copy those > groups one at a time to another place, using the raw_input prompt to > continue or break. > > [...] > > It works fine when I run this

Re: Timing out arbitrary functions

2005-12-24 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Is something stopping you from using sigalarm? > > Pure ignorance of its existence. > Thanks, I'll check it out. Two things to keep in mind: - You can have only ONE alarm pending for the whole process. If different things in the program need tim

any Adobe Reader like apps written in python, for examination?

2005-12-24 Thread Alex Gittens
Is anyone aware of any applications that handle font and graphics display--- something like Adobe Reader--- that are written in Python, and the code is available for examination? It doesn't matter what GUI toolkit is used. Thanks, Alex -- ChapterZero: http://tangentspace.net/cz/ -- http://mail.py

Re: Timing out arbitrary functions

2005-12-24 Thread Steven D'Aprano
On Sat, 24 Dec 2005 04:47:34 -0800, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> How do others handle something like this? What should I be looking for? >> I'm after a lightweight solution, if any such thing exists. > > Is something stopping you from using sigalarm? Pure ig

Re: What is unique about Python?

2005-12-24 Thread Mike Meyer
"KraftDiner" <[EMAIL PROTECTED]> writes: > I like python.. Its ok.. One thing that I find a bit dangerous it the > use > of the tab character for indentation.. I've had copy and pasts loose > indentation on me and its theoretically impossible to really figure out > what the indentation should be.

Re: How to calculate the CPU time consumption and memory consuption of any python program in Linux

2005-12-24 Thread Olivier Grisel
gene tani a écrit : > Shahriar Shamil Uulu wrote: >> Thank you, for your directions and advices. >> shahriar ... > > also look: > > http://spyced.blogspot.com/2005/09/how-well-do-you-know-python-part-9.html > > whihc mentions twisted.python.reflect.findInstances(sys.modules, str) > and objgrep,

Re: Trying to find regex for any script in an html source

2005-12-24 Thread Mike Meyer
"28tommy" <[EMAIL PROTECTED]> writes: > Hi, > I'm trying to find scripts in html source of a page retrieved from the > web. > I'm trying to use the following rule: > > match = re.compile('') > > I'm testing it on a page that includes the following source: > >