Re: ClassName.attribute vs self.__class__.attribute

2008-06-11 Thread Gabriel Rossetti
Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : Larry Bates wrote: Gabriel Rossetti wrote: Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work,

Re: ClassName.attribute vs self.__class__.attribute

2008-06-11 Thread Gabriel Rossetti
Mike Orr wrote: On Jun 5, 8:40 am, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work, until I subclassed

Re: can't assign to literal

2008-06-11 Thread Chris
On Jun 12, 8:03 am, TheSaint <[EMAIL PROTECTED]> wrote: > On 01:37, giovedì 12 giugno 2008 Ethan Furman wrote: > > > Do you mean indenting, or wrapping? > > I mean fill the line by increasing spaces between words in order to get a > paragraph aligned both side, left and right on the page. > So if t

Re: Producer-consumer threading problem

2008-06-11 Thread George Sakkis
On Jun 11, 3:07 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Jun 10, 11:33 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > > > I pasted my current solution athttp://codepad.org/FXF2SWmg. Any > > feedback, especially if it has to do with proving or disproving its > > correctness, will be appreciat

Re: can't assign to literal

2008-06-11 Thread TheSaint
On 01:37, giovedì 12 giugno 2008 Ethan Furman wrote: > Do you mean indenting, or wrapping? I mean fill the line by increasing spaces between words in order to get a paragraph aligned both side, left and right on the page. So if the width is 78 chars it wouldn't have jig saw end to the right side,

Re: catastrophic regexp, help!

2008-06-11 Thread alfasub000
On Jun 11, 11:07 pm, cirfu <[EMAIL PROTECTED]> wrote: > On 11 Juni, 10:25, Chris <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 6:20 am, cirfu <[EMAIL PROTECTED]> wrote: > > > > pat = re.compile("(\w* *)*") > > > this matches all sentences. > > > if fed the string "are you crazy? i am" it will ret

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

2008-06-11 Thread Ben Finney
Michele Simionato <[EMAIL PROTECTED]> writes: > On Jun 12, 6:43 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > Pardon, but I think you mean "experienced". > > > > Of course, GvR may qualify as "experimented" if one considers > > designing a language from scratch to be an expe

Re: مقطع فيديو [الولاده ا لقيصريه] يمنع دخول ضعاف ال قلوب

2008-06-11 Thread Collin
George Sakkis wrote: On Jun 12, 12:29 am, Collin <[EMAIL PROTECTED]> wrote: a7labnt wrote: Is this arabic spam? Why, are you curious how V1agr@ or [EMAIL PROTECTED] are spelled in arabic ? No, it's just I've never seen something like it. Quite funny, tbh. -- http://mail.python.org/mailman/l

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

2008-06-11 Thread Michele Simionato
On Jun 12, 6:43 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 11 Jun 2008 10:10:14 +0200, Bruno Desthuilliers > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > are some *very* talented and *experimented* programmers here. > > Pardon, but I think you mea

Re: Producer-consumer threading problem

2008-06-11 Thread George Sakkis
On Jun 11, 10:13 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 10 Jun 2008 22:46:37 -0700 (PDT), George Sakkis <[EMAIL PROTECTED]> > wrote: > >On Jun 10, 11:47 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > >> I had a little trouble understanding what exact problem it is that you ar

Re: مقطع فيديو [الولاده القيصر يه] يمنع دخول ضعاف القلوب

2008-06-11 Thread George Sakkis
On Jun 12, 12:29 am, Collin <[EMAIL PROTECTED]> wrote: > a7labnt wrote: > > Is this arabic spam? Why, are you curious how V1agr@ or [EMAIL PROTECTED] are spelled in arabic ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Confusion with weakref, __del__ and threading

2008-06-11 Thread George Sakkis
On Jun 11, 8:37 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 11, 2:15 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 2:01 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > On Jun 11, 10:43 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 1:40 am, Rham

Re: مقطع فيديو [الو لاده القيصريه] يمنع دخول ضعاف القلوب

