ANN: ConfigObj 4.6.0 and Validate 1.0.0 released

2009-04-18 Thread Fuzzyman
Finally a fresh release ConfigObj and Validate. * ConfigObj Home page: http://www.voidspace.org.uk/python/configobj.html * Validate Home page: http://www.voidspace.org.uk/python/validate.html **ConfigObj** is a simple to use but powerful Python library for the reading and writing of

Re: Domain Driven Design and Python

2009-04-18 Thread Terry Reedy
José María wrote: DDD is more or less a methodology. I've used it with C# and I like it very much. The objetive of DDD is to create software that mirror the domain of the problem, you isolate this domain from the technical problems (persistence, services,GUI). I presume that many Python

Re: question about xrange performance

2009-04-18 Thread bearophileHUGS
Paul McGuire: xrange is not really intended for in testing, Let's add the semantic of a good and fast in to xrange (and to the range of Python3). It hurts no one, allows for a natural idiom (especially when you have a stride you don't want to re-invent the logic of skipping absent numbers), and

Re: Beginner: Portable Python, BeautifulSoup ScrapeNFeed

2009-04-18 Thread Brian
Was this code a complete waste of my time? On Wed, Apr 15, 2009 at 1:09 AM, Brian brian.min...@colorado.edu wrote: On Ubuntu: sudo apt-get install python-pyrss2gen python-beautifulsoup # download ScrapeNFeed Python: Not sure what's wrong with this but it's most of the code you'll need:

Re: Question to python C API

2009-04-18 Thread Stefan Behnel
Andreas Otto wrote: just my first step in Cython 1. download Cython-0.11.1 2. read INSTALL.txt (1) Run the setup.py script in this directory as follows: python setup.py install This will install the Pyrex package into your Python system.

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Steven D'Aprano
On Fri, 17 Apr 2009 22:26:32 -0700, norseman wrote: The average programmer, who takes a moment to think it out, A moment? As in, a second or less? can out optimize all but the best commercial compilers. The meticulous individual can usually match or best the best commercials with fewer

Re: Suggestions wanted on Tkinter problem

