Re: Inconsistency in retrieving exceptions via sys module

2008-05-12 Thread Gabriel Genellina
En Mon, 12 May 2008 13:47:45 -0300, Raj Bandyopadhyay <[EMAIL PROTECTED]> escribió: I am writing some C code which sets and retrieves a Python exception. I set the exception using PyErr_SetString(), and retrieve it in 2 ways: 1) using PyErr_Occurred() and 2) Using sys.exc_type. However, I get

Re: python vs. grep

2008-05-12 Thread Ville M. Vainio
Ricardo Aráoz <[EMAIL PROTECTED]> writes: > The easy/simple (too easy/simple?) way I see out of it is to read THE > WHOLE file into memory and don't worry. But what if the file is too The easiest and simplest approach is often the best with Python. Reading in the whole file is rarely too heavy, a

Re: artificiall, agent, movement

2008-05-12 Thread Iman
On May 12, 4:50 pm, Gerry <[EMAIL PROTECTED]> wrote: > Many city travel surveys collect source destination trip-start data; > you might be able to find one of these studies. > > I think each car in your simulation should have a destination.  Then > the simulation needs a route-finder, and cars can

Re: anonymous assignment

2008-05-12 Thread Arnaud Delobelle
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > here is a very sophisticated implementation :) > def extract(indices, seq): > ... return tuple(seq[i] for i in indices) > ... y, d = extract((0, 2), time.

Re: Python and Flaming Thunder

2008-05-12 Thread castironpi
On May 12, 8:36 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > On May 12, 7:20 pm, [EMAIL PROTECTED] wrote: > > > Yes, I am trying to visualize something. > > If it is related to making furniture comfortable for humans, have you > considered painting the furniture with thermochromic paint > (http://

Re: Learning Python for no reason

2008-05-12 Thread Brian Vanderburg II
John Salerno wrote: Just something that crosses my mind every time I delve into "Learning Python" each night. Does anyone see any value in learning Python when you don't need to for school, work, or any other reason? I mean, sure, there's value in learning anything at any time, but for somethin

Re: anonymous assignment

2008-05-12 Thread Kam-Hung Soh
On Tue, 13 May 2008 13:23:30 +1000, Yves Dorfsman <[EMAIL PROTECTED]> wrote: Scott David Daniels wrote: Yves Dorfsman wrote: ... Sorry this was a typo (again :-), I meant: d = time.local() y = d[0] d = d[2] Then: y, d = list(time.localtime())[:4:2] What is this ? Could you point me

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Gabriel Genellina
En Mon, 12 May 2008 14:42:30 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: On 12 mai, 09:00, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Sat, 10 May 2008 22:12:37 -0300, globalrev <[EMAIL PROTECTED]> escribió: > "Write a program that prints the numbers from 1 to 100. But for

Re: Chinese names in Python source

2008-05-12 Thread rong889
On 5月13日, 上午11时36分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > It's probably not news to anyone here that Python 3 gives us > access to the unicode codespace for Python names, not just > string literals, meaning our functions and classes, lists and > dictionaries, might go outside Latin-1 for

Re: Python's doc problems: sort

2008-05-12 Thread Marek Kubica
On Tue, 29 Apr 2008 19:48:39 -0700, [EMAIL PROTECTED] wrote: > Python priests: go fuck yourselfs. In case you have something useful to add, grap the documentation sources of Python 2.6 (they were converted from LaTeX to reST now) and send a patch to the documentation maintainers. Lamenting abou

Re: how to get information of a running prog in python

2008-05-12 Thread Ivan Illarionov
On Mon, 12 May 2008 20:29:46 -0700, George Sakkis wrote: > On May 12, 11:02 pm, Jimmy <[EMAIL PROTECTED]> wrote: >> On May 13, 10:36 am, "Dan Upton" <[EMAIL PROTECTED]> wrote: >> >> >> >> > On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]> >> > wrote: >> > > Well, i know it may be a litt

Re: Orlando Florida Python Tutor Needed

2008-05-12 Thread vbgunz
> I know you're looking for "one-on-one" help, direction, and/or > tutelage, but since you've not received an answer (yet), here's some > general info... > For Decorators, have a gander at: >    http://www.ddj.com/web-development/184406073;jsessionid=QCNTPTSNXZP2W... >    http://www.ibm.com/develo

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread John Salerno
Ben Finney wrote: > I think that the idiom > > for unused in xrange(10): > # do stuff with no reference to 'unused' > > is quite common. Is that what you're asking about? Yes. I was more or less asking about the specific situation of using a for loop to do something X number of times,

Re: Learning Python for no reason

2008-05-12 Thread John Salerno
Martin v. Löwis wrote: > OTOH: do you plan to do any programming at all, in your > life? If yes: consider using Python for every programming > task you'll encounter Yeah, I do plan to use it for fun (if I can think of little projects to work on!), and Python is definitely the only language I care

Re: Learning Python for no reason

2008-05-12 Thread John Salerno
notbob wrote: > On 2008-05-12, John Salerno <[EMAIL PROTECTED]> wrote: > >> language, I can't help but feel that I will be mostly unable to use what I >> learn simply because I have no reason to use it. > >> The *process* of learning is enough fun for me, and every now and then I do >> find a sm

Re: Learning Python for no reason

2008-05-12 Thread John Salerno
Matthew Woodcraft wrote: > I can't tell from what you wrote whether you feel you won't have any > reason to do any programming, or whether you already know several other > programming languages and you feel you won't have any reason to use > Python in particular. Definitely the former. I've loved

Re: Popen pipe hang

2008-05-12 Thread schickb
On May 12, 7:35 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >from subprocess import Popen, PIPE > >from array import array > > >arr = array('B') > >arr.fromstring("hello\n") > > >src = Popen( ["cat"], stdin=PIPE, stdout=PIPE) > >dst = Popen( ["cat"], stdin=src.stdout) > >arr.tofile(src.std

Chinese names in Python source

2008-05-12 Thread [EMAIL PROTECTED]
It's probably not news to anyone here that Python 3 gives us access to the unicode codespace for Python names, not just string literals, meaning our functions and classes, lists and dictionaries, might go outside Latin-1 for their source code representation. I have an example in my blog: http://m

Re: how to get information of a running prog in python

2008-05-12 Thread George Sakkis
On May 12, 11:02 pm, Jimmy <[EMAIL PROTECTED]> wrote: > On May 13, 10:36 am, "Dan Upton" <[EMAIL PROTECTED]> wrote: > > > > > On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]> wrote: > > > Well, i know it may be a little non-python thing, however, I can think > > >  of no place better to

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
Marc 'BlackJack' Rintsch wrote: y, _, d, _, _, _, _, _, _ = time.localtime() But you still have have a variable that's using memory for nothing. I find this unsatisfactory... Get over it… Than what's the point of wanting a better language if every time we run in something that looks wron

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
Scott David Daniels wrote: Yves Dorfsman wrote: ... Sorry this was a typo (again :-), I meant: d = time.local() y = d[0] d = d[2] Then: y, d = list(time.localtime())[:4:2] What is this ? Could you point me to a document on this syntax ? I've tried it, it works, but I don't understan

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
Ben Finney wrote: y, _, d, _, _, _, _, _, _ = time.localtime() But you still have have a variable that's using memory for nothing. No, you have one extra unused name binding. The values that you don't want to use have *already* been allocated by the time the above statement is executed. Na

Re: how to get information of a running prog in python

2008-05-12 Thread Dan Upton
On Mon, May 12, 2008 at 11:02 PM, Jimmy <[EMAIL PROTECTED]> wrote: > On May 13, 10:36 am, "Dan Upton" <[EMAIL PROTECTED]> wrote: > > > > On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]> wrote: > > > Well, i know it may be a little non-python thing, however, I can think > > > of no pla

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
Gabriel Genellina wrote: Uses Python 2.6! ;) No need of 2.6 - the above code works since Python 2.2 at least: Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. import time t=time.localtime() type(t)

