convert loop to list comprehension

2006-09-08 Thread [EMAIL PROTECTED]
Please help my poor brain :) Every time I try to do a list comprehension I find I just don't comprehend ... Anyway, I have the following bit of code: seq = [2, 3, 1, 9] tmp = [] for a in range(len(seq)): tmp.extend([a]*seq[a]) which correctly returns: [0, 0, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-08 Thread [EMAIL PROTECTED]
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > > > Ben Sizer wrote: > >> I don't think so... it doesn't take much to say that the module > >> implements a subset of SQL but stores ignores data types.

Re: convert loop to list comprehension

2006-09-08 Thread [EMAIL PROTECTED]
Rob Williscroft wrote: > But my forth attemp yeilded (If that's a pun I do appologise) > this: > > >>> [ x for a in range(len(seq)) for x in [a] * seq[a] ] Ahh, that's the magic ... I didn't understand that one could have multiple "statments" in this single line. Now, you can't have python line

Re: convert loop to list comprehension

2006-09-08 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Two possibile solutions: > > seq = [2, 3, 1, 9] > > print sum( ([i]*n for i,n in enumerate(seq)), []) > > print [i for i, x in enumerate(seq) for _ in xrange(x)] > Cool as well. So much to learn :) 1. Using an _ is an interesting way to u

Re: convert loop to list comprehension

2006-09-08 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > print sum( ([i]*n for i,n in enumerate(seq)), []) > > Wow, I had no idea you could do that. After all the discussion about > summing strings, I'm astonished. Me too ... despite what bearophile said, this is faster than the

Re: convert loop to list comprehension

2006-09-08 Thread [EMAIL PROTECTED]
Carl Banks wrote: > [EMAIL PROTECTED] wrote: > > Paul Rubin wrote: > > > [EMAIL PROTECTED] writes: > > > > print sum( ([i]*n for i,n in enumerate(seq)), []) > > > > > > Wow, I had no idea you could do that. After all the discussion about >

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-08 Thread [EMAIL PROTECTED]
George Sakkis wrote: > [EMAIL PROTECTED] wrote: > > > Sure, errors happen with static typing. After all, the values still > > have to match. Dynamic typing allows for more potential errors and, > > thanks to Murpy's Law, I will have a much bigger problem with data >

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-08 Thread [EMAIL PROTECTED]
Dennis Lee Bieber wrote: > On 8 Sep 2006 16:46:03 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > After a sequence of hypothetical results of occult SQL you show > this... > > > >

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-08 Thread [EMAIL PROTECTED]
Paul McNett wrote: > [EMAIL PROTECTED] wrote: > > Do you know what INNER JOIN means? > > > > Do you know how important it is to a relational database? > > > > Can you explain how an INNER JOIN can even work, in theory, > > with dynamic data types? > >

Re: convert loop to list comprehension

2006-09-09 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > FWIW, the original loop looked perfectly fine and readable and I'd > > > suggest going with that over these hacked-up listcomp solutions. Don't > > > use a listcomp j

Re: How to insert an email-link into wxPython's HtmlWindow

2006-09-10 Thread [EMAIL PROTECTED]
Thanks. It works now. --Kneo [EMAIL PROTECTED] wrote: > Hello. I don't know if this topic is appropriate in this group (and my > English is not good). > > My problem is here: > > I created a HtmlWindow in wxPython, then I wrote some code and set it > to the page-text.

Re: Secure Postgres access

2006-09-10 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > Reid Priedhorsky <[EMAIL PROTECTED]> writes: > > B) Work machine. Run by others, many users. I'd like to also run my > > database client (Python) here. > > Well, just how much do you distrust that machine? If you think it's > totally pwn

Re: [Fwd: Problems with PyGridTableBase]

2006-09-10 Thread [EMAIL PROTECTED]
nt_list(csndname): csdInstrumentList(csndname) #needs to have a file variable.. noinlist=0 for number in range(0,noinlist): self.grid1.AppendRows(1) self.grid1.SetCellValue(number,0,instrlist[number]) http://www.dexrow.com Mario Lacunza wrote: > --

