Re: import of ttk

2013-01-04 Thread Terry Reedy
On 1/4/2013 11:02 PM, Verde Denim wrote: In reading through one of the learning articles, I have a bit of code that imports ttk, but I apparently don't have this installed. I've looked up the svn checkout for python-tk, and have checked it out (read-only), but still get the same error. I'm runnin

import of ttk

2013-01-04 Thread Verde Denim
In reading through one of the learning articles, I have a bit of code that imports ttk, but I apparently don't have this installed. I've looked up the svn checkout for python-tk, and have checked it out (read-only), but still get the same error. I'm running 2.6.6 python, if that helps. The article

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-04 Thread Roy Smith
In article , Cameron Simpson wrote: > On 01/04/13 01:34, Anssi Saari wrote: > | Just curious since I read the same thing in a programming book recently > | (21st century C). So what's the greatness that terminal multiplexors > | offer over tabbed terminals? Especially for software development?

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-04 Thread Cameron Simpson
On 01/04/13 01:34, Anssi Saari wrote: | Just curious since I read the same thing in a programming book recently | (21st century C). So what's the greatness that terminal multiplexors | offer over tabbed terminals? Especially for software development? Do you include tiling terminal emulators? I use

Re: pygame - importing GL - very bad...

2013-01-04 Thread Dave Angel
On 01/04/2013 08:10 PM, someone wrote: > On 01/03/2013 03:09 PM, Mike C. Fletcher wrote: >> > >> PyOpenGL's current approach is mostly attempting to maintain backward >> compatibility with the older revisions. wxPython actually rewrote its >> whole interface to go from * imports into namespaced l

Re: pylint, was Re: pygame - importing GL - very bad...

2013-01-04 Thread someone
On 01/03/2013 03:56 AM, Dave Angel wrote: The first lint program I recall hearing of was available in the early 1980's, and was for the C language. At the time, the C language was extremely flexible (in other words, lots of ways to shoot yourself in the foot) and the compiler was mostly of the p

Re: Regular expression syntax, was Re: pylint, was Re: pygame - importing GL - very bad...

2013-01-04 Thread someone
On 01/03/2013 12:39 PM, Peter Otten wrote: someone wrote: On 01/03/2013 10:00 AM, Peter Otten wrote: Terry Reedy wrote: [a-z_][a-z0-9_]{2,30}$) - so I suppose it wants this name to end with [an underscore ? No, it allows underscores. As I read that re, 'rx', etc, do match. They No, it's

Re: pylint, was Re: pygame - importing GL - very bad...

2013-01-04 Thread someone
On 01/03/2013 12:27 PM, Chris Angelico wrote: On Thu, Jan 3, 2013 at 10:19 PM, someone wrote: Doesn't this "[ ... ]" mean something optional? What does {2,30}$ mean? I think $ means that the {2,30} is something in the end of the sentence... You can find regular expression primers all over t

Re: pygame - importing GL - very bad...

2013-01-04 Thread someone
On 01/03/2013 03:09 PM, Mike C. Fletcher wrote: On 13-01-02 08:53 PM, someone wrote: So this solution is not something I like too... But I can see some other people came up with good solutions, which I didn't knew about.. Why is this solution not to your liking? Python has namespaces for a

Re: pylint, was Re: pygame - importing GL - very bad...

2013-01-04 Thread someone
On 01/03/2013 05:52 PM, Terry Reedy wrote: That seems like a improper error message from the tool. "Invalid name" does *not* properly describe that situation. The name is *not* "Invalid" in any sense of the word, and a "checker" that tells you it is is creating needless false-positives. An er

Re: problem with exam task for college

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 7:01 AM, wrote: > woow jeezes, thanks for the amazingly fast and detailed response, you guys > are amazing. > > thanks again, are you guys getting paid for this or is this voluntarily? > either way i really appreciate it We're all volunteers (and it's now 7:30AM Saturday

Re: problem with exam task for college

2013-01-04 Thread jeltedeproft
woow jeezes, thanks for the amazingly fast and detailed response, you guys are amazing. let's clear a few things up : 1) points is a module in vpython to make points, the points do in fact appear although its not really the effect i intended to have, the points are "lined up" in stead of ran

Re: problem with exam task for college

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 6:18 AM, Joshua Landau wrote: > It might measure a brand in femtometers ;). LOL! > But, seriously, it's Dutch for Fuel Gauge. Google told me, in case you think > I know Dutch, but it's in the Python Spirit either way. > > ruimteschip -> Spaceship > hoek -> angle > sterren

Re: problem with exam task for college

2013-01-04 Thread Joshua Landau
On 4 January 2013 19:00, Chris Angelico wrote: > On Sat, Jan 5, 2013 at 5:59 AM, Chris Angelico wrote: > > Google tells me that brandstofmeter might mean "Babylon 9" > > And by the way, in case it didn't come across, I'm jesting there. What > I mean is that Google didn't have any useful and obvi

Re: problem with exam task for college

2013-01-04 Thread MRAB
On 2013-01-04 18:59, Chris Angelico wrote: On Sat, Jan 5, 2013 at 5:23 AM, wrote: hy everyone, for my exam this year i had to write a computer game on vpython (visualpython).we had to make a lunar lander game where the ship drops by gravity and is able to manouver to safely land on the moon.

Re: Evaluate postgres boolean field

2013-01-04 Thread John Gordon
In andydtay...@gmail.com writes: > for row in cursor: > row_count += 1 > if row[4] = True > print row[1] Since row[4] is a boolean value, you should be able to just say: if row[4]: print row[1] -- John Gordon

Re: problem with exam task for college

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 5:59 AM, Chris Angelico wrote: > Google tells me that brandstofmeter might mean "Babylon 9" And by the way, in case it didn't come across, I'm jesting there. What I mean is that Google didn't have any useful and obvious results indicating what this actually means. But I'm g

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 5:43 AM, Grant Edwards wrote: > On 2013-01-04, Chris Angelico wrote: >> On Sat, Jan 5, 2013 at 5:09 AM, Grant Edwards >> wrote: >>> The error messages are still pretty cryptic, so improving >>> that will add a few more lines. One nice thing about the ast code is >>> that

Re: problem with exam task for college

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 5:23 AM, wrote: > hy everyone, for my exam this year i had to write a computer game on vpython > (visualpython).we had to make a lunar lander game where the ship drops by > gravity and is able to manouver to safely land on the moon.right now i am > completely stuck on tr

Re: Evaluate postgres boolean field

2013-01-04 Thread donarb
On Friday, January 4, 2013 10:08:22 AM UTC-8, andyd...@gmail.com wrote: > Hi, > > I'm hoping for some help on a python script I need to query an api. I'm not a > (Python) programmer ordinarily, but do plan to improve! > > Specifically I have a for loop evaluating a database row, which I think I

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Chris Angelico wrote: > On Sat, Jan 5, 2013 at 5:09 AM, Grant Edwards wrote: >> The error messages are still pretty cryptic, so improving >> that will add a few more lines. One nice thing about the ast code is >> that it's simple to add code to allow C-like character constants suc

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 5:09 AM, Grant Edwards wrote: > The error messages are still pretty cryptic, so improving > that will add a few more lines. One nice thing about the ast code is > that it's simple to add code to allow C-like character constants such > that ('A' === 0x41). Here's the first

problem with exam task for college

2013-01-04 Thread jeltedeproft
hy everyone, for my exam this year i had to write a computer game on vpython (visualpython).we had to make a lunar lander game where the ship drops by gravity and is able to manouver to safely land on the moon.right now i am completely stuck on trying to make the visual of the ship rotate.i'm ne

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Alister
On Fri, 04 Jan 2013 13:33:41 +, Steven D'Aprano wrote: > On Fri, 04 Jan 2013 07:24:04 -0500, Terry Reedy wrote: > >> On 1/3/2013 6:25 PM, Grant Edwards wrote: >>> >>> I've written a small assembler in Python 2.[67], and it needs to >>> evaluate integer-valued arithmetic expressions in the con

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Chris Angelico wrote: > On Sat, Jan 5, 2013 at 4:14 AM, Grant Edwards wrote: >> On 2013-01-04, Chris Angelico wrote: >>> On Sat, Jan 5, 2013 at 3:38 AM, Grant Edwards >>> wrote: >> I've added equals, backslash, commas, square/curly brackets, colons and semicolons to th

Evaluate postgres boolean field

2013-01-04 Thread andydtaylor
Hi, I'm hoping for some help on a python script I need to query an api. I'm not a (Python) programmer ordinarily, but do plan to improve! Specifically I have a for loop evaluating a database row, which I think I can treat as a list. My [4] is a postgres boolean field, and I'm temporarily stuck

RE: 'subprocess.check_output' extra new line?

2013-01-04 Thread sbremal
Very good point, you are absolutely right: # cygpath C:\\ | od -c 000 / c y g d r i v e / c \n 014 'bash' manual also confirms it: Command Substitution Command substitution allows the output of a command to replace the command name. There are two

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 4:14 AM, Grant Edwards wrote: > On 2013-01-04, Chris Angelico wrote: >> On Sat, Jan 5, 2013 at 3:38 AM, Grant Edwards >> wrote: > >>> I've added equals, backslash, commas, square/curly brackets, colons >>> and semicolons to the prohibited character list. I also reduced th

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Chris Angelico wrote: > On Sat, Jan 5, 2013 at 3:38 AM, Grant Edwards wrote: >> I've added equals, backslash, commas, square/curly brackets, colons >> and semicolons to the prohibited character list. I also reduced the >> maximum length to 60 characters. It's unfortunate that par

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-04 Thread Tim Chase
On 01/04/13 01:34, Anssi Saari wrote: Ben Finney writes: And any decent Unix-alike (most OSen apart from Windows) comes with its own IDE: the shell, a good text editor (Vim or Emacs being the primary candidates), and a terminal multiplexor (such as ‘tmux’ or GNU Screen). Just curious since I

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 3:38 AM, Grant Edwards wrote: > I've added equals, backslash, commas, square/curly brackets, colons and > semicolons to the > prohibited character list. I also reduced the maximum length to 60 > characters. It's unfortunate that parentheses are overloaded for both > expres

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Steven D'Aprano wrote: > On Thu, 03 Jan 2013 23:25:51 +, Grant Edwards wrote: > >> I've written a small assembler in Python 2.[67], and it needs to >> evaluate integer-valued arithmetic expressions in the context of a >> symbol table that defines integer values for a set of name

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-04 Thread jrodkeyjr
If you are going to review an IDE, or multiple, I would recommend Komodo and Komodo Edit. On Thursday, December 27, 2012 2:01:16 PM UTC-6, mogul wrote: > 'Aloha! > > > > I'm new to python, got 10-20 years perl and C experience, all gained on unix > alike machines hacking happily in vi, and la

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Michael Torrie wrote: > On 01/04/2013 08:53 AM, Grant Edwards wrote: >> That's obviously the "right" thing to do. I suppose I should figure >> out how to use the ast module. > > Or PyParsing. > > As for your program being "secure" I don't see that there's much to > exploit. Ther

Re: 'subprocess.check_output' extra new line?

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 2:50 AM, wrote: > > Hi > > I wonder if the additional new line charachter at the end of the standard > output capture is on purpose with 'subprocess.check_output'? > subprocess.check_output([ 'cygpath', 'C:\\' ]) > '/cygdrive/c\n' > > If I do the same from the shell t

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Michael Torrie
On 01/04/2013 08:53 AM, Grant Edwards wrote: > That's obviously the "right" thing to do. I suppose I should figure > out how to use the ast module. Or PyParsing. As for your program being "secure" I don't see that there's much to exploit. You're not running as a service, and you're not runnin

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Steven D'Aprano wrote: > On Fri, 04 Jan 2013 07:24:04 -0500, Terry Reedy wrote: > >> On 1/3/2013 6:25 PM, Grant Edwards wrote: >>> >>> I've written a small assembler in Python 2.[67], and it needs to >>> evaluate integer-valued arithmetic expressions in the context of a >>> symbol t

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Steven D'Aprano wrote: > On Thu, 03 Jan 2013 23:25:51 +, Grant Edwards wrote: > >> I've written a small assembler in Python 2.[67], and it needs to >> evaluate integer-valued arithmetic expressions in the context of a >> symbol table that defines integer values for a set of name

'subprocess.check_output' extra new line?

2013-01-04 Thread sbremal
Hi I wonder if the additional new line charachter at the end of the standard output capture is on purpose with 'subprocess.check_output'? >>> subprocess.check_output([ 'cygpath', 'C:\\' ]) '/cygdrive/c\n' If I do the same from the shell there is no extra new line (which is correct I believe):

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-04 Thread Chris Angelico
On Fri, Jan 4, 2013 at 6:34 PM, Anssi Saari wrote: > Ben Finney writes: > >> And any decent Unix-alike (most OSen apart from Windows) comes with its >> own IDE: the shell, a good text editor (Vim or Emacs being the primary >> candidates), and a terminal multiplexor (such as ‘tmux’ or GNU Screen).

Re: Missing something obvious with python-requests

2013-01-04 Thread Chris Angelico
On Sat, Jan 5, 2013 at 2:00 AM, Hans Mulder wrote: > It the proxy URL is http://192.168.24.25/, then the client should send > GET requests to the proxy in both cases, and the proxy should send GET > or CONNECT to the origin server, depending on whether origin URL uses > SSL. > > If the proxy URL i

Re: Missing something obvious with python-requests

2013-01-04 Thread Hans Mulder
On 4/01/13 03:56:47, Chris Angelico wrote: > On Fri, Jan 4, 2013 at 5:53 AM, Ray Cote > wrote: >> proxies = { >> 'https': '192.168.24.25:8443', >> 'http': '192.168.24.25:8443', } >> >> a = requests.get('http://google.com/', proxies=proxies) >> >> >> When I look at the proxy log, I see a GE

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-04 Thread Anssi Saari
Ben Finney writes: > Hans Mulder writes: > >> Don't bother: Python comes with a free IDE named IDLE. > > And any decent Unix-alike (most OSen apart from Windows) comes with its > own IDE: the shell, a good text editor (Vim or Emacs being the primary > candidates), and a terminal multiplexor (suc

Bias correction using histogram matching

2013-01-04 Thread user123
I am trying to do the histogram matching of the simulated data to the observed data. The aim is to correct the bias in the simulated data by CDF matching CDFobs(y) = CDFsim(x). I could only reach to the stage of generating the CDFs. I got stuck in finding the transfer function. The image shows

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Steven D'Aprano
On Fri, 04 Jan 2013 07:24:04 -0500, Terry Reedy wrote: > On 1/3/2013 6:25 PM, Grant Edwards wrote: >> >> I've written a small assembler in Python 2.[67], and it needs to >> evaluate integer-valued arithmetic expressions in the context of a >> symbol table that defines integer values for a set of n

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Terry Reedy
On 1/3/2013 6:25 PM, Grant Edwards wrote: I've written a small assembler in Python 2.[67], and it needs to evaluate integer-valued arithmetic expressions in the context of a symbol table that defines integer values for a set of names. The "right" thing is probably an expression parser/evaluator

Re: Question on for loop

2013-01-04 Thread Alister
On Thu, 03 Jan 2013 12:04:03 -0800, subhabangalore wrote: > Dear Group, > If I take a list like the following: > > fruits = ['banana', 'apple', 'mango'] > for fruit in fruits: >print 'Current fruit :', fruit > > Now, > if I want variables like var1,var2,var3 be assigned to them, we may > ta

MRG.COM

2013-01-04 Thread M.gowtham M.gowtham
comp.lang.python -- http://mail.python.org/mailman/listinfo/python-list