[Tutor] Graphical Toolkit for new XLIFF translation editor

2006-06-26 Thread Keo Sophon
Hello list, KhmerOS is going to write an XLIFF translation editor with Python. Before starting, we would like to know which Graphical Toolkit should be used for the editor which supports many languages including Latin, Indic, Arabic and so on. However, there are many GUI toolkits such as QT, GT

Re: [Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-26 Thread Pawel Kraszewski
Dnia niedziela, 25 czerwca 2006 22:45, Bob Gailer napisał: > To get the behavior I think you want try: > > def __init__(self, q = None): > if not q: q = [] > self.queue = q I would disagree... This sure works for empty arguments, but: >>> u = [1,2,3] >>> a = Queue(u) >>> b =

Re: [Tutor] doubt in Regular expressions

2006-06-26 Thread Evans Anyokwu
Luke, You are confusing me for the OP. Please read carefully next time before you respond to the wrong person. I bumped because the OP's question was not specific and I thought I talked about people making their requests or questions very specific if they expect any useful replies. So, Luke t

Re: [Tutor] How can I add my folder to pythonpath?

2006-06-26 Thread Emily Fortuna
> That is close but not quite right. The correct import will be > from mymodules import mymodule1 > > Kent My apologies for misleading instructions. Emily > >> >> >> Laszlo Antal wrote: >>> Hi, >>> >>> This is how my directory looks >>> myprogram(this is the main folder for my program) >>>

Re: [Tutor] Regular expressions

2006-06-26 Thread Danny Yoo
On Sun, 25 Jun 2006, ravi sankar wrote: >we are doing an intranet portral search.we had a look at the > tutorials for Regular expressions...we need an insight on how to > implement this.we r in the process of developing a unified search... If you have a question, please ask it directly.

Re: [Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-26 Thread Danny Yoo
>> The values of optional arguments are only once evaluated (when Python >> reads the definition). If you place there mutable objects like e.g. a >> list most of the time the effect you see is not what you want. So you >> have to write it a bit different. >> >> def __init__(self, q = None):

Re: [Tutor] doubt in Regular expressions

2006-06-26 Thread Danny Yoo
> You are confusing me for the OP. Please read carefully next time before > you respond to the wrong person. > > I bumped because the OP's question was not specific and I thought I > talked about people making their requests or questions very specific if > they expect any useful replies. Hi E

Re: [Tutor] database help for newbie, fetchall()

2006-06-26 Thread Python
On Sun, 2006-06-25 at 20:14 -0400, Rene Bourgoin wrote: > What is the best way to handle the resutls to a fetchall() command? > The result seems to be a list of tuples [(aaa,bbb,ccc0,(11,222,333,)]. Correct > I'm new to programming but it seems that what ever I try to accomplish > at some point i

[Tutor] (no subject)

2006-06-26 Thread shane davin
Stop the emails??? im getting more than i need regards _ The new MSN Search Toolbar now includes Desktop search! http://join.msn.com/toolbar/overview ___ Tutor maillist - Tutor@python.or

Re: [Tutor] database help for newbie, fetchall()

2006-06-26 Thread Alan Gauld
> What is the best way to handle the resutls to a fetchall() command? > The result seems to be a list of tuples > [(aaa,bbb,ccc0,(11,222,333,)]. Yes, thats usually the most convenient way to present groups of data. > I'm new to programming but it seems that what ever I try to > accomplish > at

Re: [Tutor] MySQLdb: cant get '... where field in %s' to work

2006-06-26 Thread Alan Gauld
>>> ARTICLES = ('XXX9', 'ABZ2') >>> TESTARTICLENAME = """SELECT * FROM tblForTransfer2Prodsite >>> WHERE articleName IN %r""" % (ARTICLES,) This uses normal string substitution so puts the tuple ARTICLES in the query using the repr format - includes parens) which is what you want. (BTW us

[Tutor] Unit testing

2006-06-26 Thread Tino Dai
Hey Everybody,  First off, I like to thank Kent, Alan, and Danny for their invaluable help. You guys are amazing!   I do have some questions about unit testing. I have read through the diving into python section about unit testing as well as the documentation from the python docs. While tha

Re: [Tutor] Unit testing

2006-06-26 Thread Jorge Godoy
"Tino Dai" <[EMAIL PROTECTED]> writes: > How do I simulate my queues and other sources of data. In Java, there > is a program called JMock that you can use to simulate that. Is there > anything like that in Python or do I roll my own and create the appropriate > queues with some data in the

Re: [Tutor] Unit testing

2006-06-26 Thread Kent Johnson
Tino Dai wrote: > Hey Everybody, > > First off, I like to thank Kent, Alan, and Danny for their > invaluable help. You guys are amazing! You are welcome! >I do have some questions about unit testing. > >I have a part of the code that writes to the filesystem. Is the > o

Re: [Tutor] (no subject)

2006-06-26 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of shane davin > Sent: Monday, June 26, 2006 9:15 AM > To: Tutor@python.org > Subject: [Tutor] (no subject) > > Stop the emails??? > im getting more than i need > regards > > _

Re: [Tutor] for teachers and students: xturtle.py a new turtle graphics module

2006-06-26 Thread Carroll, Barry
Gregor: Doesn't this really belong on Python-announce-list instead of here? You aren't asking any questions and you are announcing a new python-based application. That's what Python-announce-list is for. Post your announcement there and you will get plenty of feedback for your next release.

Re: [Tutor] Unit testing

2006-06-26 Thread Tino Dai
I often write unit tests that do this. In my opinion it is simple and straightforward and effective. Some purists will insist that a unit test shouldn't write the file system or touch a database or use any other external resource, but I think that is silly - if the job of a bit of code is to write

[Tutor] Here's some interesting float oddness.

2006-06-26 Thread Adam
I tried this expecting an exceptionIn [2]: math.tan(math.pi/2)Out[2]: 16331778728383844.0so I thought maybe that was a float limit which it probably is as you get weird results from higher values but it seems strange that it tries to run with it. In [5]: 16331778728383844.0Out[5]: 16331778728383844

[Tutor] Why doesn't it save the data before exiting?

2006-06-26 Thread Nathan Pinno
Hey all,   I am needing help on this. Why isn't it saving the data beore exiting the program? I don't get an error before exiting.   Here's the code so far: accountlist = {}   def load_file(ac):    import os    import pickle    filename = 'accounts.txt'    if os.path.exists(filename):  

Re: [Tutor] Why doesn't it save the data before exiting?

2006-06-26 Thread Bob Gailer
Nathan Pinno wrote: > Hey all, > > I am needing help on this. Why isn't it saving the data beore exiting > the program? But it does save it. What evidence do you have that it is not? Please in the future always tell us what the evidence of a problem is. Also I suggest you add validation of use

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Bob Gailer
Bob Gailer wrote: > Nathan Pinno wrote: > >> Hey all, >> >> I am needing help on this. Why isn't it saving the data beore exiting >> the program? >> > But it does save it. What evidence do you have that it is not? > > Please in the future always tell us what the evidence of a problem is.

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Nathan Pinno
How do I know? Simple. Next time I load it and ask it to print the list of accounts and how much in each, I only get: Account Info then the menu again, with no info. Nathan Pinno - Original Message - From: "Bob Gailer" <[EMAIL PROTECTED]> To: "Bob Gailer" <[EMAIL PROTECTED]> Cc: "Natha

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Bob Gailer
Nathan Pinno wrote: > How do I know? Simple. Next time I load it and ask it to print the > list of accounts and how much in each, I only get: > > Account Info > > then the menu again, with no info. Ah. But the program starts setting accountlist = {}. When you reach printall, accountlist is still

Re: [Tutor] Unit testing

2006-06-26 Thread Carroll, Barry
but it contains a semaphore from another class. Now, I > could make the semaphore a global variable, or I bring in the other class. > One violates "good" programming principles and the other violates the unit > testing principles. Is there another way? > > -Tino > -

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Nathan Pinno
Would it be this line? pickle.dump(ac, store) Would this make it work? ac = pickle.dump(store) Nathan - Original Message - From: "Bob Gailer" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Monday, June 26, 2006 5:33 PM Subject: Re: [Tutor] Why doesn't it save the

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Bob Gailer
Nathan Pinno wrote: I already told you that the data is being saved to the file. And is being reloaded by ac = pickle.load(store). But the reloaded data is not being assigned to accountlist, since parameters to functions are treated as local variables. Assigning to a parameter in a function doe

Re: [Tutor] Unit testing

2006-06-26 Thread Alan Gauld
> Ok, that leads me to my next question. Currently, I have a class > that I > want to unit test, but it contains a semaphore from another class. > Now, I > could make the semaphore a global variable, or I bring in the other > class. > One violates "good" programming principles and the other vio

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Alan Gauld
Hi Nathan, > How do I know? Simple. Next time I load it and ask it to print the > list of accounts and how much in each, I only get: OK, but that could be down to: 1) The save file not working, 2) the load file not working 3) the print accounts not working Have you checked whether the store fil

Re: [Tutor] Unit testing

2006-06-26 Thread Baiju M
On 6/26/06, Tino Dai <[EMAIL PROTECTED]> wrote: [...] > How would I unit test python GUIs Few weeks back I wrote a small article, may be helpful, so here it is : http://baijum81.livejournal.com/11598.html Regards, Baiju M ___ Tutor maillist - Tutor@py