Re: Is it just me, or is Sqlite3 goofy?

2006-09-10 Thread [EMAIL PROTECTED]
Dennis Lee Bieber wrote: > Guess I lied... > > On Sat, 09 Sep 2006 05:22:20 GMT, Dennis Lee Bieber > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > Talking to myself again, I see... > > > rs = cr

Re: ANN: Pocoo (bulletin board software) 0.1 beta released

2006-09-10 Thread [EMAIL PROTECTED]
Georg Brandl wrote: > We're pleased to announce that > > Pocoo 0.1 (beta) was released today (Sept. 10, 2006). > > Pocoo is a bulletin board software (aka. message > board) > written in Python, adhering to the WSGI standard. In the long term, it is > meant > to comp

Re: Is it just me, or is Sqlite3 goofy?

2006-09-11 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 9/11/06, Steve Holden <[EMAIL PROTECTED]> wrote: > > > Sure. But if you go back to the start of the thread you'll remember the > > OP was originally complaining that SQLite was being promoted in the > > Python docs as SQL compliant. >

Re: Parsing String, Dictionary Lookups, Writing to Database Table

2006-09-11 Thread [EMAIL PROTECTED]
Rich Shepard wrote: > I need to learn how to process a byte stream from a form reader where each > pair of bytes has meaning according to lookup dictionaries, then use the > values to build an array of rows inserted into a sqlite3 database table. > >Here's the context: The OMR card reader sends

Re: Is it just me, or is Sqlite3 goofy?

2006-09-11 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 11 Sep 2006 18:23:50 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Can you run your car on diesel fuel? > > > > Why not? > > > > Because your car's specification says to use gasoline? > > > > If your c

Re: Is it just me, or is Sqlite3 goofy?

2006-09-11 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: > At Tuesday 5/9/2006 16:23, [EMAIL PROTECTED] wrote: > > >I would be surprised if they had never used ANY database. A little > >thing like dynamic field typing will simply make it impossible to > >migrate your Sqlite data to a *real* database.

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-12 Thread [EMAIL PROTECTED]
Mike Owens wrote: > And if you say SQLite misrepresents itself, > then what do you say about MySQL, which until version 5 didn't have > views or triggers? In fact, it didn't even have subselects until > version 4. For a period of years, SQLite had more mainstream SQL > features than MySQL. Yet you

Clarify Regex in Python.

2006-09-12 Thread [EMAIL PROTECTED]
After may frustrated attempts I came to know that "match" function in python re package actually start the matchs at the begining of the subject, where "search" will find the given pattern any where in the subject. My Problem is, I want to know how can I force match functions to match the pattern

Re: Clarify Regex in Python.

2006-09-12 Thread [EMAIL PROTECTED]
> Erm, is there some specific reason why you can't just use the search > method? Why does it *have* to be match()? > > regards > Steve I know there r many more methods to do the job, I just wonder can we turnoff the default behaviour of match method. Thanks. -- http://mail.python.org/mailman

Re: Clarify Regex in Python.

