Re: Can some1 review my code?

2009-04-18 Thread zaheer . agadi
On Apr 19, 11:29 am, Steven D'Aprano wrote: > On Sat, 18 Apr 2009 23:18:32 -0700, zaheer.agadi wrote: > > hi > > > I am from java background, I have written some code that actually works > > :) > > Need to some one to look at it and tell me if there are better ways of > > doing same things > > > W

Re: [ANN] pyxser-0.2r --- Python XML Serialization

2009-04-18 Thread Stefan Behnel
Daniel Molina Wegener wrote: > * Every serilization is made into unicode objects. Hmm, does that mean that when I serialise, I get a unicode object back? What about the XML declaration? How can a user create well-formed XML from your output? Or is that not the intention? Stefan -- http://

Re: Can some1 review my code?

2009-04-18 Thread Steven D'Aprano
On Sat, 18 Apr 2009 23:18:32 -0700, zaheer.agadi wrote: > hi > > I am from java background, I have written some code that actually works > :) > Need to some one to look at it and tell me if there are better ways of > doing same things > > Will some one help? Are you offering to pay or are you a

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

2009-04-18 Thread Steven D'Aprano
On Sun, 19 Apr 2009 06:33:23 +0100, Tim Wintle wrote: > On Sun, 2009-04-19 at 05:08 +, Zaphod wrote: >> Well, most of the Linux kernel is written in C and while there *is* a >> jump (often JMP) in most asms, you should only do so if you really need >> to. JSR (jump sub routine) is a better id

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

2009-04-18 Thread Jeroen Ruigrok van der Werven
-On [20090415 14:25], Deep_Feelings (doctore...@gmail.com) wrote: >4- support of international languages http://babel.edgewall.org/ -- Jeroen Ruigrok van der Werven / asmodai イェルーン ラウフロック ヴァン デル ウェルヴェン http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B Hope is a letter that nev

Re: Can some1 review my code?

2009-04-18 Thread Jeroen Ruigrok van der Werven
-On [20090419 08:20], zaheer.ag...@gmail.com (zaheer.ag...@gmail.com) wrote: >Need to some one to look at it and tell me if there are better ways of >doing same things Just post the snippets of code you want review of. -- Jeroen Ruigrok van der Werven / asmodai イェルーン ラウフロック ヴァン デル ウェルヴェン http:/

Can some1 review my code?

2009-04-18 Thread zaheer . agadi
hi I am from java background, I have written some code that actually works :) Need to some one to look at it and tell me if there are better ways of doing same things Will some one help? Thanks -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-18 Thread Michele Simionato
On Apr 18, 5:19 pm, a...@pythoncraft.com (Aahz) wrote: > Okay, I'm curious, is the argument that you shouldn't use generators for > coroutines or something else? Yes, there is certainly the confusion between generators and coroutines (the ones David Beazley warns about). At first, I was a support

[ANN] pyxser-0.2r --- Python XML Serialization

2009-04-18 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello, I'm pleased to announce pyxser-0.2r, a Python-Object to XML serializer and deserializer. This package it's completly written in C and licensed under LGPLv3. The tested Python versions are 2.5.X and 2.6.X. * home page: http://coder.cl/soft

wxPython 2.8 for Python 2.6 on Linux

2009-04-18 Thread Kenny x
Hello, I use Ubuntu 8.10 and the latest version of Python. I started programming wxPython on my Windows computer, but now I have access to my ubuntu box, and want wxPython for 2.6 All the debs in the package manager are for 2.5, not 2.6 How can I Install wxPython for Python 2.6 without building

Useful MySQL Routines

2009-04-18 Thread Lawrence D'Oliveiro
I've done a writeup on some of the basic routines I frequently use here . -- 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 Tim Wintle
On Sun, 2009-04-19 at 05:08 +, Zaphod wrote: > Well, most of the Linux kernel is written in C and while there *is* a > jump (often JMP) in most asms, you should only do so if you really > need > to. JSR (jump sub routine) is a better idea in many (most?) cases. Have to say that I feel jump

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

