AVC 0.6.0 released

2008-06-12 Thread Fabrizio Pollastri
Announcing AVC 0.6.0 Webpage: http://avc.inrim.it/ What is AVC? - AVC is a multiplatform, fully automatic, live connection among graphical interface widgets and application variables for the python language. AVC supports in a uniform way the most

Re: can't assign to literal

2008-06-12 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: Producer-consumer threading problem

2008-06-12 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 appreciated. It

Re: can't assign to literal

2008-06-12 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 the width

Re: ClassName.attribute vs self.__class__.attribute

2008-06-12 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: ClassName.attribute vs self.__class__.attribute

2008-06-12 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

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

2008-06-12 Thread Bruno Desthuilliers
Dennis Lee Bieber a écrit : 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 mean experienced. Indeed. Tim Golden already

Re: My fight with classes :)

2008-06-12 Thread TheSaint
On 04:51, giovedì 12 giugno 2008 Terry Reedy wrote: First of all a big thank you, all. def makeappender(): data = ['',''] def appender(val): code that mutates data return appender I'll give it a try. I just doubting if the data will be shared outside the function. Actually, my practice

Re: How to set directory in save as combo box

2008-06-12 Thread Tim Golden
gopal mishra wrote: 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. There are several ways to display a Save As dialog. Can you post [a minimal version of]

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

2008-06-12 Thread William McBrine
On Wed, 11 Jun 2008 12:25:29 -0700, geoffbache wrote: (1) py2exe. This is really for when python isn't installed on the remote user's machine, so it requires you to distribute a large amount of DLLs etc which are part of the python installation. A bit silly when I know that the remote user

Please recommend a blog program written using python-cgi

2008-06-12 Thread Royt
Hi, I'm a newbie to Python, but I think it won't be too hard to learn. A few days ago I registered Google App Engine, it only support Python 2.5. I want to set my blog on it soon. But it's not easy for me to finish it in a short time since I'm not very familiar with Python, so I want find some

Re: ClassName.attribute vs self.__class__.attribute

2008-06-12 Thread Duncan Booth
Mike Orr [EMAIL PROTECTED] wrote: That's a misunderstanding of classes vs instances. If you have an instance of MyClass(Superclass), there is one instance but several classes. The instance is of MyClass; there is no instance of Superclass. 'self' has a .__class__ attribute because it's an

Re: ClassName.attribute vs self.__class__.attribute

2008-06-12 Thread Hrvoje Niksic
Mike Orr [EMAIL PROTECTED] writes: There's a very good reason to use self.__class__: it makes it possible to subclass your class. This really depends on the usage. In the OP's use case, he wanted the subclasses to share the same lock object defined in the superclass (because of

suppress opening command window after using os.system command

2008-06-12 Thread boriq
Hi, I'm using in my script command os.system('command') on Windows XP. Each time the os.system command is used, python opens an empty ms-dos command window (the black one) and then closes it. So when in one script the os.system command 50 times is used, I see 50 black windows. Is there a way of

Re: Please recommend a blog program written using python-cgi

2008-06-12 Thread Diez B. Roggisch
Royt wrote: Hi, I'm a newbie to Python, but I think it won't be too hard to learn. A few days ago I registered Google App Engine, it only support Python 2.5. I want to set my blog on it soon. But it's not easy for me to finish it in a short time since I'm not very familiar with Python, so I

Re: ClassName.attribute vs self.__class__.attribute

2008-06-12 Thread Bruno Desthuilliers
Mike Orr a écrit : (snip) 'self' has a .__class__ attribute because it's an instance, but MyClass and Superclass do not because they're already classes. Not true for new-style classes: class Toto(object): pass ... Toto.__class__ type 'type' (snip) I sometimes wish classes had a

Re: matplotlib question

2008-06-12 Thread Tom Wright
asdf wrote: 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. You need to look up the matplotlib.dates package - it's covered briefly in the tutorial at

Re: h2py.py bug?

2008-06-12 Thread Gabriel Genellina
En Wed, 11 Jun 2008 04:21:03 -0300, Gabriel Rossetti [EMAIL PROTECTED] escribió: Gabriel Genellina wrote: En Tue, 10 Jun 2008 09:44:13 -0300, Gabriel Rossetti [EMAIL PROTECTED] escribió: I wanted to use the h2py.py script (Tools/scripts/h2py.py) and it didn't like char litterals :

ATT WIRELESS

2008-06-12 Thread AISHWARYA
__ http://attwireless1.blogspot.com http://onenesstemple.blogspot.com http://maintanancemanagementsoftwareservises.blogspot.com http://consolidation2.blogspot.com http://debtmanagementcompany.blogspot.com/ http://personalloanscash.blogspot.com/

Re: My fight with classes :)