2006-09-12 Thread [EMAIL PROTECTED]
k, people, thanks for ur replys. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 11 Sep 2006 21:35:28 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Mike Owens wrote: > > > On 11 Sep 2006 18:23:50 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > > wrote: > > > > > > >

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 11 Sep 2006 23:29:28 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > But it was stated in the sqlite docs that ALL SQL databases > > use static types implying that sqlite will be incompatible > > with any "heavy" d

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 12 Sep 2006 09:31:54 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > To use your specious analogy, it represents another way of doing > > > things, which you admit yourself works. That's your justification for > > > c

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > So, knowing that, would you agree that > > > > > > If switching to a larger database such as PostgreSQL or Oracle > > is later necessary, the switch should be relatively easy. > > > > > >

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Because I can extrapolate. I *know* before even trying it that > > if I export all my data from a sqlite db to a csv file and then try > > to import it into Access that there will be problems if the fields > > a

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
A.M. Kuchling wrote: > On 12 Sep 2006 10:24:00 -0700, > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > So, knowing that, would you agree that > > > > > > If switching to a larger database such as PostgreSQL or Oracle > > is later neces

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 12 Sep 2006 10:47:22 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Why? I'm not requesting that dynamic typing be removed from > > sqlite. I'm not even requesting that the slander in the sqlite docs > > be removed. What I&

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Tim Chase wrote: > >> "But honestly, boss, I didn't write this code! It was my > >> evil alter-ego that puts VARCHAR values containing Gilbert & > >> Sullivan lyrics into the Amount_Due CURRENCY fields!" > >> > > Hence the phrase "Going for a song"? > > I am the very model of a modern major datab

how are dictionary literals handled by the interpreter?

2006-09-13 Thread [EMAIL PROTECTED]
I wrote up a quick little set of tests, I was acutally comparing ways of doing "case" behavior just to get some performance information. Now two of my test cases had almost identical results which was not at all what I expected. Ultimately I realized I don't really know how literals are treated w

Re: eval(repr(object)) hardly ever works

2006-09-13 Thread [EMAIL PROTECTED]
Matthew Wilson wrote: > I understand that idea of an object's __repr__ method is to return a > string representation that can then be eval()'d back to life, but it > seems to me that it doesn't always work. Just to reinforce something Skip mentioned: If you're looking for a way to serialize an ob

Re: urllib en https

2006-09-13 Thread [EMAIL PROTECTED]
please provide a sample program, which has the minimal functionality necessary to reproduce this error. I've checked and the syntax hasn't changed. Perhaps it's with the string you are passing as "fullurl". Anyways, I can't really troubleshoot more than that without some code. Cecil Westerhof wrot

Re: how are dictionary literals handled by the interpreter?

2006-09-13 Thread [EMAIL PROTECTED]
Jason wrote: > [EMAIL PROTECTED] wrote: > > I wrote up a quick little set of tests, I was acutally comparing ways > > of doing "case" behavior just to get some performance information. Now > > two of my test cases had almost identical results which was not at all &

Re: how are dictionary literals handled by the interpreter?

2006-09-13 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I wrote up a quick little set of tests, I was acutally comparing ways > of doing "case" behavior just to get some performance information. Now > two of my test cases had almost identical results which was not at all > what I expected. Ultimat

Re: how are dictionary literals handled by the interpreter?

2006-09-13 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > I wrote up a quick little set of tests, I was acutally comparing ways > > of doing "case" behavior just to get some performance information. Now > > two of my test cases had almost identical results which was

Re: how are dictionary literals handled by the interpreter?

2006-09-13 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > I wrote up a quick little set of tests, I was acutally comparing ways > > of doing "case" behavior just to get some performance information. Now > > two of my test cases had almost identical results which was

Statistical distribution of object size

2006-09-13 Thread [EMAIL PROTECTED]
Hi, In a typical heavy-use python application (say running Zope for dukehealth.org) what is the (statistical) distribution of the the size of objects? (i.e. start up server, stop time when it has been under load for a few hours, and put each object into a bucket marked with the number of bytes it

Re: Linear regression in 3 dimensions

2006-09-14 Thread [EMAIL PROTECTED]
Hi Dave! > <> > > Hi Bernhard, > I am just starting to learn Python; could you plz tell me specifically > the introduction(s) you have in mind? > > TIA, > DaveB Take a look at the documenation section on www.scipy.org. Especially the old NumPy documentation (follow link to NumPy tutorial) and th

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-14 Thread [EMAIL PROTECTED]
> One place where I would use such a feature is in a unittest > package. I think being able to write self.assert or self.raise > looks better than having to append an underscore. Maybe that is a good argumment for Py.Test ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: how are dictionary literals handled by the interpreter?

2006-09-14 Thread [EMAIL PROTECTED]
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] wrote: > > I wrote up a quick little set of tests, I was acutally comparing ways > > of doing "case" behavior just to get some performance information. Now > > two of my test cases had almost identical results

