Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Samuel Bayer
Jonathan Gardner wrote: Let me share my personal insight. I used Python for a mission-critical application that needed, in effect, almost 100% uptime with superior throughput. In other words, it was a very fine piece of art that needed to be precise and correct. In the end, Python delivered, und

can't assign to literal

2008-06-10 Thread maehhheeyy
this is stopping my program from running properly. is there something wrong in my code when that happens? -- http://mail.python.org/mailman/listinfo/python-list

Re: can't assign to literal

2008-06-10 Thread Matimus
On Jun 10, 12:53 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: > this is stopping my program from running properly. is there something > wrong in my code when that happens? yes Post your code, or at least the full error message if you want more details. Matt -- http://mail.python.org/mailman/listinf

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread GHUM
Evan, > I hear this problem is fixed in 0.6.8, but unfortunately there's no > standalone installer for py2exe 0.6.8 - the most recent version that Maybe you can solve your problem via updating the build_exe.py after installing py2exe 0.6.6 So: a) use the 0.6.6 installer b) update the build_exe.p

Re: Books for programmers

2008-06-10 Thread vasudevram
On Jun 5, 3:09 am, [EMAIL PROTECTED] (Michael H. Goldwasser) wrote: > Dick Moores <[EMAIL PROTECTED]> writes: > > Do not neglect the 2008 book, "Object-Oriented Programming in Python", > > by Goldwasser and Letscher. > > > >

Re: Determining which things in 'from package import *' are actually used

2008-06-10 Thread Patrick Bouffard
On Jun 10, 3:03 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Patrick Bouffard wrote: > > I have a fairly large library of Python code, where 'from package import *' > > is > > used rather liberally, and it's not uncommon for more than one of these to > > appear in any given module. What I'd like t

Re: Cannot install python under Win32

2008-06-10 Thread Martin v. Löwis
> DEBUG: Error 2356: Couldn't locate cabinet in stream: python. That sounds bad indeed. In the original file, that stream is definitely present, so most likely, you experienced a corruption in download. Please check the md5 sum of the MSI file; if it differs, download again (preferably using a di

Re: can't assign to literal

2008-06-10 Thread maehhheeyy
On Jun 10, 1:21 pm, Matimus <[EMAIL PROTECTED]> wrote: > On Jun 10, 12:53 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: > > > this is stopping my program from running properly. is there something > > wrong in my code when that happens? > > yes > > Post your code, or at least the full error message if y

Re: How to kill a thread?

