Re: [Tutor] XML: Expletive Deleted

2006-06-09 Thread lawrence wang
> >> for item in itemIDs: > >> print item > > yeilds > > > > > > > > Okay, no problem. Now all I have to do is figure out which > particlular.string.of.words.interconnected.by.periods to > pass to extract the values. > > >> for item in itemIDs: > >> print item.nodeValue > > Se

[Tutor] Function list that might have a tuple that might have one of its indexs set to 's'

2006-06-09 Thread Paul D. Kraus
I am writing my first python program(at least in a really long time). Its purpose is to take csv or pipe delimited files and convert them to html pages. Was going to be excel but its just not worth the headache. Everyone viewing the reports is doing just that viewing simple tables. I need to scan t

Re: [Tutor] XML: Expletive Deleted

2006-06-09 Thread Danny Yoo
>>> from xml.dom.minidom import parse, parseString > >>> data = response.read() >>> connection.close() >>> response = parseString(data) >>> itemIDs = response.getElementsByTagName("ItemID") >>> response.unlink() ^ Hi Doug, What's going on here? Why unlink()? > Okay, no p

Re: [Tutor] Expletive Deleted

2006-06-09 Thread Alan Gauld
"doug shawhan" <[EMAIL PROTECTED]> wrote in message >I realize XML is going to save us all from something or other, but I >just > can't get my head around it. Nope its only going to save Sun and IBM and Cisco etc by forcing us all to buy really powerful computers and really big networks! Alan (w

Re: [Tutor] Difference between popens

2006-06-09 Thread Alan Gauld
> I'd like to know what are the differences at the various os.popenX > flavors. I read the documentation and I can see they return file > objects. so what can you do with these file objects? I mean, why > would you need a set of file objects rather than another? My OS topic covers some of the

[Tutor] Is there a better way to write this function?

2006-06-09 Thread Paul D. Kraus
This is a second... the first one never hit the list. *shrug* should i be using a different interface to post? is this a gateway to newsgroup?I am writing my first python program(at least in a really long time). Its purpose is to take csv or pipe delimintaed files and convert them to html pages. Wa

[Tutor] XML: Expletive Deleted

2006-06-09 Thread doug shawhan
I realize XML is going to save us all from something or other, but I just can't get my head around it. I have been trying to do what should be a very simple action: Extract values from element tags. I first grab my data from a website with httplib: >> connection = httplib.HTTPSConnection(serve

Re: [Tutor] An Introduction and a question (continuing)

2006-06-09 Thread Bob Gailer
Michael Sullivan wrote: OK. I've got it working this far. Now I want the script to generate eight pieces, each with a random colour. Here's my current code: #!/usr/bin/env python import random import time import math class LinePuzzlePiece: """This class defines a single playing piec

Re: [Tutor] An Introduction and a question (continuing)

2006-06-09 Thread Python
On Fri, 2006-06-09 at 16:28 -0500, Michael Sullivan wrote: > OK. I've got it working this far. Now I want the script to generate > eight pieces, each with a random colour. Here's my current code: > > #!/usr/bin/env python > > import random > import time > import math > > class LinePuzzlePiece

[Tutor] Fwd: Difference between popens

2006-06-09 Thread Ivan Furone
2006/6/9, Bernard Lebel <[EMAIL PROTECTED]>: Hi,I'd like to know what are the differences at the various os.popenXflavors. I read the documentation and I can see they return fileobjects. so what can you do with these file objects? I mean, why would you need a set of file objects rather than ano

Re: [Tutor] numpy speed problems

2006-06-09 Thread Dave Kuhlman
On Fri, Jun 09, 2006 at 11:57:32AM -0700, Bob Gailer wrote: > Jeff Peery wrote: > > hello, I am having some trouble with the speed of numpy. I'm crunching > > some numbers (see the attached script) and in total I have 1,000,000 > > grid points over which I am integrating. I'm doing a bunch of add

Re: [Tutor] Difference between popens

2006-06-09 Thread Bernard Lebel
Hey, thanks for the nice explanation Michael! Bernard On 6/9/06, Michael P. Reilly <[EMAIL PROTECTED]> wrote: > Excuse the slightly pedantic discussion before I get to a real-world > example, but the differences get into something a bit deeper than Python and > into what is called "interproces

Re: [Tutor] An Introduction and a question (continuing)

2006-06-09 Thread Michael Sullivan
OK. I've got it working this far. Now I want the script to generate eight pieces, each with a random colour. Here's my current code: #!/usr/bin/env python import random import time import math class LinePuzzlePiece: """This class defines a single playing piece for LinePuzzle""" def __in

Re: [Tutor] Difference between popens

2006-06-09 Thread Dave Kuhlman
On Fri, Jun 09, 2006 at 03:38:58PM -0400, Bernard Lebel wrote: > Hi, > > I'd like to know what are the differences at the various os.popenX > flavors. I read the documentation and I can see they return file > objects. so what can you do with these file objects? I mean, why > would you need a s