Re: Specify string with uniform indentation ignored

2006-09-14 Thread [EMAIL PROTECTED]
tobiah wrote: > Is there a built in way to do this? I don't much > care for: > > string = "function otherlang(){" > string += " doit()" > string += "}" That can be somewhat simplified to: string = "function otherlang(){"\ "doit()"\ "}" It's not exactly

Strange xml.parsers.xml import problem

2006-09-15 Thread [EMAIL PROTECTED]
Hi, c.l.p.'ers- I am having a problem with the import of xml.parsers.expat that has gotten me completely stumped. I have two programs, one a PyQt program and one a command line (text) program that both eventually call the same code that imports xml.parsers.expat. Both give me different results...

Strange xml.parsers.expat import problem [corrected subject]

2006-09-15 Thread [EMAIL PROTECTED]
Sorry, that should have been "xml.parsers.expat" [EMAIL PROTECTED] wrote: > Hi, c.l.p.'ers- > > I am having a problem with the import of xml.parsers.expat that has > gotten me completely stumped. I have two programs, one a PyQt program > and one a command line (text

Re: mp3 libs and programs

2006-09-15 Thread [EMAIL PROTECTED]
t; Tim Williams wrote: > > On 15 Sep 2006 18:16:41 -0700, Jay <[EMAIL PROTECTED]> wrote: > > > I'm writing a python script that involves playing mp3 files. The first > > > approach I had was sending commands to unix command-line programs in > > > order to

Looking for a python IDE

2006-09-15 Thread [EMAIL PROTECTED]
Hello I am looking for a good IDE for Python. Commercial or Open Software. If possible with visual GUI designer. For the moment I am considering Komodo. Any suggestions? Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

RegexBuddy (anyone use this?)

2006-09-16 Thread [EMAIL PROTECTED]
Has anyone tried this thing.. http://www.regular-expressions.info/regexbuddy.html If I had $30 would this be worth getting or should I just try to learn the manual. (I was hopeing the essential refrence would clear things up but I am downloading a gilgillion pages on the re module to try to learn

Re: RegexBuddy (anyone use this?)

2006-09-16 Thread [EMAIL PROTECTED]
vbgunz wrote: > > > Has anyone tried this thing.. > > > http://www.regular-expressions.info/regexbuddy.html > > I use kodos http://kodos.sourceforge.net/. I firmly agree using a tool > like this to learn regular expressions will not only save you a > ridiculous amount of time spent on trial and er

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-16 Thread [EMAIL PROTECTED]
Frank Millman wrote: > Dale Strickland-Clark wrote: > > Now that OIDs have been deprecated in PostgreSQL, how do you find the key of > > a newly inserted record? > > > > I used to use 'select lastval()', but I hit a problem. If I insert a > row into table A, I want the id of the row inserted. If i

Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread [EMAIL PROTECTED]
possible to overexplain it for me. (I am currently downloading a hole directory of re module stuff to try to overcome it) http://www.dexrow.com Leif K-Brooks wrote: > [EMAIL PROTECTED] wrote: > > I am a bit disapointed with the current Python online documentation. I > > have read m

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-16 Thread [EMAIL PROTECTED]
Frank Millman wrote: > Did you read my extract from the PostgreSQL docs - > > "Notice that because this is returning a session-local value, it gives > a predictable answer whether or not other sessions have executed > nextval since the current session did." > I totally missed it, my bad. Thanks!

Re: Python programs always open source?