2008-06-11 Thread Collin
a7labnt wrote: برنامج VMware Workstation 6.0 http://www.antya7la.com/vb/t26858.html#post286993 برنامج يعالج فيروسات auto run و folder option http://www.antya7la.com/vb/t26859.html#post286996 ضع صورتك داخل هذة الساعة http://www.antya7la.com/vb/t26860.html#post286997 زيد سرعة ال Ftp ؟ 64 % +

Re: Simple and safe evaluator

2008-06-11 Thread George Sakkis
On Jun 11, 8:15 pm, bvdp <[EMAIL PROTECTED]> wrote: > Matimus wrote: > > > The solution I posted should work and is safe. It may not seem very > > readable, but it is using Pythons internal parser to parse the passed > > in string into an abstract symbol tree (rather than code). Normally > > Pytho

How to set directory in save as combo box

2008-06-11 Thread gopal mishra
Hi, In 'save as' dialog of window application, I am trying to set the path in 'save in' combo box using python win32 programming. How we can set the directory in the 'save in' combo box. Thanks, Gopal -- http://mail.python.org/mailman/listinfo/python-list

Re: catastrophic regexp, help!

2008-06-11 Thread cirfu
On 11 Juni, 10:25, Chris <[EMAIL PROTECTED]> wrote: > On Jun 11, 6:20 am, cirfu <[EMAIL PROTECTED]> wrote: > > > 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 sent

Re: 有中国人乎?

2008-06-11 Thread pirata.w
On 2008-04-13, Penny Y. <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] 写道: >> Python这种语言有前途吗?在下想学他一学. 个人感觉是很不错的语言 > > hehe, so humorous you are! > Yes I think python has good future. > But it depends on what you use it to do. > If you're a sin

Re: catastrophic regexp, help!