Re: how to get information of a running prog in python

2008-05-12 Thread Ivan Illarionov
On Mon, 12 May 2008 19:19:05 -0700, Jimmy wrote: > Well, i know it may be a little non-python thing, however, I can think > of no place better to post this question :) > > can anyone tell me, in python, how to obtain some information of a > running program? > paticularly, if i am playing some mus

Re: how to get information of a running prog in python

2008-05-12 Thread Jimmy
On May 13, 10:36 am, "Dan Upton" <[EMAIL PROTECTED]> wrote: > On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]> wrote: > > Well, i know it may be a little non-python thing, however, I can think > > of no place better to post this question :) > > > can anyone tell me, in python, how to o

Re: Learning Python for no reason

2008-05-12 Thread alex23
On May 13, 5:50 am, JustMe <[EMAIL PROTECTED]> wrote: > I'm in the same boat. My work seems fixated with .Net but IMHO I think > they would be better off going with Python. Still, who am I to stand > in the way of hundreds of .Net programmers. You could always be the hero who teaches them IronPyth

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread alex23
<[EMAIL PROTECTED]> wrote: > I just can't believe someone applying for a programmer position cannot > provide a sensible anwser in 5 or less minutes. Try taking a look at the level of discourse in the Google App Engine group. It's pretty clear that some - let's say "developers" rather than "progr