2008-06-10 Thread Fuzzyman
On Jun 10, 2:03 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 9, 2:52 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 9, 9:20 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > > > > On 2008-06-07, Rhamphoryncus <[EM

Re: lots of futex_wait calls

2008-06-10 Thread skunkwerk
On Jun 6, 10:03 am, André Malo <[EMAIL PROTECTED]> wrote: > skunkwerkwrote: > > I've got a python program written for the django web framework that > > starts about 100 threads. When I start the server, it sometimes eats > > up 100% of the CPU for a good minute or so... though none of the > > thre

Re: can't assign to literal

2008-06-10 Thread Steven Clark
On Tue, Jun 10, 2008 at 5:30 PM, maehhheeyy <[EMAIL PROTECTED]> wrote: > On Jun 10, 1:21 pm, Matimus <[EMAIL PROTECTED]> wrote: >> On Jun 10, 12:53 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: >> >> > this is stopping my program from running properly. is there something >> > wrong in my code when that

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread Larry Bates
[EMAIL PROTECTED] wrote: On Jun 10, 11:34 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: Maybe I'm missing something, but I can rename the executables I create using py2exe 0.6.6 to anything I want after they're created. Or are you talking about a Windows installer for the py2exe module itself? W

Re: can't assign to literal

2008-06-10 Thread Steven Clark
> > for 1 in oids, vals head_oids: > SyntaxError: can't assign to literal > -- 1 is a literal, you can't assign it to something. Are you trying to use it as a variable name? -- http://mail.python.org/mailman/listinfo/python-list

Re: can't assign to literal

2008-06-10 Thread Larry Bates
maehhheeyy wrote: On Jun 10, 1:21 pm, Matimus <[EMAIL PROTECTED]> wrote: On Jun 10, 12:53 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: this is stopping my program from running properly. is there something wrong in my code when that happens? yes Post your code, or at least the full error message

Re: Question by someone coming from C...

2008-06-10 Thread Christian Heimes
John Krukoff wrote: > Since you probably want access to these from many different places in > your code, I find the simplest way is to create a logging module of your > own (not called logging, obviously) and instantiate all of your loggers > in that namespace, then import that one module as needed

Re: pass data from optparse to other class instances

2008-06-10 Thread Tim Arnold
On Jun 9, 5:42 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Tim Arnold schrieb: > > > > > Hi, > > I'm writing a command-line interface using optparse. The cli takes > > several options with a single action and several parameters to be used > > in the resulting worker classes. > > > I've been

Re: Do this as a list comprehension?

2008-06-10 Thread Lie
On Jun 8, 11:11 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 8, 4:04 am, Lie <[EMAIL PROTECTED]> wrote: > > > > > On Jun 8, 8:56 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > On Jun 7, 8:22�pm, John Salerno <[EMAIL PROTECTED]> wrote: > > > > > Mensanator wrote: > > > > > What I DID say wa

Re: money data type

2008-06-10 Thread Lie
On Jun 10, 12:02 am, Stephan Diehl <[EMAIL PROTECTED]> wrote: > Lie wrote: > > On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote: > >> Hi lazyweb, > >> I'm wondering, if there is a usable money data type for python available. > >> A quick search in pypi and google didn't convey anything,

Re: Do this as a list comprehension?

2008-06-10 Thread Mensanator
On Jun 10, 6:09 pm, Lie <[EMAIL PROTECTED]> wrote: > On Jun 8, 11:11 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Jun 8, 4:04 am, Lie <[EMAIL PROTECTED]> wrote: > > > > On Jun 8, 8:56 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > On Jun 7, 8:22�pm, John Salerno <[EMAIL PROTECTED

Re: Python doesn't understand %userprofile%

2008-06-10 Thread TheSaint
On 00:11, mercoledì 11 giugno 2008 Tim Golden wrote: > "%USERPROFILE%/dir/file". os.environ('USERPROFILE') should return an info regarding that environment variable. I guess that, not yet tried. -- Mailsweeper Home : http://it.geocities.com/call_me_not_now/index.html -- http://mail.python.org/ma

Dynamic HTML from Python Script

2008-06-10 Thread asdf
I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with opening files due to file's path

2008-06-10 Thread Alexnb
I am using GUI, Tkinter to be exact. But regardless of how the path gets there, it needs to opened correctly. The problem I am running into is that the program receives a path of a file, either .wma or .mp3 and is supposed to open it. I run into problems when there is either a ")" or a number next

Re: TWITTER API and urllib2

2008-06-10 Thread Mike
On Tue, Jun 10, 2008 at 11:03 PM, Mike <[EMAIL PROTECTED]> wrote: > > > On Tue, Jun 10, 2008 at 10:42 PM, Mike <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I've spent the last couple of nights hacking away at a Python wrapper for >> the Twitter API that I can use for various things. >> >> I'm havi

Re: Python doesn't understand %userprofile%

2008-06-10 Thread castironpi
On Jun 10, 6:51 pm, TheSaint <[EMAIL PROTECTED]> wrote: > On 00:11, mercoledì 11 giugno 2008 Tim Golden wrote: > > > "%USERPROFILE%/dir/file". > > os.environ('USERPROFILE') should return an info regarding that environment > variable. > I guess that, not yet tried. > -- > Mailsweeper Home :http://it

Re: Question by someone coming from C...

2008-06-10 Thread John Krukoff
On Wed, 2008-06-11 at 00:43 +0200, Christian Heimes wrote: > John Krukoff wrote: > > Since you probably want access to these from many different places in > > your code, I find the simplest way is to create a logging module of your > > own (not called logging, obviously) and instantiate all of you

Re: cgi, parse_header and semi-colon

2008-06-10 Thread Gabriel Genellina
En Sat, 07 Jun 2008 04:49:41 -0300, Sylvain <[EMAIL PROTECTED]> escribió: > If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") : > cgi.FieldStorage.filename returns only "my" everything after the semi- > colon is missing It's a known bug: http://bugs.python.org/issue1540529 - the

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread Mike Driscoll
On Jun 10, 4:47 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Jun 10, 11:34 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > >> Maybe I'm missing something, but I can rename the executables I create > >> using py2exe 0.6.6 to anything I want after they're created. > > >

Re: problems with opening files due to file's path

2008-06-10 Thread Grant Edwards
On 2008-06-11, Alexnb <[EMAIL PROTECTED]> wrote: > I am using GUI, Tkinter to be exact. But regardless of how the > path gets there, it needs to opened correctly. The problem I > am running into is that the program receives a path of a file, > either .wma or .mp3 and is supposed to open it. I run

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread Mike Driscoll
Evan, > > > I finally figured out how to check out the code. I'm at work now, > > where I only have VS2008 installed so I'll have to wait until I get > > home this evening to try compiling it. I'll let you know if I have any > > luck. > > > - > > Mike > > > Python Extension B

Re: Dynamic HTML from Python Script

2008-06-10 Thread Aidan
asdf wrote: I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks Well, there's a few ways you could approach it. You could create a cgi program from your script - this is probably the solution you're looki

Re: Dynamic HTML from Python Script

2008-06-10 Thread asdf
> Well, there's a few ways you could approach it. > > You could create a cgi program from your script - this is probably the > solution you're looking for. > Output from the script does come up very often. There is a new output every 10 secs and it's possible that the script might be run indefi

Re: Dynamic HTML from Python Script

2008-06-10 Thread Aidan
asdf wrote: Well, there's a few ways you could approach it. You could create a cgi program from your script - this is probably the solution you're looking for. Output from the script does come up very often. There is a new output every 10 secs and it's possible that the script might be run i

Re: GIL cpu multi core usage problem

2008-06-10 Thread Gabriel Genellina
En Mon, 09 Jun 2008 15:26:09 -0300, Pau Freixes <[EMAIL PROTECTED]> escribió: Surly this is a recurring theme into python dev world, but I need your help for confirm if the follow image it's really http://www.milnou.net/~pfreixes/img/cpu_usage_gil_problem.png

Re: Dynamic HTML from Python Script

2008-06-10 Thread Larry Bates
asdf wrote: I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks Take a look at Django. It may be overkill for this first project but any time you spend learning it should be paid back in future projects.

Re: problems with opening files due to file's path

2008-06-10 Thread Alexnb
Okay, I don't understand how it is too vague, but here: >>> path = "C:\Documents and Settings\Alex\My Documents\My >>> Music\Rhapsody\Bryanbros\Jason Mraz\I'm Yours (Single)\01 - I'm >>> Yours.wma" >>> os.startfile(path) Traceback (most recent call last): File "", line 1, in os.startfile(p

Re: h2py.py bug?

2008-06-10 Thread Gabriel Genellina
En Tue, 10 Jun 2008 09:44:13 -0300, Gabriel Rossetti <[EMAIL PROTECTED]> escribió: I wanted to use the h2py.py script (Tools/scripts/h2py.py) and it didn't like char litterals : Skipping: PC_ERROR = ord() where my *.h file contained : #define PC_ERROR '0' I searched the web and found a p

Re: Dynamic HTML from Python Script

2008-06-10 Thread Mike
Web.py also springs to mind, I'd say it's worth looking at. Well, in that case you could simply append the new output to a static file > every 10 seconds, or whenever there is new output. That way, you just need > to refresh the static file in your browser to see updates... Given what I > underst

Confusion with weakref, __del__ and threading

2008-06-10 Thread George Sakkis
I'm baffled with a situation that involves: 1) an instance of some class that defines __del__, 2) a thread which is created, started and referenced by that instance, and 3) a weakref proxy to the instance that is passed to the thread instead of 'self', to prevent a cyclic reference. This probably

Re: Dynamic HTML from Python Script

2008-06-10 Thread asdf
On Wed, 11 Jun 2008 11:20:48 +1000, Aidan wrote: > asdf wrote: >>> Well, there's a few ways you could approach it. >>> >>> You could create a cgi program from your script - this is probably the >>> solution you're looking for. >>> >>> >> Output from the script does come up very often. There is a n

Re: Dynamic HTML from Python Script

2008-06-10 Thread Mike
On Wed, Jun 11, 2008 at 2:16 PM, asdf <[EMAIL PROTECTED]> wrote: > On Wed, 11 Jun 2008 11:20:48 +1000, Aidan wrote: > > > asdf wrote: > >>> Well, there's a few ways you could approach it. > >>> > >>> You could create a cgi program from your script - this is probably the > >>> solution you're looki

Re: Code correctness, and testing strategies

2008-06-10 Thread Ben Finney
David <[EMAIL PROTECTED]> writes: > On Sun, Jun 8, 2008 at 12:28 PM, Ben Finney > <[EMAIL PROTECTED]> wrote: > > I did do it in a mostly top-down way, but didn't stop the BDD > process to actually run the app :-) > > It sounds like what you are suggesting is something like this: > > 1) Followin

Re: problems with opening files due to file's path

2008-06-10 Thread Carsten Haese
Alexnb wrote: Okay, I don't understand how it is too vague, but here: > [snip a bunch of irrelevant examples...] Did I clarify? No. Earlier you wrote: On 2008-06-11, Alexnb <[EMAIL PROTECTED]> wrote: I am using GUI, Tkinter to be exact. But regardless of how the path gets there, it needs

Re: problems with opening files due to file's path

2008-06-10 Thread Grant Edwards
On 2008-06-11, Alexnb <[EMAIL PROTECTED]> wrote: path = "C:\Documents and Settings\Alex\My Documents\My Music\Rhapsody\Bryanbros\Jason Mraz\I'm Yours (Single)\01 - I'm Yours.wma" Your string doesn't contain what you think it does. Do a "print path". Hint: the string "\01" consist

Earn $5000 + /mo Just by clicking Ads :: all u need is a internet connection

2008-06-10 Thread mathewedward
Did you know there are sites that are willing to pay you to click Ads? Did you also know that it's FREE to sign up to them? You can earn moneyonline, right now, there are already tens of thousands of people that are paid to work at home, some are making a tidy sum just by clickingon a link. PTC's o

Re: Dynamic HTML from Python Script

2008-06-10 Thread Aidan
asdf wrote: On Wed, 11 Jun 2008 11:20:48 +1000, Aidan wrote: asdf wrote: Well, there's a few ways you could approach it. You could create a cgi program from your script - this is probably the solution you're looking for. Output from the script does come up very often. There is a new output

Re: Dynamic HTML from Python Script

2008-06-10 Thread Aidan
Aidan wrote: asdf wrote: On Wed, 11 Jun 2008 11:20:48 +1000, Aidan wrote: asdf wrote: Well, there's a few ways you could approach it. You could create a cgi program from your script - this is probably the solution you're looking for. Output from the script does come up very often. There i

Re: problems with opening files due to file's path

2008-06-10 Thread Alexnb
I don't think you understand it doesn't matter how the variable gets there, the same code is run regardless, I have no problem with the GUI, but you asked, and so I told you. the code os.startfile( is run if there is a GUI or it is a console app. Carsten Haese-2 wrote: > > Alexnb wrote: >>

Re: Problem with TimedRotatingFileHandler

2008-06-10 Thread Gabriel Genellina
En Thu, 05 Jun 2008 04:14:07 -0300, <[EMAIL PROTECTED]> escribió: Hi everyone I'm trying to use python's logging mechanism to write exception data into a log file with the TimedRotatingFileHandler but the rotating of the file is not working... Here's a bit of sample code of what I'm doing

Producer-consumer threading problem

2008-06-10 Thread George Sakkis
I'd like some feedback on a solution to a variant of the producer- consumer problem. My first few attempts turned out to deadlock occasionally; this one seems to be deadlock-free so far but I can't tell if it's provably correct, and if so, whether it can be simplified. The generic producer-consume

Re: Using ElementTree as backend for a chat web application issues

2008-06-10 Thread Gabriel Genellina
En Mon, 09 Jun 2008 15:32:00 -0300, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> escribió: I've built a chat with a front-end Ajax client and backend usign ElementTree to persist the data. In some circunstances I could not yet discover (it seems random) when I edit/save the structure, the st

Re: Producer-consumer threading problem

2008-06-10 Thread Larry Bates
George Sakkis wrote: I'd like some feedback on a solution to a variant of the producer- consumer problem. My first few attempts turned out to deadlock occasionally; this one seems to be deadlock-free so far but I can't tell if it's provably correct, and if so, whether it can be simplified. The g

catastrophic regexp, help!

2008-06-10 Thread cirfu
pat = re.compile("(\w* *)*") this matches all sentences. if fed the string "are you crazy? i am" it will return "are you crazy". i want to find a in a big string a sentence containing Zlatan Ibrahimovic and some other text. ie return the first sentence containing the name Zlatan Ibrahimovic. pat

Thanks for help re: %userprofile%

2008-06-10 Thread bsagert
The python community is very helpful to newbies like me. I did however manage to solve my problem in the meantime. I needed the modification time of certain files on various computers, but I didn't know the usernames ahead of time, so I used windows %userprofile% method. Python likes forward slash

Re: Confusion with weakref, __del__ and threading

2008-06-10 Thread Rhamphoryncus
On Jun 10, 8:15 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm baffled with a situation that involves: > 1) an instance of some class that defines __del__, > 2) a thread which is created, started and referenced by that instance, > and > 3) a weakref proxy to the instance that is passed to the t