2008-06-12 Thread Bruno Desthuilliers
TheSaint a écrit : On 04:51, giovedì 12 giugno 2008 Terry Reedy wrote: First of all a big thank you, all. def makeappender(): data = ['',''] def appender(val): code that mutates data return appender I'll give it a try. I just doubting if the data will be shared outside the

Re: suppress opening command window after using os.system command

2008-06-12 Thread Gabriel Genellina
En Thu, 12 Jun 2008 05:28:13 -0300, boriq [EMAIL PROTECTED] escribió: I'm using in my script command os.system('command') on Windows XP. Each time the os.system command is used, python opens an empty ms-dos command window (the black one) and then closes it. So when in one script the os.system

Re: suppress opening command window after using os.system command

2008-06-12 Thread boriq
On 12 Jun., 11:51, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 12 Jun 2008 05:28:13 -0300, boriq [EMAIL PROTECTED]   escribió: I'm using in my script command os.system('command') on Windows XP. Each time the os.system command is used, python opens an empty ms-dos command window

Re: suppress opening command window after using os.system command

2008-06-12 Thread Gabriel Genellina
En Thu, 12 Jun 2008 07:08:00 -0300, boriq [EMAIL PROTECTED] escribió: On 12 Jun., 11:51, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 12 Jun 2008 05:28:13 -0300, boriq [EMAIL PROTECTED]   escribió: I'm using in my script command os.system('command') on Windows XP. Each time the

Re: suppress opening command window after using os.system command

2008-06-12 Thread Tim Golden
Gabriel Genellina wrote: En Thu, 12 Jun 2008 07:08:00 -0300, boriq [EMAIL PROTECTED] escribió: On 12 Jun., 11:51, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 12 Jun 2008 05:28:13 -0300, boriq [EMAIL PROTECTED] escribió: I'm using in my script command os.system('command') on

Re: ClassName.attribute vs self.__class__.attribute

2008-06-12 Thread Duncan Booth
Bruno Desthuilliers [EMAIL PROTECTED] wrote: FWIW, metaclasses do have a class attribute that refers to itself !-) One metaclass (i.e. type) has a class attribute that refers to itself. Other metaclasses have a class attribute that refers to the metaclass's metaclass. I can't think of any

re quiz

2008-06-12 Thread David C. Ullrich
True or False? (no fair looking it up) (*) If repl is a string then re.sub(pattern, repl, s) returns s with non-overlapping occurences of pattern replaced by repl. I assumed it was true - spent a few hours trying to figure out what was going on with a certain re.sub, then noticed that (*) is

get keys with the same values

2008-06-12 Thread Nader
Hello, I have a dictionary and will get all keys which have the same values. d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} I will something as : d.keys(where their values are the same) With this statement I can get two lists for this example: l1= ['a','e'] l2=['b','d']

regex for balanced parentheses?

2008-06-12 Thread David C. Ullrich
There's no regex that detects balanced parentheses, or is there? That is, search('and so ((x+y)+z) = (x+(y+z))') should return '((x+y)+z)'. Not just a theoretical question, I'm cleaning up a large body of TeX code and a regex that did that would be very convenient. (Yes, I know it's not hard to

using re module to find but not alone ... is this a BUG in re?

2008-06-12 Thread anton
Hi, I want to replace all occourences of by \ in a string. But I want to leave all occourences of \ as they are. The following should happen: this I want while I dont want this \ should be transformed to: this I want \ while I dont want this \ and NOT: this I want \ while I dont

Re: Dynamic HTML from Python Script

2008-06-12 Thread Dave Parker
On Jun 11, 10:43 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: Those are not /server side/ refreshes... Correct. But we weren't discussing server side refreshes. We were discussing how to make the browser refresh automatically in the server side: On Jun 11, 7:59 am, Lie [EMAIL

Plotting Graphs using Gnuplot

2008-06-12 Thread arslanburney
Hello. Was trying to create a simple plotting function. Wasnt working however. If i write the same code without putting it inside a function it works. :S. Could some1 tell me the problem? Heres the code: # File name Plotting2 import Gnuplot def plot(original, expected, actual): if type

Re: Finding a sense of word in a text

2008-06-12 Thread Piotrek Byzia
On 11 Cze, 19:10, Sengly [EMAIL PROTECTED] wrote: 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

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

2008-06-12 Thread Gerry
On Jun 12, 4:04 am, William McBrine [EMAIL PROTECTED] wrote: On Wed, 11 Jun 2008 12:25:29 -0700, geoffbache wrote: (1) py2exe. This is really for when python isn't installed on the remote user's machine, so it requires you to distribute a large amount of DLLs etc which are part of the

Re: get keys with the same values

2008-06-12 Thread bearophileHUGS
Nader: d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} I will something as : d.keys(where their values are the same) That's magic. With this statement I can get two lists for this example: l1= ['a','e'] l2=['b','d'] Would somebody tell me how I can do it? You can