[Tutor] Function list that might have a tuple that might have one of its indexs set to 's'

2006-06-09 Thread Paul D. Kraus
I am writing my first python program(at least in a really long time). Its purpose is to take csv or pipe delimintaed files and convert them to html pages. Was going to be excel but its just not worth the headache. Everyone viewing the reports is doing just that viewing simple tables. I need to scan

Re: [Tutor] An Introduction and a question

2006-06-09 Thread Kent Johnson
Michael Sullivan wrote: > Here is my code: > > #!/usr/bin/env python > > import random > import time > import math > > class LinePuzzlePiece: >"""This class defines a single playing piece for LinePuzzle""" >def __init__(self): > seed(time) > index = int(math.floor(uniform(1

Re: [Tutor] An Introduction and a question

2006-06-09 Thread Andre Roberge
On 6/9/06, Michael Sullivan <[EMAIL PROTECTED]> wrote: > My name is Michael Sullivan. I am a 26 year-old college student in > Oklahoma. My wife and I have a small (three PCs) computer network that > we operate out of our home. We have our own domain (as one could tell > by examining my email addr

[Tutor] An Introduction and a question

2006-06-09 Thread Michael Sullivan
My name is Michael Sullivan. I am a 26 year-old college student in Oklahoma. My wife and I have a small (three PCs) computer network that we operate out of our home. We have our own domain (as one could tell by examining my email address) I have novice-level experience with VB, C/C++, Java, and

[Tutor] Difference between popens

2006-06-09 Thread Bernard Lebel
Hi, I'd like to know what are the differences at the various os.popenX flavors. I read the documentation and I can see they return file objects. so what can you do with these file objects? I mean, why would you need a set of file objects rather than another? Sorry the difference is very not c

Re: [Tutor] numpy speed problems

2006-06-09 Thread Bob Gailer
Jeff Peery wrote: > hello, I am having some trouble with the speed of numpy. I'm crunching > some numbers (see the attached script) and in total I have 1,000,000 > grid points over which I am integrating. I'm doing a bunch of adding, > mulitply, divide, powers, etc, but in total there are 1,000,

Re: [Tutor] pyexcelerator

2006-06-09 Thread Paul D. Kraus
I just looked at my copy of PyExcelerator. It seems to be in poor shape.I tried running some of the modules that have if __name__ == '__main__': (i.e. self-testing) and they failed with errors! And I find no visibledocumentation or working examples. Sigh.You might want to check out the recent sourc

Re: [Tutor] pyexcelerator CORRECTION

2006-06-09 Thread Bob Gailer
Bob Gailer wrote: Paul D. Kraus wrote: Are their docs anywhere for pyexcelerator? the built in docs are a bit lacking. For instance I can't figure out how to set a column width. I am just reading the examples and they kind of help but I don't follow this ... ws.col(i).width = 0

[Tutor] problems using PyGTK on cygwin

2006-06-09 Thread Christopher Spears
I have been trying to work throught the PyGTK tutorial using cygwin, but I have been having problems. For example when I try to launch the helloworld.py program (http://www.pygtk.org/pygtk2tutorial/ch-GettingStarted.html#sec-HelloWorld), I get this: $ python helloworld.py No fonts found; this pr

Re: [Tutor] pyexcelerator

2006-06-09 Thread Bob Gailer
Paul D. Kraus wrote: > Are their docs anywhere for pyexcelerator? the built in docs are a bit > lacking. > > For instance I can't figure out how to set a column width. > I am just reading the examples and they kind of help but I don't > follow this ... > > ws.col(i).width = 0x0d00 + i > > where i

[Tutor] numpy speed problems

2006-06-09 Thread Jeff Peery
hello, I am having some trouble with the speed of numpy. I'm crunching some numbers (see the attached script) and in total I have 1,000,000 grid points over which I am integrating. I'm doing a bunch of adding, mulitply, divide, powers, etc, but in total there are 1,000,000 points to do these operat

Re: [Tutor] pyexcelerator

2006-06-09 Thread Kent Johnson
Paul D. Kraus wrote: > > Maybe just try without the 0x0d00 and see what happens? or try the > pyExcelerator mailing list on SourceForge... > > > Mailing list looks dead only 2 messages. > Man this is the exact module i need to finish converting about 20 > scripts from perl and I have n

[Tutor] Files and Modules

2006-06-09 Thread Carroll, Barry
Kermit: > -- > > Message: 7 > Date: Fri, 09 Jun 2006 11:02:44 -0400 > From: Kent Johnson <[EMAIL PROTECTED]> > Subject: Re: [Tutor] file attribute of module > Cc: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=

Re: [Tutor] pyexcelerator

2006-06-09 Thread Paul D. Kraus
Maybe just try without the 0x0d00 and see what happens? or try thepyExcelerator mailing list on SourceForge... Mailing list looks dead only 2 messages.Man this is the exact module i need to finish converting about 20 scripts from perl and I have no idea how to use most of it. This is very frustrati

[Tutor] layout ( i guess)

2006-06-09 Thread Ivan Furone
Desk Jet wrote:> uh ive been wondering if with python you would be able to make layouts?Hello,I premise that i don't get the exact meaning you are using for 'layouts',GUI-enabled applications ( i.e. those with windows,buttons,progress bars,notebooks..) could it be?Well,sure Python can :) In the maj

Re: [Tutor] making a python program part of xhtml

2006-06-09 Thread Dave Kuhlman
On Fri, Jun 09, 2006 at 07:17:02AM -0400, Ron Phillips wrote: > >>> Emily Fortuna < [EMAIL PROTECTED] > 6/8/2006 9:19 AM >>> [snip] > ... I _think_ I want to somehow > embed the python into the page, but I'm really not sure how to do it. > After googling I found some programs that generate xhtml

[Tutor] errno vs. sys.exc_info

2006-06-09 Thread doug shawhan
I am in need of a clear way to return exceptions within a try loop. I have been looking at both errno and sys.exc_info. I know that using errno is not encouraged in threaded programs, but this is no big deal for my purposes. I found a good, clear example for translating the rather cryptic output

Re: [Tutor] pyexcelerator

2006-06-09 Thread Kent Johnson
Paul D. Kraus wrote: > Are their docs anywhere for pyexcelerator? the built in docs are a bit > lacking. > > For instance I can't figure out how to set a column width. > I am just reading the examples and they kind of help but I don't follow > this ... > > ws.col(i).width = 0x0d00 + i > > wher

[Tutor] pyexcelerator

2006-06-09 Thread Paul D. Kraus
Are their docs anywhere for pyexcelerator? the built in docs are a bit lacking.For instance I can't figure out how to set a column width.I am just reading the examples and they kind of help but I don't follow this ... ws.col(i).width = 0x0d00 + iwhere i is an incrementing integer.so to me it reads

Re: [Tutor] file attribute of module

2006-06-09 Thread Kent Johnson
Kermit Rose wrote: factor30.__file__ > 'c:\\math\\factoring\\factor30.py' > > Ok. Now I understand it. > > The module is named factor30. > > The file is named factor30.py > > I presume that if I created another library in the same directory > in a file named factor31.py > that it wou

[Tutor] file attribute of module

2006-06-09 Thread Kermit Rose
Message: 2 Date: Thu, 08 Jun 2006 09:28:27 -0400 From: Kent Johnson <[EMAIL PROTECTED]> Subject: Re: [Tutor] module versus file Most modules do have corresponding files. The exceptions are the ones built-in to Python. In fact modules have a __file__ attribute that tells you where it came from;

Re: [Tutor] Confused about globals

2006-06-09 Thread Kent Johnson
Etrade Griffiths wrote: > Hi > > I have a series of python programs that plot stuff using PYX. Common to > these is the need to read in a list of (well) locations in (X,Y) coords so > I put that code in a separate module called shared_funcs.py. The coords > are stored in dictionaries which I

Re: [Tutor] Confused about globals

2006-06-09 Thread Dustin Mitchell
As a note, the "import" should be import shared_funcs In Python, most globals aren't really global -- they're local to the module. If you split your modules by functionality, then variables should naturally relate to a specific module, and be located there. So, for example, you could move

[Tutor] Maintain SessionID with AMARA

2006-06-09 Thread kieran flanagan
Hi I want to have a script that can browse through a website and retrieve information upon request. If I use AMARA for this, in the form i.e.     for subtree in binderytools.pushbind('panel', source='file1.xml'):     print subtree.name And then once on this page 'file1.xml', need to

Re: [Tutor] making a python program part of xhtml

2006-06-09 Thread Ron Phillips
>>> Emily Fortuna < [EMAIL PROTECTED] > 6/8/2006 9:19 AM >>> Hola everyone, I'm working on creating a webpage in which a user can submit data into fields to be held in a database (there are other details, but this is the gist of the idea), and I need to use python. I am unfamiliar with manipulat

Re: [Tutor] layout ( i guess)

2006-06-09 Thread Kent Johnson
Desk Jet wrote: > uh ive been wondering if with python you would be able to make layouts? What's a layout? For a web site, magazine page, printed circuit board... Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tut

[Tutor] Confused about globals

2006-06-09 Thread Etrade Griffiths
Hi I have a series of python programs that plot stuff using PYX. Common to these is the need to read in a list of (well) locations in (X,Y) coords so I put that code in a separate module called shared_funcs.py. The coords are stored in dictionaries which I want to use later in the "main" prog

[Tutor] layout ( i guess)

2006-06-09 Thread Desk Jet
uh ive been wondering if with python you would be able to make layouts? _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ___