Re: [Tutor] Optional groups in RE's

2009-04-11 Thread Kent Johnson
On Sat, Apr 11, 2009 at 10:06 PM, Moos Heintzen wrote: > Mark Tolonen wrote: >> Your data looks like XML.  If it is actually well-formed XML, have you tried >> ElementTree? > > It is XML. I used minidom from xml.dom, and it worked fine, except it > was ~16 times slower. I'm parsing a ~70mb file,

Re: [Tutor] Optional groups in RE's

2009-04-11 Thread Moos Heintzen
Mark Tolonen wrote: > Your data looks like XML.  If it is actually well-formed XML, have you tried > ElementTree? It is XML. I used minidom from xml.dom, and it worked fine, except it was ~16 times slower. I'm parsing a ~70mb file, and the difference is 3 minutes to 10 seconds with re's. I used

Re: [Tutor] Help

2009-04-11 Thread David
krayzie...@yahoo.com wrote: Sent from my BlackBerry® device from Digicel Don't have a BlackBerry, sorry can not help. -david -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/lis

Re: [Tutor] Problem with converting Python to EXE using py2exe

2009-04-11 Thread Dave Angel
Dave Angel wrote: In C++, you wouldn't want the full path to the source file, but the full path to the .EXE file. That can be gotten in Windows, by using GetModuleHandle(0), and some other function on that handle. Sorry I don't remember the name of the second function, but I haven't done an

[Tutor] Help

2009-04-11 Thread krayzie_jm
__ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Cheers, Vishwajeet http://www.singhvishwajeet.com -- next part -- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/t

Re: [Tutor] Optional groups in RE's

2009-04-11 Thread Kent Johnson
On Sat, Apr 11, 2009 at 6:46 PM, Moos Heintzen wrote: > Hello Tutors! > > I was trying to make some groups optional in a regular expression, but > I couldn't do it. > > For example, I have the string: > data = "42 sdlfks d f60 sdf sdf   Title" > > and the pattern: pattern = "(

Re: [Tutor] Optional groups in RE's

2009-04-11 Thread Mark Tolonen
"Moos Heintzen" wrote in message news:7b13ba330904111546n21d90202i7572a75c55b02...@mail.gmail.com... > Hello Tutors! > > I was trying to make some groups optional in a regular expression, but > I couldn't do it. > > For example, I have the string: > data = "42 sdlfks d f60 sdf sdf Tit

[Tutor] Optional groups in RE's

2009-04-11 Thread Moos Heintzen
Hello Tutors! I was trying to make some groups optional in a regular expression, but I couldn't do it. For example, I have the string: >>> data = "42 sdlfks d f60 sdf sdf >>> Title" and the pattern: >>> pattern = "(.*?).*?(.*?).*?(.*?)" This works when all the groups are present. >>> re.sea

[Tutor] PHP as seen by a Python lover

2009-04-11 Thread OkaMthembo
Hi All, I just tried setting up PHP on my machine,with Apache 2.2-something (Win. XP). I came back running. It's a SCHLEP. I love Python. Happy Easter to you all - and to those that do not celebrate it, have a great weekend! -- Lloyd Dube ___ Tutor

Re: [Tutor] Problem with converting Python to EXE using py2exe

2009-04-11 Thread Dave Angel
Alan Gould wrote: Good idea, I forgot that in Python you can find the full path that way. Too used to working in C/C++ where the file macro only gives the filename... In C++, you wouldn't want the full path to the source file, but the full path to the .EXE file. That can be gotten in Windo

Re: [Tutor] Yet another Python book

2009-04-11 Thread vishwajeet singh
awesome; I really like the Jython part :) Thanks for your efforts. On Sat, Apr 11, 2009 at 9:31 PM, wrote: > Dave, > > Great stuff!!! Thanks for sharing your hard work with the community! > > Malcolm > ___ > Tutor maillist - Tutor@python.org > http:

Re: [Tutor] Yet another Python book

2009-04-11 Thread python
Dave, Great stuff!!! Thanks for sharing your hard work with the community! Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Yet another Python book

2009-04-11 Thread Dotan Cohen
While the content looks to provide a reasonable learning curve, there is no mention of the Python version used. One of the first examples shows the interpreter for Python 2.6. I really think that a book coming out today should cover Python 3.0, and from the look of things that can be done with ver

[Tutor] Fwd: Yet another Python book

2009-04-11 Thread bhaaluu
-- Forwarded message -- From: Tom Green Date: Sat, Apr 11, 2009 at 9:38 AM Subject: Re: [Tutor] Yet another Python book To: bhaaluu Book looks great.  Any help to master Python is appreciated. Great work. Mike. On Sat, Apr 11, 2009 at 9:04 AM, bhaaluu wrote: > > Thanks for m

Re: [Tutor] Yet another Python book

2009-04-11 Thread bhaaluu
Thanks for making this book available, Dave! This stuff looks very useful. On Fri, Apr 10, 2009 at 8:25 PM, Dave Kuhlman wrote: > I've collected my training materials plus a few more advanced > topics and I've also written up a reasonably large set of Python > exercises.  Then, I turned all of t

Re: [Tutor] Python Dice Game

2009-04-11 Thread Alan Gauld
"jake_k2011" wrote get it to work :\ I'm a total noob and just a BEGINNER. I can't seem to get the buttons to work.Basically they are constructed and maybe activated in the main program, andI need to be able to use them in the functions roll() and turn() i believe. CAn anyone help to get

Re: [Tutor] Problem with converting Python to EXE using py2exe

2009-04-11 Thread Alan Gauld
"Dave Angel" wrote To use a relative path base = pic(file=root+"/base.gif") I would get 'root' this way, rather than requiring anything to be set up by the install (registry, environment vars, config): Good idea, I forgot that in Python you can find the full path that way. Too used to w

[Tutor] Python Dice Game

2009-04-11 Thread jake_k2011
http://www.nabble.com/file/p22982720/button.py button.py http://www.nabble.com/file/p22982720/dieview.py dieview.py http://www.nabble.com/file/p22982720/graphics.py graphics.py http://www.nabble.com/file/p22982720/msdie.py msdie.py http://www.nabble.com/file/p22982720/roller.py roller.py Im

Re: [Tutor] Problem with converting Python to EXE using py2exe

2009-04-11 Thread Dave Angel
ALAN GAULD wrote: > That's a great idea Mr. Gauld! > But I have no idea how to do that... > can you maybe write a small example for a newb like me?? pretty please with cheese on top?? > > > base = pic(file="base.gif") > > > > > > Now, I'm just wondering... for the "base.gif" part, would

Re: [Tutor] Problem with converting Python to EXE using py2exe

2009-04-11 Thread ALAN GAULD
> That's a great idea Mr. Gauld! > But I have no idea how to do that... > can you maybe write a small example for a newb like me?? pretty please with > cheese on top?? > > > base = pic(file="base.gif") > > > > > > Now, I'm just wondering... for the "base.gif" part, would it be better > > > to