Re: get keys with the same values

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 03:58:53 -0700 (PDT), Nader [EMAIL PROTECTED] wrote: Hello, I have a dictionary and will get all keys which have the same values. d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} That's not a dictionary, it's a syntax error. If you actually have a

Re: using re module to find but not alone ... is this a BUG in re?

2008-06-12 Thread John Machin
On Jun 12, 7:11 pm, anton [EMAIL PROTECTED] wrote: Hi, I want to replace all occourences of by \ in a string. But I want to leave all occourences of \ as they are. The following should happen: this I want while I dont want this \ should be transformed to: this I want \ while I

Re: get keys with the same values

2008-06-12 Thread Nader
On Jun 12, 1:35 pm, [EMAIL PROTECTED] wrote: Nader: d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} I will something as : d.keys(where their values are the same) That's magic. With this statement I can get two lists for this example: l1= ['a','e'] l2=['b','d']

Re: Simple and safe evaluator

2008-06-12 Thread Hans Nowak
bvdp 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 to subject my users to the problems with that

Re: get keys with the same values

2008-06-12 Thread Nader
On Jun 12, 1:41 pm, David C. Ullrich [EMAIL PROTECTED] wrote: On Thu, 12 Jun 2008 03:58:53 -0700 (PDT), Nader [EMAIL PROTECTED] wrote: Hello, I have a dictionary and will get all keys which have the same values. d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} That's

Re: Strange bug doesn't occur in Pydb

2008-06-12 Thread kj
In [EMAIL PROTECTED] Diez B. Roggisch [EMAIL PROTECTED] writes: 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':

Re: get keys with the same values

2008-06-12 Thread Chris
On Jun 12, 1:48 pm, Nader [EMAIL PROTECTED] wrote: On Jun 12, 1:35 pm, [EMAIL PROTECTED] wrote: Nader: d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} I will something as : d.keys(where their values are the same) That's magic. With this statement I can

Re: re quiz

2008-06-12 Thread John Machin
On Jun 12, 8:57 pm, David C. Ullrich [EMAIL PROTECTED] wrote: True or False? (no fair looking it up) (*) If repl is a string then re.sub(pattern, repl, s) returns s with non-overlapping occurences of pattern replaced by repl. I assumed it was true - spent a few hours trying to figure out

Re: re quiz

2008-06-12 Thread Peter Otten
David C. Ullrich wrote: (Or is there a function somewhere that will convert r\remark{Hint} to r\\remark{Hint} for me, and do the same for precisely the escpapes referred to in the and so forth?) I think you just have to escape the backslash: re.sub(pattern, replacement_string.replace(\\,

Re: get keys with the same values

2008-06-12 Thread Nader
On Jun 12, 2:05 pm, Chris [EMAIL PROTECTED] wrote: On Jun 12, 1:48 pm, Nader [EMAIL PROTECTED] wrote: On Jun 12, 1:35 pm, [EMAIL PROTECTED] wrote: Nader: d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} I will something as : d.keys(where their values are

Re: get keys with the same values

2008-06-12 Thread Duncan Booth
Nader [EMAIL PROTECTED] wrote: I have a dictionary and will get all keys which have the same values. d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)} I will something as : d.keys(where their values are the same) With this statement I can get two lists for this

Re: Strange bug doesn't occur in Pydb

2008-06-12 Thread Diez B. Roggisch
kj wrote: In [EMAIL PROTECTED] Diez B. Roggisch [EMAIL PROTECTED] writes: 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,

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