2009-04-18 Thread Steven D'Aprano
On Thu, 16 Apr 2009 16:18:03 -0700, norseman wrote: At this point the program runs, but I cannot control gray-out of a specific Radiobutton. If I: counter=0 for mode, text c[counter] = Radiobuton(specified_frame,..

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Steven D'Aprano
On Fri, 17 Apr 2009 20:45:30 -0700, Mensanator wrote: Nevertheless, somebody *has* implemented such functionality in Python. Not just GOTO, but also COMEFROM. Really? Well, _I_ for one, won't be beating a path to his door. Well you should. It's very clever code, and the way he solved the

Re: script question

2009-04-18 Thread Peter Otten
pyt...@bdurham.com wrote: Peter, Another eval-free variant: [x() for x in vars().values() if hasattr(x, _included)] If you use getattr(x, _included, False) instead of hasattr() you can un-include functions with ... YES! That's what I was struggling to do with my in-elegant use of

Re: Registering Cron using CronTab

2009-04-18 Thread gurcharan . saini
On Apr 18, 5:21 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.4054.1239976986.11746.python-l...@python.org, Philip Semanchuk wrote: On Apr 17, 2009, at 9:51 AM,gurcharan.sa...@gmail.com wrote: I'm stuck with the issue - if we execute the code from

Re: binary file compare...

2009-04-18 Thread Piet van Oostrum
Adam Olsen rha...@gmail.com (AO) wrote: AO The Wayback Machine has 150 billion pages, so 2**37. Google's index AO is a bit larger at over a trillion pages, so 2**40. A little closer AO than I'd like, but that's still 56294995000 to 1 odds of having AO *any* collisions between *any* of the

Re: Question to python C API

2009-04-18 Thread Wolfgang Strobl
Andreas Otto aotto1...@onlinehome.de wrote about his attempts to install and run Cython: 5. and start to build the hello world example I changed: print Hello World to: print(Hello World)- this is V3 AFAIK Cython doesn't support Python 3, yet. See

Re: Play sound at wanted frequency

2009-04-18 Thread Matteo
On 15 Apr, 19:25, Scott David Daniels scott.dani...@acm.org wrote: Diez B. Roggisch wrote: Matteo schrieb: I need to playback a sound on a linux machine of a pre-determined frequency like, say, 440 Hz. How can I do that with python? I found the ossaudiodev package, but it says that the

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Piet van Oostrum
stephane.bisin...@gmail.com (SB) wrote: SB Hi all, SB I have a problem with Condition.wait(), it doesn't return after the SB given timeout. The thing is that if I try to create a simple program, SB it works as expected, but in the actual code, the timeout is not SB respected (albeit the

Re: Is there a programming language that is combination of Python andBasic?

2009-04-18 Thread Hendrik van Rooyen
baykus b..@gmail.com wrote: I guess I did not articulate myself well enough. I was just looking for a toy to play around. I never suggested that Python+Basic would be better than Python and everyone should use it. Python is Python and Basic is Basic. I am not comparing them at all. I

Re: send() to a generator in a for loop with continue(val)??

2009-04-18 Thread Peter Otten
Dale Roberts wrote: I've started using generators for some real work (love them!), and I need to use send() to send values back into the yield inside the generator. When I want to use the generator, though, I have to essentially duplicate the machinery of a for loop, because the for loop

pyqt4 qTableWidget add items help

2009-04-18 Thread ookrin
I've been searching around the internet for an example of how to add a list of items to the qTableWidget for the last few hours with little success. I have a list orders [[34,940,30,50,67], [50,56,35,30,57]] as my example here I built the qTableWidget in designer, so it already has the header

Re: pyqt4 qTableWidget add items help

2009-04-18 Thread Diez B. Roggisch
ookrin schrieb: I've been searching around the internet for an example of how to add a list of items to the qTableWidget for the last few hours with little success. I have a list orders [[34,940,30,50,67], [50,56,35,30,57]] as my example here I built the qTableWidget in designer, so it already

Re: pyqt4 qTableWidget add items help

2009-04-18 Thread Sebastian Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ookrin – Samstag, 18. April 2009 11:58 [...] I've been trying while(len(orders) i): ui.tb1_tblOrders.setCurrentCell(i,0,orders[i][1]) i+=1 which to me, says go add in the first column row with the first order,

Re: Is there a programming language that is combination of Python andBasic?

2009-04-18 Thread Aaron Brady
On Apr 18, 4:44 am, Hendrik van Rooyen m...@microcorp.co.za wrote: baykus b..@gmail.com wrote: I guess I did not articulate myself well enough. I was just looking for a toy to play around. I never suggested that Python+Basic would be better than Python and everyone should use it. Python

Re: question about xrange performance

2009-04-18 Thread mmanns
On Fri, 17 Apr 2009 23:40:32 -0700 (PDT) bearophileh...@lycos.com wrote: Paul McGuire: xrange is not really intended for in testing, Let's add the semantic of a good and fast in to xrange (and to the range of Python3). It hurts no one, allows for a natural idiom (especially when you have

Re: Modifying the value of a float-like object

2009-04-18 Thread Eric . Le . Bigot
On Apr 15, 5:33 pm, Arnaud Delobelle arno...@googlemail.com wrote: I still don't think mutable floats are necessary.  Here is an approach below - I'll let the code speak because I have to do some shopping! Hats off to you, Arnaud! I'm very impressed by the ideas found in your code. :) Your

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread greg
Steven D'Aprano wrote: To paraphrase Charles Fiterman, the human should always win, because the human can use the machine, but the machine can't use the human. Unless the machine is Omnius. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread BJörn Lindqvist
I first started programming basic and i don't think it has hurt me much. I can somewhat sympathise with the op, neither python nor any other mainstream language can still do this: SCREEN 13 PSET 160,100,255 2009/4/17, Leguia, Tony legui...@grinnell.edu: Though I don't know why you would want

Too early implementation

2009-04-18 Thread Filip Gruszczyński
I am not a very disciplined person. Usually I rush to my next assignment and code furiously, hoping that my initial understanding of the stated problem will be just fine. And Python does very little to stop me ;-) If I had to do something in C++, I know I would have to write all those header

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread stephane . bisinger
On Apr 18, 10:24 am, Piet van Oostrum p...@cs.uu.nl wrote: I haven't run it (too much hassle to setup) but I noticed one strange thing in your code: , | def groupUpdated(self, gView): |         # Acquire the lock to do modifications |         self._mod_lock.acquire() |   |         if