2008-06-11 Thread cirfu
On 11 Juni, 17:04, TheSaint <[EMAIL PROTECTED]> wrote: > On 12:20, mercoledì 11 giugno 2008 cirfu wrote: > > > patzln = re.compile("(\w* *)* zlatan ibrahimovic (\w* *)*") > > I think that I shouldn't put anything around the phrase you want to find. > > patzln = re.compile(r'.*(zlatan ibrahimovic){1

matplotlib question

2008-06-11 Thread asdf
basically I need to plot a graph of data vs time. However when i use matplotlib the hr:min tick marks come out very close together and appear jumbled. So 12:00 comes out very close to 12:30 for example. There are two things I would like to do. First, is to increase the horizontal dimension of the g

Re: Confusion with weakref, __del__ and threading

2008-06-11 Thread Rhamphoryncus
On Jun 11, 2:15 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 11, 2:01 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 10:43 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > On Jun 11, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > The trick here is that cal

Re: Simple and safe evaluator

2008-06-11 Thread Paul McGuire
On Jun 11, 3:25 pm, bvdp <[EMAIL PROTECTED]> wrote: > Is there a simple/safe expression evaluator I can use in a python > program. I just want to pass along a string in the form "1 + 44 / 3" or > perhaps "1 + (-4.3*5)" and get a numeric result. > > I can do this with eval() but I really don't want

Re: Brand New!

2008-06-11 Thread agent E 10
On Apr 18, 12:47 pm, Nick Stinemates <[EMAIL PROTECTED]> wrote: > On Wed, Apr 16, 2008 at 07:48:37AM +0200, Paul Scott wrote: > > > On Wed, 2008-04-16 at 02:35 -0300, Gabriel Genellina wrote: > > > I'm unsure if teaching Javascript, VBScript and Python at the same time > > > is   > > > a good thin

Re: Simple and safe evaluator

2008-06-11 Thread bvdp
Matimus wrote: The solution I posted should work and is safe. It may not seem very readable, but it is using Pythons internal parser to parse the passed in string into an abstract symbol tree (rather than code). Normally Python would just use the ast internally to create code. Instead I've writ

Re: How to make py2.5 distutil to use VC2005?

2008-06-11 Thread lotrpy
On 6月4日, 下午9时47分, "David Cournapeau" <[EMAIL PROTECTED]> wrote: > On Wed, Jun 4, 2008 at 11:38 AM, 甜瓜 <[EMAIL PROTECTED]> wrote: > >Well, IMO, the format of binary files generated by VC2003 and > > VC2005 is compatible in most cases. > > Problem arise with the C runtime, not with object file fo

Re: Simple and safe evaluator

2008-06-11 Thread Matimus
On Jun 11, 4:38 pm, bvdp <[EMAIL PROTECTED]> wrote: > I'm finding my quest for a safe eval() quite frustrating :) > > Any comments on this: Just forget about getting python to do this and, > instead, grab my set of values (from a user supplied text file) and call > an external program like 'bc' to

Re: Simple and safe evaluator

2008-06-11 Thread bvdp
I'm finding my quest for a safe eval() quite frustrating :) Any comments on this: Just forget about getting python to do this and, instead, grab my set of values (from a user supplied text file) and call an external program like 'bc' to do the dirty work. I think that this would avoid someone

Re: how to indent/dedent a region in emacs?

2008-06-11 Thread Grant Edwards
On 2008-06-11, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> writes: > >> I've recently switched from Jed to Emacs for editing python >> source, and I'm still stumped as to how one indents or dedents >> a region of code. In Jed it's 'C-c <' or 'C-c >'. Google h

Re: Programming question

2008-06-11 Thread Terry Reedy
"Brad Navarro" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Basically, what I am trying to do is get a list of each file's attributes within a directory. Basically, the information that the 'ls -l' command would give you in a linux shell, except the results for each file in the dir

Re: how to indent/dedent a region in emacs?

2008-06-11 Thread Alexander Schmolck
Grant Edwards <[EMAIL PROTECTED]> writes: > I've recently switched from Jed to Emacs for editing python > source, and I'm still stumped as to how one indents or dedents > a region of code. In Jed it's 'C-c <' or 'C-c >'. Google has > found several answers, but none of them work, for example I've

Re: how to indent/dedent a region in emacs?

2008-06-11 Thread Grant Edwards
On 2008-06-11, Grant Edwards <[EMAIL PROTECTED]> wrote: > I've recently switched from Jed to Emacs for editing python > source, and I'm still stumped as to how one indents or dedents > a region of code. In Jed it's 'C-c <' or 'C-c >'. Google has > found several answers, but none of them work, fo

Re: web2py forum or mailing list?

2008-06-11 Thread cirfu
web2py > django mailing list: http://groups.google.com/group/web2py -- http://mail.python.org/mailman/listinfo/python-list

how to indent/dedent a region in emacs?

2008-06-11 Thread Grant Edwards
I've recently switched from Jed to Emacs for editing python source, and I'm still stumped as to how one indents or dedents a region of code. In Jed it's 'C-c <' or 'C-c >'. Google has found several answers, but none of them work, for example I've tried bot "C-c tab" and "C-c C-r" based on posting

Re: Programming question

2008-06-11 Thread Python Nutter
2008/6/12 Brad Navarro <[EMAIL PROTECTED]>: > Basically, what I am trying to do is get a list of each file's attributes > within a directory. Basically, the information that the 'ls –l' command Python For System Administrators: http://www.ibm.com/developerworks/aix/library/au-python/ handy to a

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

2008-06-11 Thread Paul Boddie
On 11 Jun, 21:28, "Russ P." <[EMAIL PROTECTED]> wrote: > > All I did was to suggest that a keyword be added to Python to > designate private data and methods without cluttering my cherished > code with those ugly leading underscores all over the place. I don't > like that clutter any more than I li

Re: Strange bug doesn't occur in Pydb

2008-06-11 Thread Diez B. Roggisch
kj schrieb: I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb. Here's an example: import sys, cjson d1 = {'a': 1, 'b': 2, 'c': 3} print sys.version j1 = cjson.encode(d1) print j1 # should print the

Re: basic code of what I am doing [was problems with opening files due to file's path]

2008-06-11 Thread Ethan Furman
Alexnb wrote: > Haha, okay well sorry that I was being so stupid, but I get it now and > I apoligize for causing you all the frustration. But I did get it to > work finally. > -- http://mail.python.org/mailman/listinfo/python-list

Re: Numpy array to gzip file

2008-06-11 Thread Robert Kern
Sean Davis wrote: I have a set of numpy arrays which I would like to save to a gzip file. Here is an example without gzip: b=numpy.ones(100,dtype=numpy.uint8) a=numpy.zeros(100,dtype=numpy.uint8) fd = file('test.dat','wb') a.tofile(fd) b.tofile(fd) fd.close() This works fine. However,

Re: Simple and safe evaluator

2008-06-11 Thread bvdp
Simon Forman wrote: On Jun 11, 1:25 pm, bvdp <[EMAIL PROTECTED]> wrote: Is there a simple/safe expression evaluator I can use in a python program. I just want to pass along a string in the form "1 + 44 / 3" or perhaps "1 + (-4.3*5)" and get a numeric result. I can do this with eval() but I real

Re: Simple and safe evaluator

2008-06-11 Thread bvdp
Matimus wrote: On Jun 11, 1:25 pm, bvdp <[EMAIL PROTECTED]> wrote: Is there a simple/safe expression evaluator I can use in a python program. I just want to pass along a string in the form "1 + 44 / 3" or perhaps "1 + (-4.3*5)" and get a numeric result. I can do this with eval() but I really do

Strange bug doesn't occur in Pydb

2008-06-11 Thread kj
I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb. Here's an example: import sys, cjson d1 = {'a': 1, 'b': 2, 'c': 3} print sys.version j1 = cjson.encode(d1) print j1 # should print the string '{"a

Re: Simple and safe evaluator

2008-06-11 Thread Matimus
On Jun 11, 1:25 pm, bvdp <[EMAIL PROTECTED]> wrote: > Is there a simple/safe expression evaluator I can use in a python > program. I just want to pass along a string in the form "1 + 44 / 3" or > perhaps "1 + (-4.3*5)" and get a numeric result. > > I can do this with eval() but I really don't want

Re: Numpy array to gzip file

2008-06-11 Thread Sean Davis
On Jun 11, 12:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jun 11, 9:17 am, Sean Davis <[EMAIL PROTECTED]> wrote: > > > > > I have a set of numpy arrays which I would like to save to a gzip > > file. Here is an example without gzip: > > > b=numpy.ones(100,dtype=numpy.uint8) > > a

Re: basic code of what I am doing

2008-06-11 Thread Duncan Booth
Alexnb <[EMAIL PROTECTED]> wrote: > path = self.e.get() > path = "\"" + path + "\"" > os.startfile(path) Why are you adding spurious quote marks round the filename? os.startfile() will strip them off, but you don't need them. The help for os.startfile() does say though t

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

2008-06-11 Thread Patrick Mullen
On Wed, Jun 11, 2008 at 12:28 PM, Russ P. <[EMAIL PROTECTED]> wrote: > > If Desthuilliers doesn't like my suggestion, then fine. If no other > Python programmer in the world likes it, then so be it. But do we > really need to get personal about it? Python will not be ruined if it > gets such a key

Re: Simple and safe evaluator

2008-06-11 Thread Simon Forman
On Jun 11, 1:25 pm, bvdp <[EMAIL PROTECTED]> wrote: > Is there a simple/safe expression evaluator I can use in a python > program. I just want to pass along a string in the form "1 + 44 / 3" or > perhaps "1 + (-4.3*5)" and get a numeric result. > > I can do this with eval() but I really don't want

Re: basic code of what I am doing

2008-06-11 Thread Carsten Haese
Alexnb wrote: Okay, so I wrote some code of basically what I will be doing, only with exactly what I need for this part of the program but here you go: [...] Finally... path = "\"" + path + "\"" That line of code is unnecessary. Delete it. -- Carsten Haese http://informixdb.sourcef

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

2008-06-11 Thread Alexnb
Haha, okay well sorry that I was being so stupid, but I get it now and I apoligize for causing you all the frustration. But I did get it to work finally. Carsten Haese-2 wrote: > > Alexnb wrote: >> I don't get why yall are being so rude about this. > > We're frustrated with your apparent inab

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

2008-06-11 Thread Alexnb
Well, I don't understand why I don't need to change anything because say I run that code, which goes straight from the entry box to the startfile() function. It doesn't work with some of the paths, that is the whole problem. the problem is when I enter a path with those certain characters next to

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

2008-06-11 Thread Carsten Haese
Alexnb wrote: I don't get why yall are being so rude about this. We're frustrated with your apparent inability to understand anything we're saying. My problem is this; the path, as a variable conflicts with other characters in the path, creating escape characters I don't want, so I need a w

Re: Converting a simple python script to a simple windows executable

2008-06-11 Thread geoffbache
On Jun 11, 9:49 pm, jay graves <[EMAIL PROTECTED]> wrote: > On Jun 11, 2:25 pm, geoffbache <[EMAIL PROTECTED]> wrote: > > > Anyone have any better ideas? > > How about ExeMaker? > > http://effbot.org/zone/exemaker.htm > > I have not used it but it seems to do what you want. > > ... > Jay Thanks, t

Re: My fight with classes :)

2008-06-11 Thread Terry Reedy
"TheSaint" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | I'm very new with classes. I still reading something around ;) | | I got started to try a concatenation of 2 type of string, which have a | particular property to start with A or D. | | My class here: |""" Small cl

Re: How to kill a thread?

2008-06-11 Thread Fuzzyman
On Jun 11, 8:41 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 11, 1:17 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 6:49 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On Jun 11, 7:56 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > On Jun 11, 6:56 am, Rhamphoryncus <[EMA

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

2008-06-11 Thread Jerry Hill
On Wed, Jun 11, 2008 at 4:16 PM, Alexnb <[EMAIL PROTECTED]> wrote: > > I posted the underlying code, but I haven't made the GUI code because if I > can't get the underlying code right it doesn't matter, well in my eyes it > doesn't but I am probably wrong. But it will look somehting like this: Wha

Python as a Testing Language - TTCN-3 Comparison

2008-06-11 Thread Saravanan Shanmugham (sarvi)
Hi, Is there any work being done to make Python better suited for writing test cases for any problem space. I am a huge python fan and one of the things that got me there was the simplicy and elegance its constructs that allow me to do complex programming operations in very few lines wi

Re: Alternative to Decimal type

2008-06-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Frank Millman <[EMAIL PROTECTED]> wrote: > >My approach is based on expressing a decimal number as a combination >of an integer and a scale, where scale means the number of digits to >the right of the decimal point. You should probably use one written by an expert:

basic code of what I am doing

2008-06-11 Thread Alexnb
Okay, so I wrote some code of basically what I will be doing, only with exactly what I need for this part of the program but here you go: [code] from Tkinter import* import os class myApp: def __init__(self, parent): self.parent = parent self.baseContainer = Frame(self.pare

Simple and safe evaluator

2008-06-11 Thread bvdp
Is there a simple/safe expression evaluator I can use in a python program. I just want to pass along a string in the form "1 + 44 / 3" or perhaps "1 + (-4.3*5)" and get a numeric result. I can do this with eval() but I really don't want to subject my users to the problems with that method.

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

2008-06-11 Thread Alexnb
I don't get why yall are being so rude about this. My problem is this; the path, as a variable conflicts with other characters in the path, creating escape characters I don't want, so I need a way to send the string to the os.startfile() in raw, or, with all the backslashes doubled. Thats it, I'll

Re: Confusion with weakref, __del__ and threading

2008-06-11 Thread George Sakkis
On Jun 11, 2:01 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 11, 10:43 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > On Jun 11, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > The trick here is that calling proxy.sleep(0.01) first gets a strong > > > reference to the Mystery

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

2008-06-11 Thread Alexnb
I posted the underlying code, but I haven't made the GUI code because if I can't get the underlying code right it doesn't matter, well in my eyes it doesn't but I am probably wrong. But it will look somehting like this: e = Entry() #when user hits submit) path = e.get() os.startfile(path) this

Re: Does the python library of Google Data API is truly free?

2008-06-11 Thread Terry Reedy
"Kless" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | All that "free service" has a great price Just about everything has a price. The fraudulent 'free' offeres are those that charge fees and what not to collect the 'free vacation' or 'free money' (which never appears) or what

Re: ClassName.attribute vs self.__class__.attribute

2008-06-11 Thread Mike Orr
On Jun 5, 8:40 am, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I had read somewhere that it is preferred to use > self.__class__.attribute over ClassName.attribute to access class (aka > static) attributes. I had done this and it seamed to work, until I > subclassed a class us

Re: Converting a simple python script to a simple windows executable

2008-06-11 Thread jay graves
On Jun 11, 2:25 pm, geoffbache <[EMAIL PROTECTED]> wrote: > Anyone have any better ideas? How about ExeMaker? http://effbot.org/zone/exemaker.htm I have not used it but it seems to do what you want. ... Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: How to kill a thread?

2008-06-11 Thread Rhamphoryncus
On Jun 11, 1:17 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 11, 6:49 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > On Jun 11, 7:56 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > On Jun 11, 6:56 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > I'm not saying it can't be made to work in yo

Re: Producer-consumer threading problem

2008-06-11 Thread Aahz
In article <[EMAIL PROTECTED]>, 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

Re: *** Massive Copyright Violation by the US Government ***

2008-06-11 Thread Ben
On Jun 11, 3:06 pm, [EMAIL PROTECTED] wrote: > Printing dollar is a copyright violation > > > I recently heard that the USA government or the unfederal reserve is > printing dollars. Is this a copyright violation ? > > Is this also a theft ? > >

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

2008-06-11 Thread Russ P.
On Jun 11, 2:36 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > Maybe, but I'd hope that some of those programmers would be at least > able to entertain what Russ has been saying rather than setting > themselves up in an argumentative position where to concede any > limitation in Python might be cons

Converting a simple python script to a simple windows executable

2008-06-11 Thread geoffbache
Hi all, I have a small python script that doesn't depend on anything except the standard interpreter. I would like to convert it to a small .exe file on Windows that can distributed alone without introducing additional dependencies. I need to assume, because of other python scripts, that anyone us

Re: Alternative to Decimal type

2008-06-11 Thread Terry Reedy
"Frank Millman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Thanks to all for the various replies. They have all helped me to | refine my ideas on the subject. These are my latest thoughts. | | Firstly, the Decimal type exists, it clearly works well, it is written | by people mu

Re: How to kill a thread?

2008-06-11 Thread Fuzzyman
On Jun 11, 6:49 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 11, 7:56 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 6:56 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > On Jun 10, 3:41 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Jun 10, 2:03 am, Rhamphoryncus <

Re: Producer-consumer threading problem

2008-06-11 Thread Carl Banks
On Jun 10, 11:33 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > I pasted my current solution athttp://codepad.org/FXF2SWmg. Any > feedback, especially if it has to do with proving or disproving its > correctness, will be appreciated. It seems like you're reinventing the wheel. The Queue class do

*** Massive Copyright Violation by the US Government ***

2008-06-11 Thread lemnitzer
Printing dollar is a copyright violation I recently heard that the USA government or the unfederal reserve is printing dollars. Is this a copyright violation ? Is this also a theft ? Is there a scheme to print dollars in such a way to selectiv

Re: Programming question

2008-06-11 Thread Jeff McNeil
Have a look at os.listdir and os.stat. I've never worked with 1.5, so I don't know what will work with it and what won't,. but I'd imagine the following ought to be fine, though. stat_list = [] for dirent in os.listdir('your_directory'): stat_list.append(os.stat(dirent)) Jeff On Wed, Jun

Programming question

2008-06-11 Thread Brad Navarro
Greetings, Being extremely new to Python, I haven't got the experience to figure this one out on my own and frankly I am not sure I would know where to look. Basically, what I am trying to do is get a list of each file's attributes within a directory. Basically, the information that the 'l

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

2008-06-11 Thread Mike Driscoll
On Jun 11, 12:38 pm, [EMAIL PROTECTED] wrote: > On Jun 10, 8:50 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > 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 th

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

2008-06-11 Thread Grant Edwards
On 2008-06-11, Alexnb <[EMAIL PROTECTED]> wrote: > Okay, so as a response to all of you, I will be using the Entry() widget in > Tkinter to get this path. OK. > and the repr() function just makes all my backslashes 4 > instead of just 1, and it still screwes it up with the numbers > and parenthe

PKG-INFO encoding?

2008-06-11 Thread Daniel Holth
What should the encoding be for PKG-INFO? PEP 241, 301, 314, and 345 do not specify. I notice PKG-INFO must comply with an RFC that predates Unicode, and I notice I get a traceback if I try to put a non-ascii character into my Python 2.4.3 setup.py description. (I eventually decided to just .encod

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

2008-06-11 Thread Thomas Morton
@Mike and the others yesterday I did think after I posted that code (the string substitution thing) that it might do that. Thanks for clarifying that it was rubbish :P @ Alexnb I'm do a lot of support on a community forum that uses Python as it's language - I can tell you from experience tha

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

2008-06-11 Thread Carsten Haese
Alexnb wrote: Okay, so as a response to all of you, I will be using the Entry() widget in Tkinter to get this path. and the repr() function just makes all my backslashes 4 instead of just 1, and it still screwes it up with the numbers and parenthesis is has been since the first post. Oh and I kno

Re: Confusion with weakref, __del__ and threading

2008-06-11 Thread Rhamphoryncus
On Jun 11, 10:43 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 11, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > The trick here is that calling proxy.sleep(0.01) first gets a strong > > reference to the Mystery instance, then holds that strong reference > > until it returns. > > Ah,

Re: Producer-consumer threading problem

2008-06-11 Thread Rhamphoryncus
On Jun 11, 6:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 11, 1:59 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > 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 o

Re: How to kill a thread?

2008-06-11 Thread Rhamphoryncus
On Jun 11, 7:56 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 11, 6:56 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 10, 3:41 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > On Jun 10, 2:03 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > How does that protect code like this? >

Re: question about import

2008-06-11 Thread Diez B. Roggisch
Jonathan Vanasco schrieb: I'm a little unclear about import / __import__ I'm exploring dynamically importing modules for a project, and ran into this behavior works as expected: app = __import__( myapp ) appModel = __import__( myapp.model ) but... appname= 'myapp' app = __impor

Re: [Tutor] python gui

2008-06-11 Thread john
W W wrote: > On Wed, Jun 11, 2008 at 10:18 AM, Gabriela Soares > <[EMAIL PROTECTED]> wrote: > > How ? > > That's an extremely broad question, and shows little initiative, and > offers little information. Most of us are happy to help you solve > problems for free, but few, if any, are willing to wri

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

2008-06-11 Thread chardish
On Jun 10, 8:50 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > 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

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

2008-06-11 Thread Alexnb
Okay, so as a response to all of you, I will be using the Entry() widget in Tkinter to get this path. and the repr() function just makes all my backslashes 4 instead of just 1, and it still screwes it up with the numbers and parenthesis is has been since the first post. Oh and I know all about esc

question about import

2008-06-11 Thread Jonathan Vanasco
I'm a little unclear about import / __import__ I'm exploring dynamically importing modules for a project, and ran into this behavior works as expected: app = __import__( myapp ) appModel = __import__( myapp.model ) but... appname= 'myapp' app = __import__( "%s" % appname ) ap

web2py forum or mailing list?

2008-06-11 Thread cirfu
i cant find a web2py mailing list or forum, not by googling and not on the web2py homepage. (yes thats right im asking about web2py not webpy). this framework seems great and i installed and it seems like all i wished for. easy to install, easy to use, fast, etc. just an overall better, complete

Finding a sense of word in a text

2008-06-11 Thread Sengly
Dear all, This might be off group but I am looking for a python library that can help me to find a sense of a word in a text and eventually a list of synonyms of that term. I searched the web and found one but it is written in perl (http://www.d.umn.edu/~tpederse/senserelate.html) :( I appreciate

Reading info from an active file

2008-06-11 Thread Keith Nation
I have a program that writes a log file as it is running to give status of the job. I would like to read that file, pull certain lines of text from it, and write to a new file. Because I am such a novice user, I was hoping someone had covered this before and could let me know of your methods. If

Re: Confusion with weakref, __del__ and threading

2008-06-11 Thread George Sakkis
On Jun 11, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > 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

Re: Numpy array to gzip file

2008-06-11 Thread [EMAIL PROTECTED]
On Jun 11, 9:17 am, Sean Davis <[EMAIL PROTECTED]> wrote: > I have a set of numpy arrays which I would like to save to a gzip > file. Here is an example without gzip: > > b=numpy.ones(100,dtype=numpy.uint8) > a=numpy.zeros(100,dtype=numpy.uint8) > fd = file('test.dat','wb') > a.tofile(fd)

Reading info from an active file

2008-06-11 Thread Keith Nation
I have a program that writes a log file as it is running to give status of the job. I would like to read that file, pull certain lines of text from it, and write to a new file. Because I am such a novice user, I was hoping someone had covered this before and could let me know of your methods. If

Re: can't assign to literal

2008-06-11 Thread Ethan Furman
TheSaint wrote: On 00:15, giovedì 12 giugno 2008 Ethan Furman wrote: I like Vim (Vi Improved) What about justifying text ? Do you mean indenting, or wrapping? Vim has excellent indenting support, and Python files already included that support proper indenting, syntax coloring, etc. I

Re: Alternative to Decimal type

2008-06-11 Thread Nick Craig-Wood
Frank Millman <[EMAIL PROTECTED]> wrote: > Thanks to all for the various replies. They have all helped me to > refine my ideas on the subject. These are my latest thoughts. > > Firstly, the Decimal type exists, it clearly works well, it is written > by people much cleverer than me, so I would

Re: Advice for a python newbie on parsing whois records?

2008-06-11 Thread Phillip B Oldham
On Jun 10, 8:21 pm, Miki <[EMAIL PROTECTED]> wrote: > Hello, > > > Hi. I'm stretching my boundaries in programming with a little python > > shell-script which is going to loop through a list of domain names, > > grab the whois record, parse it, and put the results into a csv. > > > I've got the res

Re: How to kill a thread?

2008-06-11 Thread Ian Bicking
On Jun 7, 6:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Here is an attempt at a killable thread > >  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496960 > > and > >  http://sebulba.wikispaces.com/recipe+thread2 I use this recipe in paste.httpserver to kill wedged threads, and it

Re: How to find duplicate 3d points?

2008-06-11 Thread Gary Herron
[EMAIL PROTECTED] wrote: I have a large data file of upto 1 million x,y,z coordinates of points. I want to identify which points are within 0.01 mm from each other. I can compare the distance from each point to every other point , but this takes 1 million * 1 million operations, or forever! Any

Re: How to find duplicate 3d points?

2008-06-11 Thread Tim Henderson
On Jun 11, 11:35 am, [EMAIL PROTECTED] wrote: > I have a large data file of upto 1 million x,y,z coordinates of > points. I want to identify which points are within 0.01 mm from each > other. I can compare the distance from each point to every other > point , but this takes 1 million * 1 million op

Re: [Tutor] python gui

2008-06-11 Thread Gabriela Soares
Hello, With all respect, I posed the question as a noob who has NO ideia how to solve the problem at hand. All I asked for were some references, such as known applications that use such technology to guide me to where I should focus. It never crossed my mind to ask for code. If I wanted to do so,

  1   2   >