2008-06-12 Thread Luis Zarrabeitia
Quoting Dennis Lee Bieber [EMAIL PROTECTED]: On Wed, 11 Jun 2008 21:54:33 -0700 (PDT), Michele Simionato [EMAIL PROTECTED] declaimed the following in comp.lang.python: It looks like in French (as in Italian) *experimented* has the meaning of tried and tested on the field when applied

Re: re quiz

2008-06-12 Thread Duncan Booth
David C. Ullrich [EMAIL PROTECTED] wrote: Practical question: What's a _complete_ list of the escapes included in the and so forth in (**)? (Or is there a function somewhere that will convert r\remark{Hint} to r\\remark{Hint} for me, and do the same for precisely the escpapes referred to

Re: using re module to find but not alone ... is this a BUG in re?

2008-06-12 Thread Duncan Booth
John Machin [EMAIL PROTECTED] wrote: What you want is: import re text = r'frob this avoid this \, OK?' text 'frob this avoid this \\, OK?' re.sub(r'(?!\\)', r'\', text) frob this \\ avoid this \\, OK?' Or you can do it without using regular expressions at all. Just replace them

Re: Alternative to Decimal type

2008-06-12 Thread Frank Millman
On Jun 11, 11:48 am, 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. [snip] My main concern is that my approach may be naive, and that I will run into situations that I have

Re: ClassName.attribute vs self.__class__.attribute

2008-06-12 Thread Hrvoje Niksic
Duncan Booth [EMAIL PROTECTED] writes: In fact, thinking about it a bit more, I think that if you did have another metaclass which is its own metaclass then the class cannot subclass 'object'. You could if the metaclass of your metaclass inherited from 'type'. Then your types could still be

Re: using re module to find but not alone ... is this a BUG in re?

2008-06-12 Thread Peter Otten
anton wrote: I want to replace all occourences of by \ in a string. But I want to leave all occourences of \ as they are. The following should happen: this I want while I dont want this \ should be transformed to: this I want \ while I dont want this \ and NOT: this

Re: get keys with the same values

2008-06-12 Thread Chris
On Jun 12, 2:15 pm, Nader [EMAIL PROTECTED] wrote: On Jun 12, 2:05 pm, Chris [EMAIL PROTECTED] wrote: On Jun 12, 1:48 pm, Nader [EMAIL PROTECTED] wrote: On Jun 12, 1:35 pm, [EMAIL PROTECTED] wrote: Nader: d = {('a' : 1), ('b' : 3), ('c' : 2),('d' : 3),('e' : 1),('f' : 4)}

Re: Plotting Graphs using Gnuplot

2008-06-12 Thread Fuzzyman
On Jun 12, 12:30 pm, [EMAIL PROTECTED] wrote: Hello. Was trying to create a simple plotting function. Wasnt working however. If i write the same code without putting it inside a function it works. :S. Could some1 tell me the problem? Heres the code: # File name Plotting2 import Gnuplot

Re: regex for balanced parentheses?

2008-06-12 Thread Paul McGuire
On Jun 12, 6:06 am, David C. Ullrich [EMAIL PROTECTED] wrote: There's no regex that detects balanced parentheses, or is there? That is, search('and so ((x+y)+z) = (x+(y+z))') should return '((x+y)+z)'. Not just a theoretical question, I'm cleaning up a large body of TeX code and a regex

Re: get keys with the same values

2008-06-12 Thread Paul McGuire
On Jun 12, 6:41 am, David C. Ullrich [EMAIL PROTECTED] wrote: On Thu, 12 Jun 2008 03:58:53 -0700 (PDT), Nader [EMAIL PROTECTED] wrote: Hello, I have a dictionary and will get all keys which have the same values. snip d = {'a' : 1, 'b' : 3, 'c' : 2,'d' : 3,'e' : 1,'f' : 4} dd = {} for

Summing a 2D list

2008-06-12 Thread Mark
Hi all, I have a scenario where I have a list like this: UserScore 1 0 1 1 1 5 2 3 2 1 3 2 4 3 4 3 4 2 And I need to add up the score for

Re: Summing a 2D list

2008-06-12 Thread Diez B. Roggisch
Mark wrote: Hi all, I have a scenario where I have a list like this: UserScore 1 0 1 1 1 5 2 3 2 1 3 2 4 3 4 3 4 2 And I

Re: Plotting Graphs using Gnuplot

2008-06-12 Thread Peter Otten
[EMAIL PROTECTED] wrote: Hello. Was trying to create a simple plotting function. Wasnt working however. If i write the same code without putting it inside a function it works. :S. Could some1 tell me the problem? Judging from the demo you have to keep a Gnuplot.Gnuplot instance alive. If you

Re: Summing a 2D list

2008-06-12 Thread Benjamin Kaplan
On Thu, Jun 12, 2008 at 9:48 AM, Mark [EMAIL PROTECTED] wrote: Hi all, I have a scenario where I have a list like this: UserScore 1 0 1 1 1 5 2 3 2 1 3 2 4 3 4

Re: re quiz

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 05:12:55 -0700 (PDT), John Machin [EMAIL PROTECTED] wrote: On Jun 12, 8:57 pm, David C. Ullrich [EMAIL PROTECTED] wrote: True or False? (no fair looking it up) (*) If repl is a string then re.sub(pattern, repl, s) returns s with non-overlapping occurences of pattern

Re: Alternative to Decimal type

2008-06-12 Thread Grant Edwards
On 2008-06-12, Dennis Lee Bieber [EMAIL PROTECTED] wrote: If you were to follow the footsteps of COBOL, you'd be using BCD internally, with a special code to represent the decimal point (and maybe, to save space, the sign too) Old mainframes had instructions to work with packed BCD as a

Re: Summing a 2D list

2008-06-12 Thread Chris
On Jun 12, 3:48 pm, Mark [EMAIL PROTECTED] wrote: Hi all, I have a scenario where I have a list like this: User            Score 1                 0 1                 1 1                 5 2                 3 2                 1 3                 2 4                 3 4                

Re: re quiz

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 14:12:31 +0200, Peter Otten [EMAIL PROTECTED] wrote: David C. Ullrich wrote: (Or is there a function somewhere that will convert r\remark{Hint} to r\\remark{Hint} for me, and do the same for precisely the escpapes referred to in the and so forth?) I think you just have

Re: Simple and safe evaluator

2008-06-12 Thread Grant Edwards
On 2008-06-12, Hans Nowak [EMAIL PROTECTED] wrote: bvdp 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

Re: Summing a 2D list

2008-06-12 Thread Mark
On Jun 12, 3:02 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Mark wrote: Hi all, I have a scenario where I have a list like this: User            Score 1                 0 1                 1 1                 5 2                 3 2                 1 3                 2 4  

Making wxPython a standard module?

2008-06-12 Thread John Salerno
Just out of curiosity, what are the chances of this happening (sort of like what happened with sqlite)? I read somewhere that Guido said the only reason Tkinter is still the standard GUI module instead of wxPython is because it was there first. Perhaps a joke, but it got me thinking that there

Re: Finding a sense of word in a text

2008-06-12 Thread Vlastimil Brom
2008/6/11, Sengly [EMAIL PROTECTED]: 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

Re: re quiz

2008-06-12 Thread David C. Ullrich
On 12 Jun 2008 12:32:13 GMT, Duncan Booth [EMAIL PROTECTED] wrote: David C. Ullrich [EMAIL PROTECTED] wrote: Practical question: What's a _complete_ list of the escapes included in the and so forth in (**)? (Or is there a function somewhere that will convert r\remark{Hint} to

Re: Summing a 2D list

2008-06-12 Thread Aidan
Mark wrote: Hi all, I have a scenario where I have a list like this: UserScore 1 0 1 1 1 5 2 3 2 1 3 2 4 3 4 3 4 2 And I need to add up

Comments on my first script?

2008-06-12 Thread Phillip B Oldham
I'm keen on learning python, with a heavy lean on doing things the pythonic way, so threw the following script together in a few hours as a first-attempt in programming python. I'd like the community's thoughts/comments on what I've done; improvements I can make, don'ts I should be avoiding, etc.

Re: Summing a 2D list

2008-06-12 Thread John Salerno
Mark [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Jun 12, 3:02 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Mark wrote: --- This was my (failed) attempt: predictions = Prediction.objects.all() scores = [] for prediction in predictions: i = [prediction.predictor.id, 0] if

Re: regex for balanced parentheses?

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 06:38:16 -0700 (PDT), Paul McGuire [EMAIL PROTECTED] wrote: On Jun 12, 6:06 am, David C. Ullrich [EMAIL PROTECTED] wrote: There's no regex that detects balanced parentheses, or is there? [...] Pyparsing includes several helper methods for building common expression

Re: Summing a 2D list

2008-06-12 Thread Diez B. Roggisch
To be honest I'm relatively new to Python, so I don't know too much about how all the loop constructs work and how they differ to other languages. I'm building an app in Django and this data is coming out of a database and it looks like what I put up there! This was my (failed) attempt:

Re: Summing a 2D list

2008-06-12 Thread Mark
John, it's a QuerySet coming from a database in Django. I don't know enough about the structure of this object to go into detail I'm afraid. Aidan, I got an error trying your suggestion: 'zip argument #2 must support iteration', I don't know what this means! Thanks to all who have answered!

Re: Summing a 2D list

2008-06-12 Thread Aidan
Mark wrote: John, it's a QuerySet coming from a database in Django. I don't know enough about the structure of this object to go into detail I'm afraid. Aidan, I got an error trying your suggestion: 'zip argument #2 must support iteration', I don't know what this means! well, if we can create

Re: Making wxPython a standard module?

2008-06-12 Thread Diez B. Roggisch
Just out of curiosity, what are the chances of this happening (sort of like what happened with sqlite)? I read somewhere that Guido said the only reason Tkinter is still the standard GUI module instead of wxPython is because it was there first. Perhaps a joke, but it got me thinking that

Re: Making wxPython a standard module?

2008-06-12 Thread Paul Boddie
On 12 Jun, 16:18, John Salerno [EMAIL PROTECTED] wrote: Just out of curiosity, what are the chances of this happening (sort of like what happened with sqlite)? Plenty of prior discussion here:

Re: Summing a 2D list

2008-06-12 Thread Aidan
Aidan wrote: Mark wrote: John, it's a QuerySet coming from a database in Django. I don't know enough about the structure of this object to go into detail I'm afraid. Aidan, I got an error trying your suggestion: 'zip argument #2 must support iteration', I don't know what this means! well, if

Making wxPython a standard module?

2008-06-12 Thread Andrea Gavana
Hi Diez All, And on a personal note: I find it *buttugly*. Do you mind explaining why you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that I won't make any comment on this thread in particular, but I am curious to know why some people find

Re: Strange cjson bug doesn't occur in Pydb

2008-06-12 Thread kj
[Note: I changed the subject line to make it more informative.] In [EMAIL PROTECTED] Diez B. Roggisch [EMAIL PROTECTED] writes: kj wrote: In [EMAIL PROTECTED] Diez B. Roggisch [EMAIL PROTECTED] writes: kj schrieb: I'm running into a strange seg fault with the module cjson. The strange

Plotting Graph Functions using Gnuplot

2008-06-12 Thread arslanburney
Hello. Needed some help again. Im trying to calculate the best fit line here. Given a set of points in a list. However, wirte in the end where i plot the line it tells me tht the variable is not defined. Either try correcting this or tell me a subsitute that i could use. Thnks. Heres the code:

Re: Making wxPython a standard module?

2008-06-12 Thread Mike Driscoll
On Jun 12, 9:55 am, Andrea Gavana [EMAIL PROTECTED] wrote: Hi Diez All, And on a personal note: I find it *buttugly*. Do you mind explaining why you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that I won't make any comment on this

Re: can't assign to literal

2008-06-12 Thread Ethan Furman
TheSaint 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 the width is 78 chars it wouldn't have jig saw

Re: Summing a 2D list

2008-06-12 Thread Gerhard Häring
Mark wrote: John, it's a QuerySet coming from a database in Django. I don't know enough about the structure of this object to go into detail I'm afraid. [...] Then let the database do the summing up. That's what it's there for :-) select user, sum(score) from score_table group by user or

Counting things fast - was Re: Summing a 2D list

2008-06-12 Thread Gerhard Häring
Aidan wrote: does this work for you? users = [1,1,1,2,2,3,4,4,4] score = [0,1,5,3,1,2,3,3,2] d = dict() for u,s in zip(users,score): if d.has_key(u): d[u] += s else: d[u] = s for key in d.keys(): print 'user: %d\nscore: %d\n' % (key,d[key]) I've recently had the very same

Re: Comments on my first script?

2008-06-12 Thread John Salerno
Phillip B Oldham [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'd like the community's thoughts/comments on what I've done; improvements I can make, don'ts I should be avoiding, etc. I'm not so much bothered about the resulting data - for the moment it meets my needs. But any

Re: time.clock() or Windows bug?

2008-06-12 Thread mgenti
Don't forget that timeit module uses time.clock on windows as well: if sys.platform == win32: # On Windows, the best timer is time.clock() default_timer = time.clock else: # On most other platforms the best timer is time.time() default_timer = time.time

Re: re quiz

2008-06-12 Thread Johannes Bauer
David C. Ullrich schrieb: -- care to tell us what a certain re.sub is, and false in what way? Read the OP. Well, aren't you funny. Maybe you should have referenced the other thread so one can find the OP? Regards, Johannes -- Wer etwas kritisiert muss es noch lange nicht selber besser

Re: Making wxPython a standard module?

2008-06-12 Thread John Salerno
Diez B. Roggisch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This has been discussed before. While tkInter might not be the greatest toolkit out there it has two extreme advantages: - it is comparably small regarding the footprint. Few external dependencies, small libraries,

Re: Comments on my first script?

2008-06-12 Thread John Salerno
John Salerno [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if domain.endswith(.net): rec = clean_net(rec) if domain.endswith(.com): rec = clean_net(rec) if domain.endswith(.tv): rec = clean_net(rec) if domain.endswith(.co.uk): rec = clean_co_uk(rec) if

Re: regex for balanced parentheses?

2008-06-12 Thread Paul McGuire
Parsing TeX is definitely not for the faint-of-heart! You might try something like QuotedString('$', escQuote='$$') in pyparsing. (I've not poked at TeX or its ilk since the mid-80's so my TeXpertise is long rusted away.) I know of two projects that have taken on the problem using pyparsing -

Re: Making wxPython a standard module?

2008-06-12 Thread Ed Leafe
On Jun 12, 2008, at 10:55 AM, Andrea Gavana wrote: And on a personal note: I find it *buttugly*. Do you mind explaining why you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that I won't make any comment on this thread in particular, but I

Re: Comments on my first script?

2008-06-12 Thread Chris
On Jun 12, 4:27 pm, Phillip B Oldham [EMAIL PROTECTED] wrote: I'm keen on learning python, with a heavy lean on doing things the pythonic way, so threw the following script together in a few hours as a first-attempt in programming python. I'd like the community's thoughts/comments on what

Re: Summing a 2D list

2008-06-12 Thread Mark
On Jun 12, 3:45 pm, Aidan [EMAIL PROTECTED] wrote: Aidan wrote: Mark wrote: John, it's a QuerySet coming from a database in Django. I don't know enough about the structure of this object to go into detail I'm afraid. Aidan, I got an error trying your suggestion: 'zip argument #2 must

FPC: Exception : Unknown Run-Time error : 210

2008-06-12 Thread Sa�a Bistrovi�
Sa¹a Bistroviæ Antuna Mihanviæa 13 4 Èakovec Croatia [EMAIL PROTECTED] FPC: Exception : Unknown Run-Time error : 210 Hi, I'm Sa¹a from Croatia. And I have : Windows XP PRO SP3. Pentium II MMX 400MHz. 256 MB of RAM. I tried to compile fp.pas. But I get this error message : 'Running

Re: Making wxPython a standard module?

2008-06-12 Thread Andrea Gavana
Hi Ed All, On Thu, Jun 12, 2008 at 4:11 PM, Ed Leafe wrote: On Jun 12, 2008, at 10:55 AM, Andrea Gavana wrote: And on a personal note: I find it *buttugly*. Do you mind explaining why you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that

Re: regex for balanced parentheses?

2008-06-12 Thread Tim Arnold
Paul McGuire [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Parsing TeX is definitely not for the faint-of-heart! You might try something like QuotedString('$', escQuote='$$') in pyparsing. (I've not poked at TeX or its ilk since the mid-80's so my TeXpertise is long rusted

Re: Making wxPython a standard module?

2008-06-12 Thread bearophileHUGS
Andrea Gavana: Maybe. But I remember a nice quote made in the past by Roger Binns (4 years ago): The other thing I failed to mention is that the wxPython API isn't very Pythonic. (This doesn't matter to people like me who are used to GUI programming - the wxPython API is very much in the

Re: Simple and safe evaluator

2008-06-12 Thread Matimus
On Jun 11, 9:16 pm, George Sakkis [EMAIL PROTECTED] wrote: 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

  1   2   3   >