2009-04-18 Thread Zaphod
On Fri, 17 Apr 2009 16:07:10 -0600, Michael Torrie wrote: > Aahz wrote: >> Why do you want to do that? Before you answer, make sure to read this: >> > http://www.u.arizona.edu/~rubinson/copyright_violations/ Go_To_Considered_Harmful.html > > Somebody better tell the Linux kernel developers about

Re: [OT] large db question about no joins

2009-04-18 Thread Tim Wintle
On Fri, 2009-04-17 at 21:16 +0100, Martin P. Hellwig wrote: > So in other words, just lay out the data which makes the most sense > to > you, the pain of recreating SQL like logic is there no matter what > layout you choose. I have to say that given the amount of pain most people seem to go thro

Re: Too early implementation

2009-04-18 Thread Tim Wintle
On Sat, 2009-04-18 at 13:48 +0200, Filip Gruszczyński 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 ;-))? The "Method" (If you can call it that) that I use is

Re: python alternatives to C structs??

2009-04-18 Thread Dave Angel
Aaron Brady wrote: On Apr 18, 2:25 pm, KoolD wrote: 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=en("/dev/s

Re: not homework... something i find an interesting problem

2009-04-18 Thread Dave Angel
Trip Technician wrote: 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 =

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

2009-04-18 Thread Dave Angel
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 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 Type

Re: Too early implementation

2009-04-18 Thread Aaron Watters
On Apr 18, 7:48 am, Filip Gruszczyński 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 ;-))? There are a lot of ideas, some you've seen earlier in this thread. B

Re: Overriding methods per-object

2009-04-18 Thread Aaron Brady
On Apr 17, 9:41 pm, Steven D'Aprano wrote: > On Fri, 17 Apr 2009 18:22:49 -0700, Pavel Panchekha wrote: > > I've got an object which has a method, __nonzero__ The problem is, that > > method is attached to that object not that class > > >> a = GeneralTypeOfObject() > >> a.__nonzero__ = lambda: Fal

Re: python alternatives to C structs??

2009-04-18 Thread Aaron Brady
On Apr 18, 2:25 pm, KoolD wrote: > 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=ope

Re: Overriding methods per-object

2009-04-18 Thread Gabriel Genellina
En Sat, 18 Apr 2009 19:39:24 -0300, Pavel Panchekha escribió: On Apr 18, 4:01 pm, Piet van Oostrum 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): ...    

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

2009-04-18 Thread JanC
Stef Mientki wrote: > BJörn Lindqvist wrote: >> SCREEN 13 >> PSET 160,100,255 > > Maybe, who is able to understand such nosense without a lot of apriori > knowledge ? You already needed that sort of knowledge to be able to use a computer back then... ;-) -- JanC -- http://mail.python.org/

Re: after_cancel?

2009-04-18 Thread W. eWatson
Saul Spatz wrote: 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? http://www.python

Re: after_cancel?

2009-04-18 Thread W. eWatson
Saul Spatz wrote: 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? http://www.python

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

2009-04-18 Thread Tino Wildenhain
baykus 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. The reason I am asking is that I always liked how I could reference- call certain line number back in the days. It would be interesting to ge

Re: Overriding methods per-object