Re: Producer-consumer threading problem

2008-06-10 Thread George Sakkis
On Jun 10, 11:47 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > I had a little trouble understanding what exact problem it is that you are > trying to solve but I'm pretty sure that you can do it with one of two > methods: Ok, let me try again with a different example: I want to do what can be ea

Re: How to kill a thread?

2008-06-10 Thread Rhamphoryncus
On Jun 10, 3:41 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 10, 2:03 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > So how does .NET deal with the sys.stdout corruption? Does it? > > That has never been an issue for us. Of course. It's far more likely to hit the underlying blocked I/O tha

Re: Producer-consumer threading problem

2008-06-10 Thread Rhamphoryncus
Why not use a normal Queue, put a dummy value (such as None) in when you're producer has finished, and have the main thread use the normal Thread.join() method on all your child threads? -- http://mail.python.org/mailman/listinfo/python-list

Re: Producer-consumer threading problem

2008-06-10 Thread Carl Banks
On Jun 10, 11:33 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > I'd like some feedback on a solution to a variant of the producer- > consumer problem. My first few attempts turned out to deadlock > occasionally; this one seems to be deadlock-free so far but I can't > tell if it's provably correct,

Re: time.clock() or Windows bug?

2008-06-10 Thread Tim Roberts
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >Hmmm, 10,000,000 cycles (40 ms @2.5GHz) is nowhere near the ~90,000 >second jump in time.clock() output reported by the OP. I wonder if >there could be a different cause? Just wild theorizing, but it's possible that they are actually getting a negativ

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Niklas Norrthon
On 6 Juni, 03:09, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 5, 2:57 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > "Russ P." <[EMAIL PROTECTED]> writes: > > > By the way, my recollection is that in C++ access defaults to private > > > if nothing is declared explicity. So normally the "priva

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Russ P.
On Jun 10, 11:58 am, Jonathan Gardner > Who cares what the type of an object is? Only the machine. Being able > to tell, in advance, what the type of a variable is is a premature > optimization. Tools like psyco prove that computers (really, > programmers) nowadays are smart enough to figure thing

Re: Using ElementTree as backend for a chat web application issues

2008-06-10 Thread Marcelo de Moraes Serpa
Well folks, I appreciate your help, but I've got the problem solved by re-implementing the chat backend (server) in Rails. It is working great now (persisting the data in a mysql database, instead of XML files). At least this has led me to search more about concurrent issues and programming. I'm s

Re: Cannot install python under Win32

2008-06-10 Thread Payala
Hi Martin, I checked the md5 checksum, it is the following: d806af2312a33a8d817a6cc3d2ee7bed *python-2.5.2.msi which doesn't match with the one on the website ( http://www.python.org/download/releases/2.5.2/ ) d71e45968fdc4e206bb69fbf4cb82b2d python-2.5.2.msi (11294720 bytes, signature) File si

<    1   2