Re: anonymous assignment

2008-05-12 Thread Scott David Daniels
Yves Dorfsman wrote: ... Sorry this was a typo (again :-), I meant: d = time.local() y = d[0] d = d[2] Then: y, d = list(time.localtime())[:4:2] --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: frameword vs application server?

2008-05-12 Thread walterbyrd
On May 12, 8:34 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > As mentioned above - in some aspects, that is not really needed. But if > you want more of an app-server, have a look at ZOPE, Kamaelia and maybe > even twisted. Thanks. Kamaelia reminds me of SOA - loosely coupled software servi

Re: question about python statements

2008-05-12 Thread Terry Reedy
"George Sakkis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 12, 7:35 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Ohad Frand" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I am looking for a way to programmically get a list of all python > | existin

Re: how to get information of a running prog in python

2008-05-12 Thread Dan Upton
On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]> wrote: > Well, i know it may be a little non-python thing, however, I can think > of no place better to post this question :) > > can anyone tell me, in python, how to obtain some information of a > running program? > paticularly, if i

Re: Popen pipe hang

2008-05-12 Thread Jean-Paul Calderone
On Mon, 12 May 2008 17:35:44 -0700 (PDT), schickb <[EMAIL PROTECTED]> wrote: I'm trying to pipe data that starts life in an array('B') object through several processes. The code below is a simplified example. The data makes it through, but the wait() always hangs. Is there a better way to indicat

how to get information of a running prog in python

