Re: [Tutor] What lib should I use?

2008-05-25 Thread W W
However, something to note is that Google prohibits web scraping, at least via urllib. If you try to GET or POST (I can't remember off the top of my head), Google will not return the actual search. HTH, Wayne On Sun, May 25, 2008 at 8:06 PM, bob gailer <[EMAIL PROTECTED]> wrote: > Julia wrote: >

Re: [Tutor] What lib should I use?

2008-05-25 Thread bob gailer
Julia wrote: I need to write a program what can do two things: 1) get data from the website 2) send information from a textfield (e.g. like a google search) I presume you want to automatically submit a form? For both see http://docs.python.org/lib/node577.html Forms are submitted by eithe

Re: [Tutor] What lib should I use?

2008-05-25 Thread python nutter
On Mon, 26 May 2008 01:51:45 +0200, "Julia" <[EMAIL PROTECTED]> said: > Hi! > > I need to write a program what can do two things: > > 1) get data from the website > 2) send information from a textfield (e.g. like a google search) Sounds like you are web scraping or wanting to make a web spider. C

Re: [Tutor] What lib should I use?

2008-05-25 Thread Alan Gauld
"Julia" <[EMAIL PROTECTED]> wrote I need to write a program what can do two things: 1) get data from the website 2) send information from a textfield (e.g. like a google search) There are lots of web frameworks for Python that you could use. The most basic is the standard cgi module in the

Re: [Tutor] How to get a string from a DOM Text node ?

2008-05-25 Thread Martin Walsh
Zameer Manji wrote: > I'm trying to extract some information from the following xml file: > http://pastebin.ca/1029125 > > file = "Music.xml" > dict = plist.childNodes[1] #dict contains App version and stuff, as well You really should try to avoid rebinding built-in names, like dict and file, t

[Tutor] What lib should I use?

2008-05-25 Thread Julia
Hi! I need to write a program what can do two things: 1) get data from the website 2) send information from a textfield (e.g. like a google search) Any tips on what lib I should use and any good tutorial covering it? Thanks! /MJ ___ Tutor maillist -

Re: [Tutor] How to get a string from a DOM Text node ?

2008-05-25 Thread Alan Gauld
"Zameer Manji" <[EMAIL PROTECTED]> wrote in I'm trying to extract some information from the following xml file: http://pastebin.ca/1029125 This is the code that I have so far: import xml.dom.minidom This code prints out the following: 42 The problem is that the Text node that is printe

Re: [Tutor] get/set attributes

2008-05-25 Thread Alan Gauld
"Eric Abrahamsen" <[EMAIL PROTECTED]> wrote >> CMS with Cherrypy/Sqlalchemy/Cheetah, > > Those are the components of TurboGears. I am doing this as a learning exercise, though I hadn't realized those are precisely TG's components. TG tries to use a set of "best practice" components and glue

[Tutor] Fwd: How to get a string from a DOM Text node ?

2008-05-25 Thread Moishy Gluck
-- Forwarded message -- From: Moishy Gluck <[EMAIL PROTECTED]> Date: Sun, May 25, 2008 at 5:54 PM Subject: Re: [Tutor] How to get a string from a DOM Text node ? To: Zameer Manji <[EMAIL PROTECTED]> xml does not allow text in a node. So you kneed to place a node inside the node

[Tutor] How to get a string from a DOM Text node ?

2008-05-25 Thread Zameer Manji
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 I'm trying to extract some information from the following xml file: http://pastebin.ca/1029125 This is the code that I have so far: import xml.dom.minidom file = "Music.xml" doc = xml.dom.minidom.parse(file) plist = doc.childNodes[1]

Re: [Tutor] Reading only a few specific lines of a file

2008-05-25 Thread Chester
I don't know then. Just hack your way through and tell us how did you manage to do it. ;) On Sun, May 25, 2008 at 9:32 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Forwarding to the list with my reply... > > On Sun, May 25, 2008 at 2:20 PM, Chester <[EMAIL PROTECTED]> wrote: > > Python uses \n

Re: [Tutor] Reading only a few specific lines of a file

2008-05-25 Thread Kent Johnson
Forwarding to the list with my reply... On Sun, May 25, 2008 at 2:20 PM, Chester <[EMAIL PROTECTED]> wrote: > Python uses \n as the newline character (which is a UNIX/Linux newline > character). I see you have Python for Windows installed and running it on > the Windows OS. The file objectconfig

Re: [Tutor] get/set attributes

2008-05-25 Thread Eric Abrahamsen
This creates an attribute named k; it does not create an attribute whose name is the *value* of k. For that you need setattr: setattr(self, k, v) There is a shortcut that replaces the entire loop: self.__dict__.update(atts) Thanks Kent, that explains a lot about how things work. return an e

Re: [Tutor] get/set attributes

2008-05-25 Thread Alan Gauld
"Eric Abrahamsen" <[EMAIL PROTECTED]> wrote return an empty string for any attribute. I'm making a very simple CMS with Cherrypy/Sqlalchemy/Cheetah, Those are the components of TurboGears. You might save a lot of bother by using TG instead of trying to write all the glue code yourself. Form

Re: [Tutor] get/set attributes

2008-05-25 Thread Kent Johnson
On Sun, May 25, 2008 at 6:30 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > What I've got so far handles non-existent attributes fine, but using > keywords to create attributes isn't working (attributes thus set still > output an empty string), and I'm not sure why. Here's the class: > > class D

Re: [Tutor] Reading only a few specific lines of a file

2008-05-25 Thread Kent Johnson
On Sat, May 24, 2008 at 7:09 PM, Jason Conner <[EMAIL PROTECTED]> wrote: > def loadItem(self, objectToLoad): > wordList = [] > fobj = open('/home/jason.conner/Documents/Python/objectconfig.txt', 'r') > > for line in fobj: > if line == objectToLoad: > wordList.append

[Tutor] get/set attributes

2008-05-25 Thread Eric Abrahamsen
Hello, I'm trying to create a Dummy class of objects, something that will return an empty string for any attribute. I'm making a very simple CMS with Cherrypy/Sqlalchemy/Cheetah, and I have an HTML form template that I use for editing/creating objects to save to the database. I'm using ju