Re: [Tutor] Parsing os.popen(command) output

2005-09-14 Thread Travis Spencer
On 9/11/05, Bill Burns <[EMAIL PROTECTED]> wrote: > Like I said, it does work but can it be improved upon? The variable names could stand some improvement. p, r, s, tmp, i, etc. aren't very explanatory. If you choose better names, your coworkers, not to mention your future self, will be very tha

Re: [Tutor] (no subject)

2005-09-14 Thread Joseph Quigley
> > >> And also, is Python capable of writing an OS? > > Actually, yes. Google for "Python OS" and look for Unununium (or something like that. I can never remember). It has no kernel and to booting process may not exactly be in Python... but they say it's an OS written in Python and that it bo

[Tutor] Curses and Konsole

2005-09-14 Thread Eric Guirbal
Hello, I have been leaning Python for one week. My first project consist in doing a front end to a MySQL database using the module curses. I have a little display problem in a Konsole terminal. More precisely, when I apply the border method, between each character _ one blank space is inserted.

Re: [Tutor] running scripts with windows

2005-09-14 Thread John Fouhy
On 15/09/05, Ed Hotchkiss <[EMAIL PROTECTED]> wrote: > Hi everyone, I'm home for the next few weeks while I'm learning Python, and > I'm not on a *NIX box, I'm using windows. How the hell do I run a Python > script? Sorry if this is a 'dumb question'. Step 1 - install python :-) http://www.python

Re: [Tutor] running scripts with windows

2005-09-14 Thread Jacob S.
Well, if your python installation went correctly, all you should have to do is save the script with a .py extension and then double click on it.   Jacob   - Original Message - From: Ed Hotchkiss To: tutor@python.org Sent: Wednesday, September 14, 2005 4

[Tutor] running scripts with windows

2005-09-14 Thread Ed Hotchkiss
Hi everyone, I'm home for the next few weeks while I'm learning Python, and I'm not on a *NIX box, I'm using windows. How the hell do I run a Python script? Sorry if this is a 'dumb question'. -- edward hotchkiss ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] IDEs

2005-09-14 Thread Alan G
>> with the open source NetBeans IDE. It would be nice if someone >> modified it to work with Python! :-) > > How about Jython? See https://coyote.dev.java.net/ My work is done for me! I was seriously looking at wring a plug in to support Jython because I couldn't see one listed on the official p

Re: [Tutor] Focus in tkinter

2005-09-14 Thread Michael Lange
On Wed, 14 Sep 2005 19:58:07 +0100 (BST) David Holland <[EMAIL PROTECTED]> wrote: > I want to make the mouse focus in a GUI move to the > correct button/text entry widget. Does anyone know > how to do this ? > Hi David, to set the focus to a particular widget you need the focus_Set() method:

Re: [Tutor] IDEs

2005-09-14 Thread Jorge Godoy
Tim Johnson <[EMAIL PROTECTED]> writes: > And with Xemacs you can even have bitmaps for your backgroud, but > of course that can be distracting, if you are (for instance) coding > over the top of Mariah Carey. On the other hand, it will be easy (?) to find bugs on her nipples... ;-) --

Re: [Tutor] IDEs

2005-09-14 Thread Tim Johnson
* Alan G <[EMAIL PROTECTED]> [050914 09:21]: > > For Windows, the finest Shareware edit IMHO is Boxer. > > Editor religious wars are nearly as bad as programming > language wars but I can't resist. ERWs are a misdirection of energy IMHO. Talking about editors and languages *is* a g

[Tutor] Focus in tkinter

2005-09-14 Thread David Holland
I want to make the mouse focus in a GUI move to the correct button/text entry widget. Does anyone know how to do this ? Thanks in advance David ___ Yahoo! Messenger - NEW crystal clear PC to PC calling

Re: [Tutor] Retrieving the text of a XML tag with ElementTree