2009-04-18 Thread Pavel Panchekha
On Apr 18, 4:01 pm, Piet van Oostrum 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", bases,

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 (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 a

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 cr

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) > [G

Re: __getattribute__ for operators

2009-04-18 Thread Piet van Oostrum
> Michael (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 __getattrib

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:

2009-04-18 Thread Benjamin Kaplan
On Sat, Apr 18, 2009 at 4:23 PM, karlos barlos wrote: > 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='Us

[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

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

2009-04-18 Thread Tim Rowe
2009/4/18 Aahz : >  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 with some mandatory st

Re: Variables vs attributes

2009-04-18 Thread Piet van Oostrum
> Steven D'Aprano (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. Which is what

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 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 = '1\t2\t3\t4\t5'.split('\t') Trac

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

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 st

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 wha

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 and

Re: How to create an unclosed dialog in wxPython?

2009-04-18 Thread alejandro
Don't press alt+f4? "??" 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, "Test") > d = wx.D

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

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 a

Re: Overriding methods per-object

2009-04-18 Thread Piet van Oostrum
> Pavel Panchekha (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 the

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 las

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 http://www.d

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 onl

Re: Please help with problem creating class

2009-04-18 Thread member thudfoo
Correction: On 4/18/09, member thudfoo wrote: > On 4/18/09, 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

Re: Please help with problem creating class

2009-04-18 Thread member thudfoo
On 4/18/09, 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

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 woul

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 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 modific

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: question about xrange performance

2009-04-18 Thread Arnaud Delobelle
Steven D'Aprano 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 deprecated in Python 2.6, which means it

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 i

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", "cre

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" wrote: > "baykus" 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

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" 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 Basi

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 pysq

Re: pyqt4 qTableWidget add items help

2009-04-18 Thread ookrin
On Apr 18, 3:46 am, Sebastian Wiesner wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > [...]> 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 co

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

2009-04-18 Thread Piet van Oostrum
> "Gabriel Genellina" (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:

2009-04-18 Thread karlos barlos
--- On Sat, 4/18/09, Joe Riopel wrote: From: Joe Riopel Subject: Re: To: "karlos barlos" Cc: python-list@python.org Date: Saturday, April 18, 2009, 12:01 PM On Sat, Apr 18, 2009 at 12:56 PM, karlos barlos wrote: > LDAP://CN=bessy,OU=sales,DC=shay,DC=com > LDAP://CN=ron,OU=legal,DC=shay,DC=c

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? http://www.pythonware.com/library/tk

__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: 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 that

Re: Too early implementation

2009-04-18 Thread Patrick Mullen
2009/4/18 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, wh

Re: Lambda alternative?

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

Re: Too early implementation

2009-04-18 Thread stephane . bisinger
On Apr 18, 5:54 pm, Filip Gruszczyński 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 no idea, how t

Re:

2009-04-18 Thread Joe Riopel
On Sat, Apr 18, 2009 at 12:56 PM, karlos barlos 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: http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files and this:

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

[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: 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 user

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

2009-04-18 Thread Aahz
In article , Tim Rowe 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 still doing >pretty well in mission-critical contexts. I had nev

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)

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

2009-04-18 Thread Tim Rowe
2009/4/18 norseman : > "...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 Modula 2, the latte

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 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. -- D'Arcy J.M. Cain

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 no

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

2009-04-18 Thread Tim Rowe
2009/4/17 Hyuga : > 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 that. And limited expe

Re: [OT] large db question about no joins

2009-04-18 Thread Martin P. Hellwig
Daniel Fetchinson wrote: 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 section. Ha

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>, 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 get() on the Queue unti

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: Too early implementation

2009-04-18 Thread Aahz
In article , 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 your approach might >not be that wrong after all. This observation was originally mad

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: 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>, 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 see how the queue

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 wrote: >On Apr 18, 3:03=A0pm, a...@pythoncraft.com (Aahz) wrote: >> In article , >> Peter Otten =A0<__pete...@web.de> wrote: >>> >>>If it were up to me I'd rip out send() immediatly. At first I thoug

Re: class variables and class methods

2009-04-18 Thread Aahz
In article <9c848013-2245-455e-bb30-48e430d56...@j9g2000prh.googlegroups.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 "instance", and I think you'

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 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 won't find anyone ser

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 > , > > Generally speaking, you should never directly update the system Python; > most Linux systems these days rely on Python for their operation. > Instead, you install an additional copy of Python, and you cannot use > your OS

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: Too early implementation

2009-04-18 Thread stephane . bisinger
On Apr 18, 12:48 pm, Filip Gruszczyński 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 & Kernighan in "T

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 o

Re: Too early implementation

2009-04-18 Thread alex23
On Apr 18, 9:48 pm, Filip Gruszczyński 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 problematic ;-) > > So,

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 , > 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 t

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 makes

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: 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>, 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, the timeout is not >re

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

2009-04-18 Thread Aahz
In article , 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. Basically, send() is useful for cor

Re: can't install new modules after updating python

2009-04-18 Thread Aahz
In article , lie 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 I can't use it. How >can I fix this? Should I go back to 2.5? Generally speaking

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: [TABL

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 w

  1   2   >