2008-05-12 Thread Jimmy
Well, i know it may be a little non-python thing, however, I can think of no place better to post this question :) can anyone tell me, in python, how to obtain some information of a running program? paticularly, if i am playing some music in audacious or other media player, how can i get the the n

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread George Sakkis
On May 12, 7:03 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Carl Banks <[EMAIL PROTECTED]> writes: > > IMHO, whether a varibale is used or not has got to be one of the least > > important things of all (in no small part because it's easily > > discernable from nearby code). > > I couldn't disagree

Re: Python and Flaming Thunder

2008-05-12 Thread Dave Parker
On May 12, 7:20 pm, [EMAIL PROTECTED] wrote: > Yes, I am trying to visualize something. If it is related to making furniture comfortable for humans, have you considered painting the furniture with thermochromic paint ( http://en.wikipedia.org/wiki/Thermochromism )? It changes color in response to

Re: PyGame, window is not closing, tut not helping

2008-05-12 Thread JL
If the game runs normally without IDLE, then, to run it from IDLE, add pygame.quit() at the end of the script: if __name__ == "__main__": MainWindow = PyManMain() MainWindow.MainLoop() pygame.quit() ... and just before the sys.exit(): def MainLoop(self): """This is the Ma

Re: Python and Flaming Thunder

2008-05-12 Thread castironpi
On May 12, 8:18 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > On May 12, 7:12 pm, [EMAIL PROTECTED] wrote: > > > Mine's been always messing up the color wheel. > > Messing up in what way?  Are you using the colors to visualize > something? In a manner of speaking. I'm a first-time-live Information

Re: Python and Flaming Thunder

2008-05-12 Thread Dave Parker
On May 12, 7:12 pm, [EMAIL PROTECTED] wrote: > Mine's been always messing up the color wheel. Messing up in what way? Are you using the colors to visualize something? -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python for no reason

2008-05-12 Thread castironpi
Anyway, Chuck's post doesn't question any of the competencies of computer science. Is it safe to name-call silly, or have -I- by disdesign misinterpreted? On May 12, 6:41 pm, "Chuckk Hubbard" <[EMAIL PROTECTED]> wrote: > I'm another one pretty early in his programming education, but here's my tak

Re: question about python statements

2008-05-12 Thread George Sakkis
On May 12, 7:35 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Ohad Frand" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I am looking for a way to programmically get a list of all python > | existing statements that I cannot access by __builtins__ or locals() > | (like ["asse

Re: Python and Flaming Thunder

2008-05-12 Thread castironpi
On May 12, 7:59 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > On May 12, 6:32 pm, [EMAIL PROTECTED] wrote: > > > Can you render some furniture for me... to try to see some human > > posture to lowest energy levels. > > I couldn't find any furniture created using DPGraph, but the math art > gallery a

Re: Python and Flaming Thunder

2008-05-12 Thread Dave Parker
On May 12, 6:32 pm, [EMAIL PROTECTED] wrote: > Can you render some furniture for me... to try to see some human > posture to lowest energy levels. I couldn't find any furniture created using DPGraph, but the math art gallery at http://www.dpgraph.com/math-art.html has a sailboat, an F15, Tux (the

Re: Python and Flaming Thunder

2008-05-12 Thread Dave Parker
On May 12, 6:32 pm, [EMAIL PROTECTED] wrote: > Can you render some furniture for me... to try to see some human > posture to lowest energy levels. Not yet; Flaming Thunder doesn't have built-in graphics yet. But we're incorporating the graphics from www.dpgraph.com , so when that's finished, then

Sparse Matrix Multiplications

2008-05-12 Thread dingo_1980
I was trying to create a sparse matrix using scipy.sparse (10 X 10) with just the first row and first column filled with ones. Lets call this matrix Asp. This is how I created Asp from scipy import sparse Asp = scipy.lil_matrix(10,10) for i in range(10): Asp[i,0] = i Asp[

Popen pipe hang

2008-05-12 Thread schickb
I'm trying to pipe data that starts life in an array('B') object through several processes. The code below is a simplified example. The data makes it through, but the wait() always hangs. Is there a better way to indicate src.stdin has reach EOF? from subprocess import Popen, PIPE from array impor

Re: Python and Flaming Thunder

2008-05-12 Thread castironpi
On May 12, 6:39 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > I've read that one of the design goals of Python was to create an easy- > to-use English-like language.  That's also one of the design goals of > Flaming Thunder athttp://www.flamingthunder.com/ , which has proven > easy enough for even e

Re: Socket and cycle problem

2008-05-12 Thread castironpi
On May 12, 2:06 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 12 May 2008 11:16:08 -0700 (PDT), [EMAIL PROTECTED] wrote: > > [snip] > > >My script send me via 3883 port (VRPN) data, but only once. I need > >listening this port countinously. > >So I need  make some loop to print data

Re: using PIL for good screenshots

2008-05-12 Thread python
Tim, Sounds like an interesting project. Have you considered using SnagIt to produce your screenshots? www.TechSmith.com/SnagIt Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread Dave Parker
On May 10, 8:19 pm, John Salerno <[EMAIL PROTECTED]> wrote: > It seems somewhat > artificial to use the for loop to do something a certain number of > times, like above. I agree; it's a common flaw with lots of languages, not just Python. I'd be inclined to use something like: FOR 8 TIMES DO .

Re: python vs. grep

2008-05-12 Thread Kam-Hung Soh
On Tue, 13 May 2008 00:03:08 +1000, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: Ville Vainio wrote: On May 8, 8:11 pm, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: All these examples assume your regular expression will not span multiple lines, but this can easily be the case. How would you proce

Re: Learning Python for no reason

2008-05-12 Thread Chuckk Hubbard
I'm another one pretty early in his programming education, but here's my take. Python was specifically recommended to me by a few people for a specific program I wanted to write (userspace, GUI, music). While I gradually learn more about it, I start to spend a lot of time on certain aspects I don'

Python and Flaming Thunder

2008-05-12 Thread Dave Parker
I've read that one of the design goals of Python was to create an easy- to-use English-like language. That's also one of the design goals of Flaming Thunder at http://www.flamingthunder.com/ , which has proven easy enough for even elementary school students, even though it is designed for scienti

Re: question about python statements

2008-05-12 Thread Terry Reedy
"Ohad Frand" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I am looking for a way to programmically get a list of all python | existing statements that I cannot access by __builtins__ or locals() | (like ["assert","break","class",...]) You appear to want the keywords that begin s

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread John Machin
Terry Reedy wrote: "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] En Sat, 10 May 2008 22:12:37 -0300, globalrev <[EMAIL PROTECTED]> escribió: | (We used this question last year - some people gave a sensible answer | in less | than 5 minutes, but others did not

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Kam-Hung Soh
On Tue, 13 May 2008 03:42:30 +1000, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I just can't believe someone applying for a programmer position cannot provide a sensible anwser in 5 or less minutes. You should join the recruitment and interview panel in your organization to test your fait

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread Terry Reedy
"Ben Finney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | So, when not using the values that come from the controlling iterator, | it's good to make that explicit. If Python supported it, we might | prefer to use no name at all for something that isn't used, but the | 'for' synta

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread Carl Banks
On May 12, 7:03 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Carl Banks <[EMAIL PROTECTED]> writes: > > IMHO, whether a varibale is used or not has got to be one of the least > > important things of all (in no small part because it's easily > > discernable from nearby code). > > I couldn't disagree

Re: downloading a link with javascript in it..

2008-05-12 Thread 7stud
On May 12, 4:59 pm, 7stud <[EMAIL PROTECTED]> wrote: > On May 12, 1:54 pm, Jetus <[EMAIL PROTECTED]> wrote: > > > I am able to download this page (enclosed code), but I then want to > > download a pdf file that I can view in a regular browser by clicking > > on the "view" link. I don't know how to

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread Ben Finney
Carl Banks <[EMAIL PROTECTED]> writes: > IMHO, whether a varibale is used or not has got to be one of the least > important things of all (in no small part because it's easily > discernable from nearby code). I couldn't disagree more. If you're binding a name to a value that will never be used,

Re: downloading a link with javascript in it..

2008-05-12 Thread 7stud
On May 12, 1:54 pm, Jetus <[EMAIL PROTECTED]> wrote: > I am able to download this page (enclosed code), but I then want to > download a pdf file that I can view in a regular browser by clicking > on the "view" link. I don't know how to automate this next part of my > script. It seems like it uses J

Re: anonymous assignment

2008-05-12 Thread Terry Reedy
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] here is a very sophisticated implementation :) >>> def extract(indices, seq): ... return tuple(seq[i] for i in indices) ... >>> y, d = extract((0, 2), time.localtime()) >>> y, d (2008, 12) === Or

Re: Learning Python for no reason

2008-05-12 Thread CM
On May 12, 1:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote: > Just something that crosses my mind every time I delve into "Learning > Python" each night. Does anyone see any value in learning Python when you > don't need to for school, work, or any other reason? I mean, sure, there's > value in l

Re: python vs. grep

2008-05-12 Thread Ricardo Aráoz
Ville Vainio wrote: On May 8, 8:11 pm, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: All these examples assume your regular expression will not span multiple lines, but this can easily be the case. How would you process the file with regular expressions that span multiple lines? re.findall/ findit

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Terry Reedy
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] En Sat, 10 May 2008 22:12:37 -0300, globalrev <[EMAIL PROTECTED]> escribió: | (We used this question last year - some people gave a sensible answer | in less | than 5 minutes, but others did not even know how to sta

using PIL for good screenshots

2008-05-12 Thread Tim Arnold
Hi, I'm using PIL to enhance screenshots for print and online publication. I'm writing to see if someone else is doing similar work. The shots are dialogs, menus, etc. -- my workflow to create the print images: (1) writer takes screenshot on Windows XP box (96dpi) -- *** Pyth

Re: Learning Python for no reason

2008-05-12 Thread king kikapu
Same for me here too! C# on the work, Python earning at the evening. I am bored to death with so many .net/C# years and i wanted to learn something different and cross platform. I think it will pay back some time... On May 12, 10:50 pm, JustMe <[EMAIL PROTECTED]> wrote: > On 12 May, 20:02, Mensana

Re: Import/Create module from buffer

2008-05-12 Thread Gabriel Genellina
En Mon, 12 May 2008 08:09:45 -0300, Gruik <[EMAIL PROTECTED]> escribió: > On May 12, 12:31 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Mon, 12 May 2008 05:49:22 -0300, Gruik <[EMAIL PROTECTED]> escribió: >> >> > I'm currently working on python embedding with C++. My goal is that >>

Re: Python-list Digest, Vol 56, Issue 204

2008-05-12 Thread Gareth Owen
On Monday 12 May 2008 14:55:06 [EMAIL PROTECTED] wrote: > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-list > or, via email, send a message with subjec

Re: Learning Python for no reason

2008-05-12 Thread Matthew Woodcraft
John Salerno <[EMAIL PROTECTED]> wrote: > Just something that crosses my mind every time I delve into "Learning > Python" each night. Does anyone see any value in learning Python when you > don't need to for school, work, or any other reason? I mean, sure, there's > value in learning anything at

Re: thread stomp?

2008-05-12 Thread Jerry Hill
On Mon, May 12, 2008 at 4:00 PM, pyn3wb <[EMAIL PROTECTED]> wrote: > class main Why are you making main a class? It should almost certainly be a function (defined with "def", not "class"). > for i in dircache.listdir(dir): > //run over files > class1(dir)

Re: threading - race condition?

2008-05-12 Thread Rhamphoryncus
On May 12, 1:31 pm, skunkwerk <[EMAIL PROTECTED]> wrote: > On May 12, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On May 11, 10:16 am,skunkwerk<[EMAIL PROTECTED]> wrote: > > > > On May 10, 1:31 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > > > On Fri, 9 May 2008 08:40:38 -0

Re: thread stomp?

2008-05-12 Thread D'Arcy J.M. Cain
On Mon, 12 May 2008 20:00:52 GMT pyn3wb <[EMAIL PROTECTED]> wrote: > class1 (threading.Thread): ^ SyntaxError: invalid syntax Give us a script that works. Ideally it should output something that indicates what the error is. > //run over files This is not

Re: downloading a link with javascript in it..

2008-05-12 Thread Diez B. Roggisch
Jetus schrieb: I am able to download this page (enclosed code), but I then want to download a pdf file that I can view in a regular browser by clicking on the "view" link. I don't know how to automate this next part of my script. It seems like it uses Javascript. The line in the page source says

thread stomp?

2008-05-12 Thread pyn3wb
class1 (threading.Thread): def __init__(self, dir): self.dir = dir threading.Thread.__init__(self) def run(self): do stuff in dir here... class2 (threading.Thread): def __init__(self, dir, dir2): self.

downloading a link with javascript in it..

2008-05-12 Thread Jetus
I am able to download this page (enclosed code), but I then want to download a pdf file that I can view in a regular browser by clicking on the "view" link. I don't know how to automate this next part of my script. It seems like it uses Javascript. The line in the page source says href="javascript:

Re: Learning Python for no reason

2008-05-12 Thread JustMe
On 12 May, 20:02, Mensanator <[EMAIL PROTECTED]> wrote: > On May 12, 12:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote: > > > Just something that crosses my mind every time I delve into "Learning > > Python" each night. Does anyone see any value in learning Python when you > > don't need to for sc

Re: Learning Python for no reason

2008-05-12 Thread Dotan Cohen
2008/5/12 Grant Edwards <[EMAIL PROTECTED]>: > For windows/unix hosted user-space applications, Python is > pretty hard to beat. Apparently, pythons _can_ be beat: (warning: graphic) http://www.proexotics.com/graphics/ball_python_live_prey_1.jpg Dotan Cohen http://what-is-what.com http://gibberi

Re: question about python statements

2008-05-12 Thread Gary Herron
Ohad Frand wrote: Hi I am looking for a way to programmically get a list of all python existing statements that I cannot access by __builtins__ or locals() (like ["assert","break","class",…]) Thanks, Ohad -- http://

Re: threading - race condition?

2008-05-12 Thread skunkwerk
On May 11, 9:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 11 May 2008 13:16:25 -0300,skunkwerk<[EMAIL PROTECTED]> escribió: > > > the only issue i have now is that it takes a long time for 100 threads > > to initialize that connection (>5 minutes) - and as i'm doing this on > > a

Re: threading - race condition?

2008-05-12 Thread skunkwerk
On May 12, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On May 11, 10:16 am,skunkwerk<[EMAIL PROTECTED]> wrote: > > > > > On May 10, 1:31 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > > On Fri, 9 May 2008 08:40:38 -0700 (PDT),skunkwerk<[EMAIL PROTECTED]> > > > declaimed the followin

Re: threading - race condition?

2008-05-12 Thread skunkwerk
On May 11, 1:55 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 11 May 2008 09:16:25 -0700 (PDT),skunkwerk > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > the only issue i have now is that it takes a long time for 100 threads > > to initialize that connection

Re: py3k concerns. An example

2008-05-12 Thread Martin v. Löwis
> Well, my concerns about 3.0 continue to be founded. Up until now I > have been just reading "What's New" docs, and relying on input from > others as to what changes I will have to make. Yesterday I downloaded > and installed 3.0a5, and it is clear that there is *no* way to have a > single code

Re: py3k concerns. An example

2008-05-12 Thread Paul McGuire
On Apr 24, 9:21 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Again, to me, this is a non-issue because I've been able to create a > > cross-version compatible single codebase for pyparsing.  But it was a > > bit dicey there for a while, and I think other module developers/ > > maintainers m

Re: Socket and cycle problem

2008-05-12 Thread Jean-Paul Calderone
On Mon, 12 May 2008 11:16:08 -0700 (PDT), [EMAIL PROTECTED] wrote: [snip] My script send me via 3883 port (VRPN) data, but only once. I need listening this port countinously. So I need make some loop to print data from 3883 port permanent. Data that I recevied looks liek this: receive data fro

Re: Learning Python for no reason

2008-05-12 Thread Mensanator
On May 12, 12:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote: > Just something that crosses my mind every time I delve into "Learning > Python" each night. Does anyone see any value in learning Python when you > don't need to for school, work, or any other reason? I mean, sure, there's > value in

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Mensanator
On May 11, 7:05 pm, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > Ok, I agree with 101, but I wouldn't necessarily > > say the others were unfortunate. You might be > > surprised at how often such fixations discover > > bugs, something that I have a gift for. > > The d

Re: buffering choking sys.stdin.readlines() ?

2008-05-12 Thread cshirky
> readlines() reads all of the file into the memory. Try using xreadlines, > the generator-version, instead. And I'm not 100% sure, but I *think* doing > > for line in sys.stdin both work -- many thanks. -clay -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread Carl Banks
On May 12, 3:42 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Because of the precedent of those names, choosing one of those names > doesn't make it clear to the reader that the value is never used; Why is it even necessary to document this? This is the thing that baffles me the most about this th

Re: Socket and cycle problem

2008-05-12 Thread petr . poupa
On 12 Kvě, 19:16, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 12 May 2008 09:19:48 -0700 (PDT), [EMAIL PROTECTED] wrote: > > > [snip] > > >> >Where is the mistake? I dont know. > > >> You cannot reconnect a socket. You need to create a new one for each > >> connection. It's also almo

Inconsistency in retrieving exceptions via sys module

2008-05-12 Thread Raj Bandyopadhyay
Hi I am writing some C code which sets and retrieves a Python exception. I set the exception using PyErr_SetString(), and retrieve it in 2 ways: 1) using PyErr_Occurred() and 2) Using sys.exc_type. However, I get two different results and am very puzzled by this apparent inconsistency. Could

Re: Cannot run Python 3.0a5 )-:

2008-05-12 Thread Sven Siegmund
Ah, I solved it. I was wrong. I did not do the same as yesterday. Yesterday I downloaded Python 3.0a5 from http://www.python.org/ftp/python/3.0/python-3.0a5.msi and not the daily build. I can python again now (-: S. -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot run Python 3.0a5 )-:

2008-05-12 Thread Martin v. Löwis
> Hi, I just tried to install Python 3.0a5 an another Windows PC. I did > what I have done yesterday at home: > > 1. Downloaded the daily snapshot > http://svn.python.org/snapshots/msi/python-3.0.14011.msi > 2. Installed to C:\Python30 > 3. Added C:\Python30 to the Path environment for all users.

Re: execfile python3k

2008-05-12 Thread Christian Heimes
Odys schrieb: > Hi there, > > Since execfile() is removed in Python 3.0 > I have question about using exec. > > I know about > exec(open('filename').read()) > but from documentation the 1st arg of exec can be 'file object'. > However >exec(open('filename')) > does not work. > Does anybody h

Re: Mathematics in Python are not correct

2008-05-12 Thread Arnaud Delobelle
Mark Dickinson <[EMAIL PROTECTED]> writes: > On May 12, 11:15 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > >> But exp(y*log(x)) -> 1 as (x, y) -> (0, 0) along any analytic curve >> which is not the x=0 axis (I think at least - it seems easy to prove >> that given f and g analytic over R, f(x)

Re: Learning Python for no reason

2008-05-12 Thread Erich
On May 12, 12:27 pm, "John Salerno" <[EMAIL PROTECTED]> wrote: > The *process* of learning is enough fun for me, and every now and then I do > find a small use for Python that really pays off, but for the most part I'm > wondering what people's thoughts are as far as simply learning it for the > s

Re: Learning Python for no reason

2008-05-12 Thread notbob
On 2008-05-12, John Salerno <[EMAIL PROTECTED]> wrote: > language, I can't help but feel that I will be mostly unable to use what I > learn simply because I have no reason to use it. > The *process* of learning is enough fun for me, and every now and then I do > find a small use for Python that

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Grant Edwards
On 2008-05-12, Paul Hankin <[EMAIL PROTECTED]> wrote: > for i in xrange(1, 101): > print 'Fizz'*(i%3<1)+'Buzz'*(i%5<1) or i Doh! It never occured to me that 'string' * 0 == ''. -- Grant Edwards grante Yow! An air of FRENCH FRIES

Re: Learning Python for no reason

2008-05-12 Thread Grant Edwards
On 2008-05-12, Martin v. L?wis <[EMAIL PROTECTED]> wrote: > OTOH: do you plan to do any programming at all, in your > life? If yes: consider using Python for every programming > task you'll encounter - unless there are outside constraints > demanding a different language. Python is flexible enough

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread [EMAIL PROTECTED]
On 12 mai, 09:00, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 10 May 2008 22:12:37 -0300, globalrev <[EMAIL PROTECTED]> escribió: > > > > >http://reddit.com/r/programming/info/18td4/comments > > > claims people take a lot of time to write a simple program like this: > > > "Write a prog

  1   2   >