2005-09-14 Thread Kent Johnson
Bernard Lebel wrote: > Hello, > > Let say I have this XML chunk: > > > > > > > >type="visibility"> > >fullname="Camera_Root.visibility.viewvis" type="Parameter" > sourceclassname="nosource">False > > > I wish to retrieve the "False" between the opening

Re: [Tutor] Retrieving the text of a XML tag with ElementTree

2005-09-14 Thread Bernard Lebel
Oops, false alarm. I was reading the wrong tag (the tag instead of a one). Sorry! Bernard On 9/14/05, Bernard Lebel <[EMAIL PROTECTED]> wrote: > Hello, > > Let say I have this XML chunk: > > > > > > > >type="visibility"> > >fullname="Camera_Roo

[Tutor] Retrieving the text of a XML tag with ElementTree

2005-09-14 Thread Bernard Lebel
Hello, Let say I have this XML chunk: False I wish to retrieve the "False" between the opening/closing tags. I thought I could use something like: from elementtree.ElementTree import parse oTree = parse( r'C:\temp\Camera_Root.xml' ) for oXMLObject in oT

Re: [Tutor] More IDE's (was: Boa-Constructor)

2005-09-14 Thread Terry Kemmerer
Thanks. This was going to be another question of mine, as to what was wrong with going the Emacs and Vim directions. Terry On Wed, 2005-09-14 at 09:40 -0400, George Flaherty wrote: Yeah, I have been using PyDev with Eclipse. It is pretty good, since with the latest version the debugger is

Re: [Tutor] IDEs

2005-09-14 Thread Kent Johnson
Alan G wrote: > PS I'm playing with JSP at the moment and am very impressed > with the open source NetBeans IDE. It would be nice if someone > modified it to work with Python! :-) How about Jython? See https://coyote.dev.java.net/ Kent ___ Tutor mail

Re: [Tutor] IDEs

2005-09-14 Thread Alan G
> For Windows, the finest Shareware edit IMHO is Boxer. Editor religious wars are nearly as bad as programming language wars but I can't resist. My favourite windows editor these days is gvim. I've never got round to adding the python scripting feature, mainly because I try not to customize i

Re: [Tutor] IDEs

2005-09-14 Thread nephish
Matt Williams wrote: >I've used both PyDev and Wing IDE. > >PyDev seems good, and is getting better. >Wing is pay-for (although only $40 or so), but can be trialled. I thought >it was good, but had a huge problem trying to get it to play with a C library >I was using... > >I've never managed to g

Re: [Tutor] Another regular expression question

2005-09-14 Thread Alan G
> However is it normal that to parse a 2618 lines xml file > it takes 20-30 seconds or so? Only if you are running it on an original Palm Pilot! Seriously, I'd expect it to be more like 2-3 seconds. Something fishy there. Alan G. ___ Tutor maillist -

Re: [Tutor] IDEs

2005-09-14 Thread Tim Johnson
* Matt Williams <[EMAIL PROTECTED]> [050914 07:27]: > I've used both PyDev and Wing IDE. > > PyDev seems good, and is getting better. > Wing is pay-for (although only $40 or so), but can be trialled. I thought > it was good, but had a huge problem trying to get it to play with a C library > I was

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
Hi Kent, Well even before reading your last email I gave it a go, just parsing the xml file and trying out some basic functions. It ran in less than two seconds. I don't know why BeautifulSoup is taking so long... Thanks for the "to get you started"! Bernard On 9/14/05, Kent Johnson <[EMAIL

Re: [Tutor] IDEs

2005-09-14 Thread Matt Williams
I've used both PyDev and Wing IDE. PyDev seems good, and is getting better. Wing is pay-for (although only $40 or so), but can be trialled. I thought it was good, but had a huge problem trying to get it to play with a C library I was using... I've never managed to get Boa-Constructor to run...

Re: [Tutor] Another regular expression question