Re: Too early implementation

2009-04-18 Thread Tim Chase
Filip Gruszczyński wrote: I am not a very disciplined person. Usually I rush to my next assignment and code furiously, hoping that my initial understanding of the stated problem will be just fine. And Python does very little to stop me ;-) If I had to do something in C++, I know I would have to

any complete and actual pysqlite example?

2009-04-18 Thread oyster
I mean not a code to do seperated functions, but a real project I have read the doc of pysqlite, but since I know little about database, I found it is still very hard for me to cook a real database app from the scratch with the help of codelet in pysqlite doc. here is the simplified details:

Re: can't install new modules after updating python

2009-04-18 Thread Aahz
In article f2a25d72-5e21-498a-95a4-59045f158...@r37g2000yqn.googlegroups.com, lie liewai...@gmail.com wrote: I've updated from python 2.5 to 2.6 on my Slackware 12.2, by compiling the 2.6 source. When I try to use slapt-get to install a new module for python, it installs in the old version, and

Re: send() to a generator in a for loop with continue(val)??

2009-04-18 Thread Aahz
In article gsc7e1$rj6$0...@news.t-online.com, Peter Otten __pete...@web.de wrote: If it were up to me I'd rip out send() immediatly. At first I thought I would see a compelling use case and be enlightened, but it never happened. Too late -- it's likely to get an upgrade for 3.1 and 2.7.

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Aahz
In article 1eb44e98-3f32-42b3-92f8-1e635428c...@q9g2000yqc.googlegroups.com, stephane.bisin...@gmail.com wrote: I have a problem with Condition.wait(), it doesn't return after the given timeout. The thing is that if I try to create a simple program, it works as expected, but in the actual code,

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread stephane . bisinger
On Apr 18, 2:05 pm, a...@pythoncraft.com (Aahz) wrote: Whether or not there's a bug, you likely will simplify your code if you switch to using a Queue(). I'm sorry, but I can't see how the queue would help me on this, since I only have 2 threads and the documentation esplicitly states that it

Re: question about xrange performance

2009-04-18 Thread ~flow
[soapbox] Speaking about idiomacy, ... [end soapbox] soapbox] I ALREADY STEPPED DOWN FROM SOAPBOX (on this topic) [end soapbox] thanks for the comment anyhow. that an efficient `x in y` implementation used to be there and is gone now is gross. guess i'll just have to live with my own

Re: send() to a generator in a for loop with continue(val)??

2009-04-18 Thread Michele Simionato
On Apr 18, 3:03 pm, a...@pythoncraft.com (Aahz) wrote: In article gsc7e1$rj6$0...@news.t-online.com, Peter Otten  __pete...@web.de wrote: If it were up to me I'd rip out send() immediatly. At first I thought I would see a compelling use case and be enlightened, but it never happened. Too

Re: Too early implementation

2009-04-18 Thread alex23
On Apr 18, 9:48 pm, Filip Gruszczyński grusz...@gmail.com wrote: With Python you rarely are sorry, because you can do everything so quickly. And yet, at some point you see, that flaws in design get so annoying, that you need to do something about them. Usually at that point it's a bit

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Stef Mientki
BJörn Lindqvist wrote: I first started programming basic and i don't think it has hurt me much. I can somewhat sympathise with the op, neither python nor any other mainstream language can still do this: SCREEN 13 PSET 160,100,255 Maybe, who is able to understand such nosense without a lot

Re: Too early implementation

2009-04-18 Thread stephane . bisinger
On Apr 18, 12:48 pm, Filip Gruszczyński grusz...@gmail.com wrote: So, do you know some good methods to prevent myself from just starting coding (which I like very much) and do some thinking about the problem (which I like a little less ;-))? Well you know, the thing is that according to Pike

Re: Your confirmation is required to join the Python-list mailing list

2009-04-18 Thread Mads Nielsen
Hello. i was wondering if there would be someone on the list that know of or have ideas for a beginner python project ? i have made a simple calculator Program with a if else loop. and such. but i need a new project. i know xml. html. css. and a bit JavaScript. so it can incorporate any or all