2006-09-17 Thread [EMAIL PROTECTED]
Guy Fawkes wrote: > I was wondering if Python programs always need to include the source code > with the program itself. I'm asking this because I don't want my program to > be open-source and so far all the Python programs I've seen included the > source code. You can include the source code but

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread [EMAIL PROTECTED]
Carl Drinkwater wrote: > Hi all, > > Code Golf's 12th challenge has just been added to the site. It asks you > to calculate the first 1,000 digits of Pi - Something I'm sure most of > you have thought about, but never done. You can see the challenge at : > >http://codegolf.com/1000-digits-of

Threads blocking on OpenBSD w/ Python 2.4.2

2006-09-18 Thread [EMAIL PROTECTED]
roduces output like this: tarja:~ ben$ ./mycapd Starting thread. Thread started. 1158608481.67 [] 1158608482.67 [] 1158608483.67 [] ... But on OpenBSD I get this: [ [EMAIL PROTECTED] ] $ ./mycapd Starting thread. Thread started. 1158608528.5 [] And there it hangs until I dump some data into the fifo. Then i

Re: why a main() function?

2006-09-18 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I think I read a suggestion somewhere to wrap the code where a Python > script starts in a main() function, so one has > > def main(): > print "hi" > > main() > > instead of > > print "hi" > > What are the a

Recursing for Progress Bar

2006-09-18 Thread [EMAIL PROTECTED]
I'm making a small interface for copying large groups of files around a filesystem. I have a progressbar that counts the items in the destination, and increments as each new file is copied over. It compares this number to the number of files in the source and updates accordingly. All is fine and

Re: Recursing for Progress Bar

2006-09-18 Thread [EMAIL PROTECTED]
DOLT! Thanks! Dennis Lee Bieber wrote: > On 18 Sep 2006 19:38:48 -0700, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > Is there a way to get around recursion limits? Help! > > > Yes

Re: Recursing for Progress Bar

2006-09-18 Thread [EMAIL PROTECTED]
Makes perfect sense. Sometimes it takes being whacked to see it the right way. Thanks! Ben Finney wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > Is there a way to get around recursion limits? Help! > > > >

Re: Python programs always open source?

2006-09-19 Thread [EMAIL PROTECTED]
Diez B. Roggisch wrote: > Ben Finney schrieb: > Ben Finney wrote: > > So long as you're not distributing some or all of Python itself, > > or a derivative work, the license for Python has no legal effect > > on what license you choose for your own work. > > [SNIP] > > My claim (and

Re: Pyglade, gtk, howto write more efficiently, and waste less code?