2005-09-14 Thread Kent Johnson
Bernard Lebel wrote: > The file size is 112 Kb. Most lines look this way: > > > > > I'll give a try to ElementTree. To get you started: from elementtree import ElementTree doc = ElementTree.parse('myfile.xml') for sceneobject in doc.findall('//sceneobject'): if sceneobject.get('type') == 'C

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
The file size is 112 Kb. Most lines look this way: I'll give a try to ElementTree. Bernard On 9/14/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote: > > Thanks for that pointer Kent, I'll check it out. Also thanks for > > letting me know I'm not nuts! :-) > > > > Alan's su

Re: [Tutor] Another regular expression question

2005-09-14 Thread Kent Johnson
Bernard Lebel wrote: > Thanks for that pointer Kent, I'll check it out. Also thanks for > letting me know I'm not nuts! :-) > > Alan's suggestion about BeautifulSoup is actually excellent. The > documentation is nice and the tool is very easy to use. > > However is it normal that to parse a 2618

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
Thanks for that pointer Kent, I'll check it out. Also thanks for letting me know I'm not nuts! :-) Alan's suggestion about BeautifulSoup is actually excellent. The documentation is nice and the tool is very easy to use. However is it normal that to parse a 2618 lines xml file it takes 20-30 secon

Re: [Tutor] More IDE's (was: Boa-Constructor)

2005-09-14 Thread George Flaherty
Yeah, I have been using PyDev with Eclipse. It is pretty good, since with the latest version the debugger is working and they have include the ability to add additional paths in the PYTHONPATH variable. I honestly would prefer to use Emacs, but I have not found any tool that provides code-compl

Re: [Tutor] Another regular expression question

2005-09-14 Thread Kent Johnson
Bernard Lebel wrote: > Thanks Alan, > > I'll check BeautifulSoup asap. > > I'm using regex simply because I have no clue where to start to parse > XML. I have read the various xml tools available in the Python > library, however I'm a complete loss at what to make out of them. Many > of them seem

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
Thanks Alan, I'll check BeautifulSoup asap. I'm using regex simply because I have no clue where to start to parse XML. I have read the various xml tools available in the Python library, however I'm a complete loss at what to make out of them. Many of them seem to use some programming standards, w

Re: [Tutor] (no subject)

2005-09-14 Thread Carlos Eduardo Sotelo Pinto
Hi List. All of you are right. It is similar to java, vb, but how it work? Well, python script generates a compiled bytecode the first time that yuou run the main script in a machinne, and the interpreter execute this byte code. It could be slower than a compiled language, because use an interp

Re: [Tutor] Another regular expression question

2005-09-14 Thread Alan G
Hi Bernard, > Hello, yet another regular expression question :-) > > So I have this xml file that I'm trying to find a > specific tag in. I'm always suspicious when I see regular expression and xml/html in the same context. regex are not good for parsing xml/html files and it's usually much e

Re: [Tutor] Python as operating system?

2005-09-14 Thread Alan G
> MrEd/DrScheme is another compelling example of a system that could > be > considered a high-level operating system, given the environment that > they > expose. The paper: > http://www.ccs.neu.edu/scheme/pubs/icfp99-ffkf.pdf > talks about this in more detail.] I have a friend who teaches Comm

Re: [Tutor] (no subject)

2005-09-14 Thread Alan G
>I am new to Python, about 1 day. And I downloaded from > python.org Pythong2.4, it has the command line and > junk. But what actuall program compiles the source of > python into a program? When you run a python script python compiles the source internally before executing it. If your program im

Re: [Tutor] mamelauncher (fwd)

2005-09-14 Thread Alan G
> There actually seems to be a bit of a problem in the > interaction with the system when it launches mame. > > If I run this: > > import os > > def run_mame_selection(selection): >os.system("C:\\mame096b\\mame.exe"+ selection) > > #main > selection = " tnzs" > run_mame_select