Re: can't install new modules after updating python

2009-04-18 Thread John
On Apr 18, 9:00 am, a...@pythoncraft.com (Aahz) wrote: In article f2a25d72-5e21-498a-95a4-59045f158...@r37g2000yqn.googlegroups.com, Generally speaking, you should never directly update the system Python; most Linux systems these days rely on Python for their operation. Instead, you install

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread MRAB
Steven D'Aprano wrote: On Fri, 17 Apr 2009 14:00:18 -0700, Mensanator wrote: On Apr 17, 3:37 pm, baykus baykusde...@gmail.com wrote: Hi I am looking for one of those experimental languages that might be combination of python+basic. Now thta sounds weird and awkward I know. That's a clue you

Re: class variables and class methods

2009-04-18 Thread Aahz
In article 9c848013-2245-455e-bb30-48e430d56...@j9g2000prh.googlegroups.com, krishnaposti...@gmail.com wrote: I have a class whose job is to serve several other objects, [...] Sorry, I'm finding it difficult to understand what you want. It looks to me that you're confusing object and

Re: send() to a generator in a for loop with continue(val)??

2009-04-18 Thread Aahz
In article 07ad771b-a6d1-4f08-b16c-07caf7462...@e18g2000yqo.googlegroups.com, Michele Simionato michele.simion...@gmail.com wrote: On Apr 18, 3:03=A0pm, a...@pythoncraft.com (Aahz) wrote: In article gsc7e1$rj6$0...@news.t-online.com, Peter Otten =A0__pete...@web.de wrote: If it were up to me

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Aahz
In article 8373c927-5ef2-4511-a439-25caa3fd6...@v15g2000yqn.googlegroups.com, stephane.bisin...@gmail.com wrote: On Apr 18, 2:05=A0pm, a...@pythoncraft.com (Aahz) wrote: Whether or not there's a bug, you likely will simplify your code if you switch to using a Queue(). I'm sorry, but I can't

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread stephane . bisinger
On Apr 18, 4:28 pm, a...@pythoncraft.com (Aahz) wrote: Essentially, you use the Queue instead of the Condition.  When you want to explicitly give up control in a thread, you get() on the Queue until you get an object (with the optional timeout).  When the other thread is done processing, it

Re: Too early implementation

2009-04-18 Thread Aahz
In article f317e00e-042c-4894-83dc-bdd83fbbe...@y7g2000yqa.googlegroups.com, stephane.bisin...@gmail.com wrote: Well you know, the thing is that according to Pike Kernighan in The Practice of Programming, your first implementation of a program should be scrapped and rewritten from scratch, so

Re: Too early implementation