2006-09-19 Thread [EMAIL PROTECTED]
Pipiten wrote: > Hi everybody, i` m new in this group, and python so.., my greetings to > everybody here. > I wrote a little program, in wich i do this: > (I have several "Select File" buttons, one for each file (in this case, > an image) wich has an text_entry, so i can add a comment for each > p

Re: Threads blocking on OpenBSD w/ Python 2.4.2

2006-09-19 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I'm attempting to write a faily simple threaded app that fires off a > thread to select() on a FIFO while the main loop handles data read from > that pipe and a few other tasks. For some reason, calls to > time.sleep() seem to block until the first ti

Re: help with relative imports

2006-09-19 Thread [EMAIL PROTECTED]
John Salerno wrote: > Robert Kern wrote: > > > What is ambiguous about A.B.D, A.E, and A.F.G? But if you like: > > I guess maybe I was looking at it backwards. From the way it was worded, > I thought the only information we had to use was the structure A.B.C, > and then given a statement like: > >

Re: new string method in 2.5 (partition)

2006-09-19 Thread [EMAIL PROTECTED]
I'm confused. What's the difference between this and string.split? John Salerno wrote: > Forgive my excitement, especially if you are already aware of this, but > this seems like the kind of feature that is easily overlooked (yet could > be very useful): > > > Both 8-bit and Unicode strings have n

newbe's re question

2006-09-19 Thread [EMAIL PROTECTED]
All I am after realy is to change this reline = re.line.split('instr', '/d$') into something that grabs any line with instr in it take all the numbers and then grab any comment that may or may not be at the end of the line starting with ; until the end of the line including white spaces.. this

Re: newbe's re question

2006-09-19 Thread [EMAIL PROTECTED]
George Sakkis wrote: > [EMAIL PROTECTED] wrote: > > > All I am after realy is to change this > > > > reline = re.line.split('instr', '/d$') > > If you think this is the only problem in your code, think again; almost > every other line h

Re: newbe's re question

2006-09-20 Thread [EMAIL PROTECTED]
Frederic Rentsch wrote: > [EMAIL PROTECTED] wrote: > > All I am after realy is to change this > > > > reline = re.line.split('instr', '/d$') > > > > into something that grabs any line with instr in it take all the > > numbers and then gr

Re: newbe's re question

2006-09-20 Thread [EMAIL PROTECTED]
Frederic Rentsch wrote: > [EMAIL PROTECTED] wrote: > > Frederic Rentsch wrote: > > > >> [EMAIL PROTECTED] wrote: > >> > >>> All I am after realy is to change this > >>> > >>> reline = re.line.split('instr', 

Is it possible to save a running program and reload next time ?

2006-09-21 Thread [EMAIL PROTECTED]
Hi, I have a program which will continue to run for several days. When it is running, I can't do anything except waiting because it takes over most of the CUP time. Is it possible that the program can save all running data to a file when I want it to stop, and can reload the data and continue

Re: Priority based concurrent execution

2006-09-21 Thread [EMAIL PROTECTED]
Willi Richert wrote: > Hi, > > I have a simulation application (PlayerStage) in which the robot is asked > every ~200ms for an action. In the meantime the robot has to do some > calculation with the perception. As the calculation gets more and more time > consuming I am thinking about outsourcing

Re: Is it possible to save a running program and reload next time ?

2006-09-21 Thread [EMAIL PROTECTED]
Dennis Lee Bieber wrote: > On Thu, 21 Sep 2006 15:34:21 +0800, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >> Is it possible that the program can save all running data to a file when >> I want it to stop,

Re: I need some help with a regexp please

2006-09-21 Thread [EMAIL PROTECTED]
codefire wrote: > Hi, > > I am trying to get a regexp to validate email addresses but can't get > it quite right. The problem is I can't quite find the regexp to deal > with ignoring the case [EMAIL PROTECTED], which is not valid. Here's > my attempt, neither of

Does WSGI offer anything for web *beginner*?

2006-09-21 Thread [EMAIL PROTECTED]
I love idea of WSGI and hope it succeeds. It seems to be helpful for person tempted to write his own framework.they can now just mix and match existing components with WSGI //instead//. I not sure what WSGI offers the web beginner. Aren't they still better off learning an existing web framew

Retrieve HTML from site using cookies

2006-09-21 Thread [EMAIL PROTECTED]
Greetings gents. I'm a Railser working on a django app that needs to do some scraping to gather its data. I need to programatically access a site that requires a username and password. Once I post to the login.php page, there seems to be a redirect and it seems that the site is using a session (pe

Re: Is it possible to save a running program and reload next time ?

2006-09-21 Thread [EMAIL PROTECTED]
Hans Georg Krauthaeuser wrote: > [EMAIL PROTECTED] wrote: > >> Can objects be saved and reloaded by "Pickle" ? I have tried but no >> success. >> >> > Yes, that's the intended use of pickle/cPickle. There are examples in > the docs

Re: Is it possible to save a running program and reload next time ?

2006-09-22 Thread [EMAIL PROTECTED]
Hans Georg Krauthaeuser wrote: > [EMAIL PROTECTED] wrote: > >> Hans Georg Krauthaeuser wrote: >> >>> [EMAIL PROTECTED] wrote: >>> >>> >>>> Can objects be saved and reloaded by "Pickle" ? I have tried but no >

Anyone use PyPar (Python MPI implementation) recently?

2006-09-22 Thread [EMAIL PROTECTED]
Has anyone used PyPar ( http://datamining.anu.edu.au/~ole/pypar/ ) recently? I _do_ want to do MPI (not BSP) but I don't need any advanced MPI things... and PyPar seemed just up my ally... but alas it doesn't compile: ### [umbriel][~/download/pypar_1_9_2]> python setup.py --prefix=$MY_PRE

Re: Anyone use PyPar (Python MPI implementation) recently?

2006-09-22 Thread [EMAIL PROTECTED]
Nevermind... I'm an idiot... just didn't specify the right options... python setup.py install --prefix=$MY_PREFIX Works just fine... sigh. Friedmud -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-22 Thread [EMAIL PROTECTED]
seb wrote: > Hi, > > I am using pygtk for the first times. > > I am wondering what would be the best "pattern" to interface pygtk with > a thread. > > The thread is collecting informations (over the network for example) or > is doing some long calculations. It sounds like you don't need to share a

Re: +1 QOTW

2006-09-22 Thread [EMAIL PROTECTED]
James Stroud wrote: > Terry Reedy wrote: > > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>Did anyone else crack up when Larry Wall described python with the > >>statement: > >> > >>Python, as the "a

Best practice for large source code projects

2006-09-22 Thread [EMAIL PROTECTED]
I'm developing a web system and based on some patterns I've seen elsewhere, I made a single file (model.py) to hold all of the functions and classes that define the model porition of the application. Hence the code in the controller looks like: import model def Display(req,id): # It wor

Converting Perl Web Report to Python

2006-09-23 Thread [EMAIL PROTECTED]
I enjoyed Paul Barry's September article in Linux Journal entitled, "Web Reporting with MySQL, CSS and Perl". It provides a simple, elegant way to use HTML to display database content without any sql markup in the cgi script. The cgi script simply calls the Mysql command line with the HTML option

Re: newbe's re question

2006-09-23 Thread [EMAIL PROTECTED]
(would look nice in a grid) http://www.msn.com .. Frederic Rentsch wrote: > [EMAIL PROTECTED] wrote: > > Frederic Rentsch wrote: > > > >> [EMAIL PROTECTED] wrote: > >> > >>> Frederic Rentsch wrote: > >>> > >>> > >>>&

Re: Converting Perl Web Report to Python

2006-09-23 Thread [EMAIL PROTECTED]
Dennis, Wow! Talk about RAD development... Nice job... Errr, real nice job. I will test your concepts and see how it works. Thanks a ton. You far exceeded my expectations! Pat Dennis Lee Bieber wrote: > On 23 Sep 2006 06:04:16 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]&

Building Vim against Python 2.5

2006-09-23 Thread [EMAIL PROTECTED]
[Any python/C interface gurus please correct me if my understanding is wrong, as this fix is slated for inclusion in future versions of vim--thanks!] Just as a heads up for anyone building vim with python2.5 as the extension language: Simple solution: Python 2.5 has tightened up how it does memor

Re: newbe's re question

2006-09-24 Thread [EMAIL PROTECTED]
Frederic Rentsch wrote: > [EMAIL PROTECTED] wrote: > > These are csound files. Csound recently added python as a scripting > > language and is allowing also allowing csound calls from outside of > > csound. The nice thing about csound is that instead of worrying about >

SQL reports like in MS Access

2006-09-24 Thread [EMAIL PROTECTED]
Hi, what is the best unit for creating reports like in Microsoft Access, i.e. with page header / footer, grouping, group headers / footers etc., with Wysiwyg editor? Thanks a lot, Jakub -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting Perl Web Report to Python

2006-09-24 Thread [EMAIL PROTECTED]
executed? This capability would allow each sql script to be extendable. It would allow me to embed a URL with specific parameters in report OR in Wiki pages, emails when I need to. Thanks! Pat Dennis Lee Bieber wrote: > On 23 Sep 2006 06:04:16 -0700, "[EMAIL PROTECTED]" <[EM

Re: Converting Perl Web Report to Python

2006-09-25 Thread [EMAIL PROTECTED]
Python learning resource (book web link or both) do you recommend? Pat Dennis Lee Bieber wrote: > On 24 Sep 2006 14:05:29 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > download and install the required MySQLdb

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-25 Thread [EMAIL PROTECTED]
seb wrote: > Hi, > > I am running on WinXP so that is not so convenient to communicate > between separate processes. Can you elaborate? Windows offers plenty of IPC possibilities, including interprocess mutexes and semaphores. See for instance: http://www.codeproject.com/threads/Win32IPC.asp In

AN Intorduction to Tkinter

2006-09-26 Thread [EMAIL PROTECTED]
Hi, I'm too lazy to retype my "problem", so here's the message I sent to the py2exe mailing list (not quite the right place, but thankfully, I was redirected here...) I know that the most known tkinter intro guide at the time is "An Intorduction to Tkinter" by Frederick Lundh, but after trying so

Re: a different question: can you earn a living with *just* python?

2006-09-26 Thread [EMAIL PROTECTED]
John Salerno wrote: > It's a nice thought that a person can earn a living programming with > Python, which is fun enough to use just for its own sake. But for > someone like me (i.e. no programming experience) it's always a little > disheartening to see that most (if not all) job descriptions that

Re: AN Intorduction to Tkinter

2006-09-26 Thread [EMAIL PROTECTED]
> Tis question was just asked on the py2exe mailing list. I predicted > that if it was asked here, you would respond asking exactly which > examples didn't work. :-p Right you were :-) Just want to learn what I already know as a great programming interface(?)/language... Tanner -- http://mail.

Re: a different question: can you earn a living with *just* python?

2006-09-26 Thread [EMAIL PROTECTED]
Roy Smith wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > If you're really trying to become a well-rounded computer professional > > I'd recommend reasonable exposure to at least: > > > > * C > > * A static functional lang

Re: Computer Language Popularity Trend

2006-09-27 Thread [EMAIL PROTECTED]
Xah Lee wrote: > Computer Language Popularity Trend > > This page gives a visual report of computer languages's popularity, as > indicated by their traffic level in newsgroups. This is not a > comprehensive or fair survey, but does give some indications of > popularity trends. > > http://xahlee.or

Re: iterator question

2006-09-27 Thread [EMAIL PROTECTED]
Simple list comprehension? >>> l = [1,2,3,4,5,6,7,8,9,0] >>> [(x, x+1) for x in l if x%2 == 1] [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)] Danny Neal Becker wrote: > George Sakkis wrote: > > > [EMAIL PROTECTED] wrote: > > > >> def transform(seq, siz

Re: iterator question

2006-09-27 Thread [EMAIL PROTECTED]
Er, whoops. That would work if the last item in the list was 10 (and, of course, this doesn't work for any arbitrary sequence). Is there any "look-ahead" function for list comprehensions? Danny [EMAIL PROTECTED] wrote: > Simple list comprehension? > > >>> l = [

Why don't optional mutable objects show up in vars(func)?

2006-09-27 Thread [EMAIL PROTECTED]
So I just got bitten by the "don't use a mutable object as an optional argument" gotcha. I now realize that for this function: >>> def func(x, y=[]): ... y.append(x) ... print y ... y is initialized when the function is imported, not when the function is executed. However, if this is th

Re: Computer Language Popularity Trend

2006-09-27 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > You can also get a rough measure ot the popularity of web scripting > languages from an analysis of the URLs. The last time I did this was in > 2003, and as I recall, these were the results: > PHP 30% and increasing > Perl 28% and falling > ASP 25

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread [EMAIL PROTECTED]
John Salerno wrote: > [EMAIL PROTECTED] wrote: > > > Yes, and making sure that the first several you learn are disparate in > > their common idioms and programming models is incredibly worthwile to > > your development as a programmer IMO. > > You're right

<    15   16   17   18   19   20   21   22   23   24   >