2009-04-18 Thread stephane . bisinger
On Apr 18, 4:44 pm, a...@pythoncraft.com (Aahz) wrote: This observation was originally made in _The Mythical Man-Month_ by Fred Brooks, which ought to be required reading for all programmers. I miss that one, yet :( Nice to know, though -- http://mail.python.org/mailman/listinfo/python-list

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Aahz
In article 19475d1c-ee83-4466-ba55-b352ea760...@x5g2000yqk.googlegroups.com, stephane.bisin...@gmail.com wrote: On Apr 18, 4:28=A0pm, a...@pythoncraft.com (Aahz) wrote: Essentially, you use the Queue instead of the Condition. =A0When you want to explicitly give up control in a thread, you

Re: [OT] large db question about no joins

2009-04-18 Thread Martin P. Hellwig
Daniel Fetchinson wrote: cut Thanks, this wikipedia entry was actually very useful as well as your other comments. Thanks again, Daniel Your welcome, I usually take quite a lot of effort into designing before I start coding. One tool I found very helpful was DIA, especially the UML

Re: need to start a new project , can python do all that ?

2009-04-18 Thread Tim Rowe
2009/4/17 Hyuga hyugaricd...@gmail.com: I'm not too assured... What are the actual requirements for this software?  Is this intended for real world use in health care?  I'm not too comfortable with a single individual with apparently limited experience in Python developing something like

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Steven D'Aprano
On Sat, 18 Apr 2009 13:39:23 +0200, BJörn Lindqvist wrote: I first started programming basic and i don't think it has hurt me much. I can somewhat sympathise with the op, neither python nor any other mainstream language can still do this: SCREEN 13 PSET 160,100,255 Maybe, maybe not.

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread D'Arcy J.M. Cain
On 18 Apr 2009 16:29:30 GMT Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sat, 18 Apr 2009 13:39:23 +0200, BJörn Lindqvist wrote: SCREEN 13 PSET 160,100,255 Maybe, maybe not. What on earth does it do? It makes people scratch their heads and wonder what the hell it does.

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Rowe
2009/4/18 norseman norse...@hughes.net: ...only within the current procedure.   That was one of the why Pascal didn't hang on as long as it might have. Really? I thought it was because of the lack of support for packaging, which was solved in different ways by Object Pascal/Delphi and by

Re: question about xrange performance

2009-04-18 Thread Steven D'Aprano
On Sat, 18 Apr 2009 13:05:34 +0200, mmanns wrote: On Fri, 17 Apr 2009 23:40:32 -0700 (PDT) bearophileh...@lycos.com wrote: Paul McGuire: xrange is not really intended for in testing, Let's add the semantic of a good and fast in to xrange (and to the range of Python3). It hurts no one,

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Aahz
In article mailman.4112.1240072722.11746.python-l...@python.org, Tim Rowe digi...@gmail.com wrote: Really? I thought it was because of the lack of support for packaging, which was solved in different ways by Object Pascal/Delphi and by Modula 2, the latter of which in turn became Ada, which is

Re: Too early implementation

2009-04-18 Thread Filip Gruszczyński
Yep, I have heard a lot about test driven development. I am now programming a lot using DJango and I would like to use its test framework to try it. However, I have little experience with this (as most people I know). I also have no idea, how to apply this, when I write code heavily focused on

[no subject]

2009-04-18 Thread karlos barlos
i have the following code :    elif choice == 3:     print all users list :     print\n     import active_directory     for user in active_directory.search (objectCategory='Person', objectClass='User'): print user     i want to write  the output of the code (

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Chase
SCREEN 13 PSET 160,100,255 Maybe, maybe not. What on earth does it do? I believe this attempts to set screen-mode 13 (I'm surprised this isn't a hex constant, though that may be a (Q)Basic quirk), which for older VGA cards was 320x200 with 256-colors. It then looks like it sets a point at

Re:

2009-04-18 Thread Joe Riopel
On Sat, Apr 18, 2009 at 12:56 PM, karlos barlos karlosbar...@yahoo.com wrote: LDAP://CN=bessy,OU=sales,DC=shay,DC=com LDAP://CN=ron,OU=legal,DC=shay,DC=com to a text \  csv file ... can any one help ?? Have a look at this:

Re: Too early implementation

2009-04-18 Thread stephane . bisinger
On Apr 18, 5:54 pm, Filip Gruszczyński grusz...@gmail.com wrote: Yep, I have heard a lot about test driven development. I am now programming a lot using DJango and I would like to use its test framework to try it. However, I have little experience with this (as most people I know). I also have

Re: Lambda alternative?

2009-04-18 Thread Hrvoje Niksic
Duncan Booth duncan.bo...@invalid.invalid writes: import cPickle as p p.dumps([]) '(l.' p.dumps([].append) Traceback (most recent call last): File stdin, line 1, in module TypeError: expected string or Unicode object, NoneType found Not the best of examples: [].append is a built-in

Re: Too early implementation

2009-04-18 Thread Patrick Mullen
2009/4/18 Filip Gruszczyński grusz...@gmail.com: Yep, I have heard a lot about test driven development. I am now programming a lot using DJango and I would like to use its test framework to try it. However, I have little experience with this (as most people I know). I also have no idea, how to

Re: Too early implementation

2009-04-18 Thread Kay Schluehr
Start to like blogging about your ideas, results and findings. Writing is a process of clarification of the mind. It doesn't matter much whether you design upfront, or mix coding and writing in an incremental process. If I could I'd just write specs, draft my ideas in Python in order to verify

__getattribute__ for operators

2009-04-18 Thread Michael
While thinking about Steven D'Aprano's thread about automatically generating arithmetic operations for a subclass, I stumbled upon something confusing. Having defined the following class to do funky addition, class MyInt(int): def __getattribute__(self, key): if key == __add__:

Re: after_cancel?

2009-04-18 Thread Saul Spatz
W. eWatson wrote: I'm looking a program that I'm not real familiar with that uses an after_cancel method and after_id variable. Are they related to some particular widget and what is there function? Perhaps they are related to a Cancel button on a widget?

Re:

2009-04-18 Thread karlos barlos
--- On Sat, 4/18/09, Joe Riopel goo...@gmail.com wrote: From: Joe Riopel goo...@gmail.com Subject: Re: To: karlos barlos karlosbar...@yahoo.com Cc: python-list@python.org Date: Saturday, April 18, 2009, 12:01 PM On Sat, Apr 18, 2009 at 12:56 PM, karlos barlos karlosbar...@yahoo.com wrote:

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Piet van Oostrum
Gabriel Genellina gagsl-...@yahoo.com.ar (GG) wrote: GG If another thread has acquired the lock, cond.wait() doesn't return. Add GG these lines at the end of your test and see: GG sleep(2) GG print Main thread - cond.acquire() GG cond.acquire() GG sleep(2) GG print Main thread - cond.release()

Re: pyqt4 qTableWidget add items help

2009-04-18 Thread ookrin
On Apr 18, 3:46 am, Sebastian Wiesner basti.wies...@gmx.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ookrin – Samstag, 18. April 2009 11:58 [...] I've been trying         while(len(orders) i):             ui.tb1_tblOrders.setCurrentCell(i,0,orders[i][1])             i+=1

Re: any complete and actual pysqlite example?

2009-04-18 Thread Philip Semanchuk
On Apr 18, 2009, at 8:59 AM, oyster wrote: I mean not a code to do seperated functions, but a real project I have read the doc of pysqlite, but since I know little about database, I found it is still very hard for me to cook a real database app from the scratch with the help of codelet in

Re: Is there a programming language that is combination of Python andBasic?

2009-04-18 Thread Brian Blais
On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote: baykus b..@gmail.com wrote: I guess I did not articulate myself well enough. I was just looking for a toy to play around. I never suggested that Python+Basic would be better than Python and everyone should use it. Python is Python

Re: Is there a programming language that is combination of Python andBasic?

2009-04-18 Thread Mensanator
On Apr 18, 4:44 am, Hendrik van Rooyen m...@microcorp.co.za wrote: baykus b..@gmail.com wrote: I guess I did not articulate myself well enough. I was just looking for a toy to play around. I never suggested that Python+Basic would be better than Python and everyone should use it. Python

I'm sort of mystified by the print hex to char conversion

2009-04-18 Thread grocery_stocker
I'm just really not seeing how something like x63 and/or x61 gets converted by 'print' to the corresponding chars in the following output... [cdal...@localhost oakland]$ python Python 2.4.3 (#1, Oct 1 2006, 18:00:19) [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 Type help, copyright, credits

Please help with problem creating class

2009-04-18 Thread auzarski2008
Hi I have been working on a homework assignment that I am having a lot of trouble with. I am so frustrated because every time I think I am getting close to figuring it out there is another problem. If you could look at this and tell me what I am doing wrong I would very much appreciate it

Re: question about xrange performance

2009-04-18 Thread Arnaud Delobelle
Steven D'Aprano st...@remove-this-cybersource.com.au writes: [...] Speaking about idiomacy, it is grammatically incorrect to start sentences in English with lower-case letters [...] [...] x.0 floats working with xrange is an accident, not a deliberate design decision, and has been

python alternatives to C structs??

2009-04-18 Thread KoolD
Hey all, I need to convert a C code to python please help me figure out how to do it. Suppose the C program's like: typedef struct _str { int a; char *b; int c; }str; int main() { str mbr; fd=open(/dev/sda,O_RDONLY); read(fd,mbr,sizeof(str)); }

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Piet van Oostrum
stephane.bisin...@gmail.com (SB) wrote: SB On Apr 18, 10:24 am, Piet van Oostrum p...@cs.uu.nl wrote: I haven't run it (too much hassle to setup) but I noticed one strange thing in your code: , | def groupUpdated(self, gView): |         # Acquire the lock to do modifications |      

Re: Please help with problem creating class

2009-04-18 Thread MRAB
auzarski2...@gmail.com wrote: Hi I have been working on a homework assignment that I am having a lot of trouble with. I am so frustrated because every time I think I am getting close to figuring it out there is another problem. If you could look at this and tell me what I am doing wrong I

Re: Please help with problem creating class

2009-04-18 Thread member thudfoo
On 4/18/09, auzarski2...@gmail.com auzarski2...@gmail.com wrote: Hi I have been working on a homework assignment that I am having a lot of trouble with. I am so frustrated because every time I think I am getting close to figuring it out there is another problem. If you could look at this

Re: Please help with problem creating class

2009-04-18 Thread member thudfoo
Correction: On 4/18/09, member thudfoo thud...@opensuse.us wrote: On 4/18/09, auzarski2...@gmail.com auzarski2...@gmail.com wrote: Hi I have been working on a homework assignment that I am having a lot of trouble with. I am so frustrated because every time I think I am getting close

Re: I'm sort of mystified by the print hex to char conversion

2009-04-18 Thread Wojtek Walczak
On Sat, 18 Apr 2009 11:45:09 -0700 (PDT), grocery_stocker wrote: I'm just really not seeing how something like x63 and/or x61 gets converted by 'print' to the corresponding chars in the following output... ... print \x63h\x61d chad Does print just do this magically? Not only print does

Re: python alternatives to C structs??

2009-04-18 Thread Wojtek Walczak
On Sat, 18 Apr 2009 12:25:29 -0700 (PDT), KoolD wrote: Hi, I need to convert a C code to python please help me figure out how to do it. Suppose the C program's like: ... Is there a way to code it in python. You need struct module: http://docs.python.org/library/struct.html

Re: Please help with problem creating class

2009-04-18 Thread Günther Dietrich
auzarski2...@gmail.com wrote: I am using tab separated data in another file that looks like this... appname1 leadername12005, 02, 022006, 02, 02 appname2 leadername22006, 03, 212007, 06, 28 etc... The error message looks like this back (most recent call last): File

Re: Overriding methods per-object

2009-04-18 Thread Piet van Oostrum
Pavel Panchekha pavpanche...@gmail.com (PP) wrote: The docs don't say you can do that: PP Thanks, hadn't noticed that. Should you be able to? PP I'd say so. In my case, I need a class that can encapsulate any PP object, add a few methods to it, and spit something back that works PP just like

Any adv. in importing a module and some objects in the same module, into the same file?

2009-04-18 Thread Visco Shaun
http://docs.python.org/library/logging.html While going thr' the above link i came across import statements import logging import logging.handlers What is the use of second import as the first import will be enough(AFAIK) to access anything intended by the second import? Is there any kind of

for blackberry?

2009-04-18 Thread Vistro
Is there any good way of getting python to run on a blackberry 8830 world edition? -- -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create an unclosed dialog in wxPython?

2009-04-18 Thread alejandro
Don't press alt+f4? ?? liangguan...@163.com wrote in message news:719e6773-bad0-46ff-9842-a7ade2ced...@f41g2000pra.googlegroups.com... In wxPython, after I create a wx.Frame, I want to create a modeless and unclosed dialog. Here is my step: app = wx.PySimpleApp() f = wx.Frame(None, -1,

Re: polar plots, clockwise, north

2009-04-18 Thread enricong
Thanks, I had tried this earlier but by rotating the data in this fashion, it has problems connecting the endpoints between 0 and 360 and tries to go counter clockwise around. I am then left with an extra circle in all my plots where it attempts to connect the points between 360 and 0 (now 100

Re: Accessing a parse tree

2009-04-18 Thread Clarendon
Dear John Machin So sorry about the typo. It should be: the program should *see* that the designated *words* are... a long way has two parentheses to the left -- (VP (DT -- before it hits a separate group -- VBD came). If there are three parenthesis, for instance (NP, this will means that what

How to create an unclosed dialog in wxPython?

2009-04-18 Thread 书虫
In wxPython, after I create a wx.Frame, I want to create a modeless and unclosed dialog. Here is my step: app = wx.PySimpleApp() f = wx.Frame(None, -1, Test) d = wx.Dialog(f, -1, Test Dialog, style = wx.CAPTION) f.Show() d.Show() app.MainLoop() As you see, I create a dialog with wx.CAPTION

Re: __getattribute__ for operators

2009-04-18 Thread Michael
Hmm... I meant to create a new thread, as does GMail when you edit the subject. Pardon my Google-Groups newbieness. - Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with problem creating class

2009-04-18 Thread Aahz
In article 3pmpb6-lq9@spamfence.net, =?UTF-8?Q?G=C3=BCnther?= Dietrich guenther.dietr...@spamfence.net wrote: You assign the result of line.split() to four variables. So split needs at least four fields (that's more than three) in line to process. s/at least/exactly/ w, x, y, z =

Re: Variables vs attributes

2009-04-18 Thread Piet van Oostrum
Steven D'Aprano st...@remove-this-cybersource.com.au (SD) wrote: SD On Fri, 17 Apr 2009 17:48:55 +0200, Diez B. Roggisch wrote: No, because you are creating *classvariables* when declaring things like this: SD ... OTOH, when assigning to an instance, this will create an *instance*-variable.

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Rowe
2009/4/18 Aahz a...@pythoncraft.com: blink  I had never previously heard that Modula-2 significantly influenced Ada, and the Wikipedia entry says nothing about it.  Do you have a cite? Not in writing. I got it from a SPARK user group meeting many years ago. SPARK is, of course a subset of Ada

[no subject]

2009-04-18 Thread karlos barlos
hello to all !! given the code : elif choice == 3:     print all users list :     print\n     import active_directory     for user in active_directory.search (objectCategory='Person', objectClass='User'): print user that lists all active directory personal ... how

Re:

2009-04-18 Thread Benjamin Kaplan
On Sat, Apr 18, 2009 at 4:23 PM, karlos barlos karlosbar...@yahoo.comwrote: hello to all !! given the code : elif choice == 3: print all users list : print\n import active_directory for user in active_directory.search (objectCategory='Person',

Re: __getattribute__ for operators

2009-04-18 Thread Terry Reedy
Michael wrote: While thinking about Steven D'Aprano's thread about automatically generating arithmetic operations for a subclass, I stumbled upon something confusing. Having defined the following class to do funky addition, class MyInt(int): def __getattribute__(self, key): if key

Re: __getattribute__ for operators

2009-04-18 Thread Piet van Oostrum
Michael gundl...@gmail.com (M) wrote: M While thinking about Steven D'Aprano's thread about automatically M generating arithmetic operations for a subclass, I stumbled upon M something confusing. Having defined the following class to do funky M addition, M class MyInt(int): M def

Re: I'm sort of mystified by the print hex to char conversion

2009-04-18 Thread Peter Pearson
On Sat, 18 Apr 2009 11:45:09 -0700 (PDT), grocery_stocker wrote: I'm just really not seeing how something like x63 and/or x61 gets converted by 'print' to the corresponding chars in the following output... [cdal...@localhost oakland]$ python Python 2.4.3 (#1, Oct 1 2006, 18:00:19) [GCC

not homework... something i find an interesting problem

2009-04-18 Thread Trip Technician
although it's not homework (how can i prove that...?) i am still happy with just hints +++ we want to express integers as sums of squares. (repeated squares are allowed) most numbers have one minimal representation e.g. 24=16+4+4, some have two or more e.g. 125 = 121+4 = 100+25 so far I have

Re: Any adv. in importing a module and some objects in the same module, into the same file?

2009-04-18 Thread Piet van Oostrum
Visco Shaun visc...@gmail.com (VS) wrote: VS http://docs.python.org/library/logging.html VS While going thr' the above link i came across import statements VS import logging VS import logging.handlers VS What is the use of second import as the first import will be VS enough(AFAIK) to access

Re: Overriding methods per-object

2009-04-18 Thread Pavel Panchekha
On Apr 18, 4:01 pm, Piet van Oostrum p...@cs.uu.nl wrote: But you can give each object its own class and then put the special methods in that class: def create_special_object(bases, *args): ...   if not isinstance(bases, tuple): ...      bases = bases, ...   cls = type(SpecialClass,

  1   2   >