Re: If Dict Contains a particular key

2007-04-25 Thread John Nagle
[EMAIL PROTECTED] wrote: > On Apr 24, 1:41 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > >>Steven Howe wrote: >> >>>Carsten Haese wrote: >>> On Tue, 2007-04-24 at 18:28 +0100, Robert Rawlins - Think Blue wrote: >> >Hello Guys, >> >I'm Looking to build a quick if/else statement that c

Re: freeze and problem with static libraries

2007-04-25 Thread Flyzone
On 24 Apr, 17:23, Flyzone <[EMAIL PROTECTED]> wrote: > I get this warning on freezing my source: I use the command: ./Python-2.3.6/Tools/freeze/freeze.py /path/to/my/file.py -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple sqlite3 question

2007-04-25 Thread Tim Roberts
cjl <[EMAIL PROTECTED]> wrote: > >I am using python 2.5.1 on windows. I have the following code: > >conn = sqlite3.connect('.\optiondata') This is unrelated to your question, but you have a slash problem there. \o doesn't happen to be a valid escape character, but if you had used "testdata" as th

embedding matplotlib in wxpython

2007-04-25 Thread Soren
Hi, I've been trying to embed matplotlib in wxpython. I want to be able to put a figure (axes) in a wx.Panel and place it somewhere in my GUI. The GUI should have other panels with buttons etc. that can control the output on the figure. I've been looking at the examples from the matplotlib website

Re: My python annoyances so far

2007-04-25 Thread Steven D'Aprano
On Wed, 25 Apr 2007 15:50:53 -0700, flifus wrote: > > Hi all. I'm learning python these days. I'm going to use this thread > to post, from time to time, my annoyances with python. I hope someone > will clarify things to me where I have misunderstood them. > > Annoyances: > > 1. Underscores! Wha

python loop performance

2007-04-25 Thread mahdieh saeed
I use python and berkeley db for my application.(use bsddb3) Use freebsd operating system. My question is about loop that I use for my application.I use loop like this for fetch information. info=cur.get(key,DB_SET) while info: info=cur.next() If this loop fetch 1 records taking alot of

Re: override settrace

2007-04-25 Thread Gabriel Genellina
En Wed, 25 Apr 2007 02:05:57 -0300, Raja <[EMAIL PROTECTED]> escribió: > I want to override the sys.settrace() call, create a way to trace > the execution of a python program. Keep track of all objects created > and destroyed. Keep track of the call pattern throughout the execution > of the prog

Re: Preferred Random Library

2007-04-25 Thread Robert Kern
Bill Jackson wrote: > Is there a preferred random library? > > scipy.random > random > > Besides scipy's library returning ndarrays, is there any other > advantage/disadvantage? numpy.random (since that's where scipy.random comes from, I recommend always referring to it as numpy.random) can be

Re: If Dict Contains a particular key

2007-04-25 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: ... > > if 'a' in thedict: > > ... > > > > There's no need for the call to keys(). > > Why not > > if thedict.has_key('a'): > pass > elde: > pass has_key exists only for backwards compatibility; the 'in' operator is preferable

Re: kwarg references

2007-04-25 Thread Gabriel Genellina
En Tue, 24 Apr 2007 22:31:59 -0300, Calvin Spealman <[EMAIL PROTECTED]> escribió: > In the internal API when a C function is called and passed a kwarg > dictionary, is there any case where anything else has a reference to > it? I checked with the following code and it looks like even if you > ex

Re: Now()

2007-04-25 Thread Frank Millman
On Apr 25, 2:01 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Robert Rawlins - Think Blue wrote: > > > I'm using the following function 'str (now)' to place a date time stamp into > > a log file, which works fine, however it writes the stamp like this. > > 2007-04-25 11:06:53.873029 > > But I need to

Re: If Dict Contains a particular key

2007-04-25 Thread [EMAIL PROTECTED]
On Apr 24, 1:41 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Steven Howe wrote: > > Carsten Haese wrote: > >> On Tue, 2007-04-24 at 18:28 +0100, Robert Rawlins - Think Blue wrote: > > >>> Hello Guys, > > >>> I'm Looking to build a quick if/else statement that checks a > >>> dictionary for a key

Re: Preferred Random Library

2007-04-25 Thread Bill Jackson
Paul Rubin wrote the following on 04/25/2007 10:17 PM: > Bill Jackson <[EMAIL PROTECTED]> writes: >> Is there a preferred random library? > > Preferred for what? Maybe you want os.urandom(). How about for general usage...I am just asking for a very broad description of the advantages/disadvanta

Re: MS SQL Server Extension?

2007-04-25 Thread Frank Millman
On Apr 25, 9:44 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Jack wrote: > > Hi all, in my next project, my Python code needs to talk to an MS SQL > > 2000 Server. Internet search gives mehttp://pymssql.sourceforge.net/ > > I wonder what module(s) people are using. My code runs on a Linux > > box so

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Michele Simionato
On Apr 24, 11:24 am, Jeff Rush <[EMAIL PROTECTED]> wrote: > There is discussion by the Python Software Foundation of offering cash > bounties or perhaps periodic awards to the "best of" for magazine articles, > video/screencast clips and such. > I would be +1 for offering symbolic prices (i.e. Pyt

Re: Video: Professor of Physics Phd at Cal Tech says: 911 Inside Job

2007-04-25 Thread thermate
So the truth is unstoppable indeed . On Apr 24, 7:12 pm, [EMAIL PROTECTED] wrote: > Cal Tech is the ELITE of ELITE in physics. > > If Feynman were alive, he would point his finger straight at the 911 > criminal operators, the yank bastards themselves ... > > http://www.911blogger.com/n

Re: Preferred Random Library

2007-04-25 Thread Paul Rubin
Bill Jackson <[EMAIL PROTECTED]> writes: > Is there a preferred random library? Preferred for what? Maybe you want os.urandom(). -- http://mail.python.org/mailman/listinfo/python-list

random.py

2007-04-25 Thread Bill Jackson
In random.py (Python 2.5.1), line 86 says: VERSION = 2# used by getstate/setstate Then, in the definition of Random.setstate, we have: if version == 2: Why is it not: if version == self.VERSION: -- http://mail.python.org/mailman/listinfo/python-list

Video: Professor of Physics, Phd at Cal Tech says: 911 Inside Job

2007-04-25 Thread stj911
Video: Professor of Physics, Phd at Cal Tech says: 911 Inside Job Cal Tech is the ELITE of ELITE in physics. If Feynman were alive, he would point his finger straight at the 911 criminal operators, the yank bastards themselves ... http://www.911blogger.com/node/8101 No self-respecting scien

Re: Feedback on Until recipe

2007-04-25 Thread Carsten Haese
On Wed, 2007-04-25 at 19:11 -0700, Paul McGuire wrote: > I moved the state into the Until instance vs. the Until class, so that > it now supports nesting. But the calling syntax is even uglier - but > necessary to avoid creating a new Until instance each time around. > That is "while Until(blah):"

Preferred Random Library

2007-04-25 Thread Bill Jackson
Is there a preferred random library? scipy.random random Besides scipy's library returning ndarrays, is there any other advantage/disadvantage? -- http://mail.python.org/mailman/listinfo/python-list

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread placid
On Apr 25, 4:40 pm, "Tennessee Leeuwenburg" <[EMAIL PROTECTED]> wrote: > Firstly, let me put up my hand and say that I would be happy to write > Python articles for cash. > I would be happy to write Python articles for a T-shirt with the Python logo printed on it. Maybe each article entrant can re

distance map

2007-04-25 Thread km
Hi all, Is there any module to make a network diagram given a 2-D matrix of distances ? any hints regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Another Python Game Programming Challenge concludes

2007-04-25 Thread Richard Jones
Richard Jones wrote: > Terry Reedy wrote: >> " ???" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> | The fourth Python Game Programming Challenge (PyWeek) has now concluded >> | with >> | judges (PyWeek being peer-judged) declaring the winners: >> | >> | Individual: Which w

Re: Where did my post go?

2007-04-25 Thread Donald 'Paddy' McCarthy
[EMAIL PROTECTED] wrote: > I posted to this newsgroup earlier about my annoyances with python and > now I can't find the post. What did you do with it? > I notice a gmail address. Google groups was not updated for over a day and is still 'behind'. Try another news reader. - Paddy -- http://mai

Re: Where did my post go?

2007-04-25 Thread James Stroud
[EMAIL PROTECTED] wrote: > I posted to this newsgroup earlier about my annoyances with python and > now I can't find the post. What did you do with it? > I guess it depends on your server. Here at UCLA, we still see it. -- http://mail.python.org/mailman/listinfo/python-list

Re: *** Watch BOMBSHELL video of Senator John Kerry admitting 911 was in INSIDE JOB ???

2007-04-25 Thread MooseFET
On Apr 24, 2:19 pm, "Jon Slaughter" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > >http://www.911blogger.com/node/8053 > > > Senator John Kerry was questioned concerning 9/11 during an appearance > > at Book People in Austin, Texas. Members of

Re: Where did my post go?

2007-04-25 Thread hg
[EMAIL PROTECTED] wrote: > > I posted to this newsgroup earlier about my annoyances with python and > now I can't find the post. What did you do with it? they found it annoying and removed it. hg -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback on Until recipe

2007-04-25 Thread Paul McGuire
I moved the state into the Until instance vs. the Until class, so that it now supports nesting. But the calling syntax is even uglier - but necessary to avoid creating a new Until instance each time around. That is "while Until(blah):" evaluates and constructs a new Until instance each time around

Re: Where's the source code for __builtin__?

2007-04-25 Thread Dustan
On Apr 24, 7:52 pm, John Machin <[EMAIL PROTECTED]> wrote: > On 25/04/2007 9:32 AM, Dustan wrote: > > > I've been paging through the source code for various C modules in > > python, and wanted to find the source of some of the builtin > > functions. I searched through the Modules, Objects, Python,

Re: Convert a string to a list

2007-04-25 Thread Paul McGuire
On Apr 24, 12:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > Someone normally chimes in with pyparsing at this point... > Well it *is* a short pyparsing routine, after all... -- Someone tests = """\ ("." ".." "cdslib_cleanup.py" "cadence.py" "cdsinit_cdsenv_cleanup.py") ("." ("cadence.p

Re: Feedback on Until recipe

2007-04-25 Thread Paul McGuire
On Apr 24, 11:08 am, Thomas Nelson <[EMAIL PROTECTED]> wrote: > Occasionally someone posts to this group complaining about the lack of > "repeat ... until" in python. I too have occasionally wished for such > a construct, and after some thinking, I came up with the class below. > I'm hoping to get

Re: Where did my post go?

2007-04-25 Thread John McMonagle
[EMAIL PROTECTED] wrote: > I posted to this newsgroup earlier about my annoyances with python and > now I can't find the post. What did you do with it? > How "annoying". Seriously though, I saw it - delivered at 8:50 AEST. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Charles Sanders
Grant Edwards wrote: > Assuming the python interpreter free()s the memory, my > understanding is that on Unixes the memory is returned to the > pool used by malloc(), but is not returned to the OS since > there isn't a practical way to ensure that the memory at the > "end" of the data segment is no

Where did my post go?

2007-04-25 Thread flifus
I posted to this newsgroup earlier about my annoyances with python and now I can't find the post. What did you do with it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Another Python Game Programming Challenge concludes

2007-04-25 Thread Richard Jones
Terry Reedy wrote: > " ???" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | The fourth Python Game Programming Challenge (PyWeek) has now concluded > | with > | judges (PyWeek being peer-judged) declaring the winners: > | > | Individual: Which way is up? by Hectigo > |htt

Re: Video: Professor of Physics Phd at Cal Tech says: 911 Inside Job

2007-04-25 Thread Bill Habr
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Cal Tech is the ELITE of ELITE in physics. > > If Feynman were alive, he would point his finger straight at the 911 > criminal operators, the yank bastards themselves ... > > http://www.911blogger.com/node/8101 > > No self-respectin

Re: bitwise shift?

2007-04-25 Thread Sherm Pendley
John Machin <[EMAIL PROTECTED]> writes: > On 26/04/2007 7:10 AM, Sherm Pendley wrote: > >> Shift left is *not* the same as multiplying by k. It is the same as multi- >> plying by 2^k. > > Where I come from, ^ is the exclusive-or operator. Of course YMMV in WV :-) Make that YMMV in VB. :-( Funny

Re: bitwise shift?

2007-04-25 Thread John Machin
On 26/04/2007 7:10 AM, Sherm Pendley wrote: > Shift left is *not* the same as multiplying by k. It is the same as multi- > plying by 2^k. Where I come from, ^ is the exclusive-or operator. Of course YMMV in WV :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: My python annoyances so far

2007-04-25 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi all. I'm learning python these days. I'm going to use this thread > to post, from time to time, my annoyances with python. Please start a new thread for each annoyance. Overuse of a single thread is an annoyance to a great many people. > I hope someone > will clar

Re: My python annoyances so far

2007-04-25 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi all. I'm learning python these days. I'm going to use this thread > to post, from time to time, my annoyances with python. I hope someone > will clarify things to me where I have misunderstood them. > > Annoyances: > > 1. Underscores! What's the deal with that? Espec

Re: freeze and problem with static libraries

2007-04-25 Thread Chris Miles
What command are you using to "freeze" your source? On Apr 24, 4:23 pm, Flyzone <[EMAIL PROTECTED]> wrote: > Hi, i need to "compile" a python source (2.3.6) to make it standalone > on Solaris 9. > I get this warning on freezing my source: > > "Warning: unknown modules remain: _locale _random _sock

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Diez B. Roggisch
TimC schrieb: > Donald 'Paddy' McCarthy <[EMAIL PROTECTED]> wrote > >> Could you split the program into one handling the outer loop and >> calling another program, with data transfer, to handle the inner >> loops? >> >> - Paddy. > > I'm afraid this isn't possible, because the python macro is call

Re: My python annoyances so far

2007-04-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi all. I'm learning python these days. I'm going to use this thread > to post, from time to time, my annoyances with python. I hope someone > will clarify things to me where I have misunderstood them. > > Annoyances: > > 1. Underscores! What's the deal with that? Esp

Re: MS SQL Server Extension?

2007-04-25 Thread Jack
Thanks Tim for the reply. Good info. I just set up pymssql. Setting it up was fairly straightforward. What kind of problems does it have with unicode? "Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jack wrote: >> Hi all, in my next project, my Python code needs to ta

My python annoyances so far

2007-04-25 Thread flifus
Hi all. I'm learning python these days. I'm going to use this thread to post, from time to time, my annoyances with python. I hope someone will clarify things to me where I have misunderstood them. Annoyances: 1. Underscores! What's the deal with that? Especially those double underscores. The be

Re: tkinter listbox

2007-04-25 Thread Gigs_
Gigs_ wrote: > I have two listbox on frame, and at same time i need to use one option > from both listbox. But when I click on first than on second listbox > first get deselected. > > How to make this? Is it possiblE? i found, just need to use exportselection=0 -- http://mail.python.org/mailman

Re: pydoc and imported modules

2007-04-25 Thread Joshua Schpok
I see. To make sure all my modules imported * are included in the pydocs, I'll add: __all__ = dir() to the end of my __init__.py file. Sometimes I implement a module with submodules, and flatten them out in __init__.py so the user sees it all as one single module. For example, module 'foobar' may

Re: getting scancodes

2007-04-25 Thread Andrés M .
>From: faulkner <[EMAIL PROTECTED]> >To: python-list@python.org >Subject: Re: getting scancodes >Date: 25 Apr 2007 14:02:59 -0700 > >On Apr 23, 8:39 pm, [EMAIL PROTECTED] wrote: > > Anyone knows if its possible to get scan codes ??? > > I tried with getch () but with no success, just keycodes. > >

Re: Namespaces/introspection: collecting sql strings for validation

2007-04-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Aahz <[EMAIL PROTECTED]> wrote: >>Alex: >>> >>>But don't put such black magic in production. The completely different >>>way is: just don't. >> >> Could you expand on that? After all, that's exactly what we do to >> implem

Re: tkinter listbox

2007-04-25 Thread Gigs_
I have two listbox on frame, and at same time i need to use one option from both listbox. But when I click on first than on second listbox first get deselected. How to make this? Is it possiblE? -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting question

2007-04-25 Thread Michael Hoffman
belinda thom wrote: > Hi, > > I've had a look at http://wiki.python.org/moin/HowTo/Sorting, but am not > sure if I can get the operator.itemgetter to do what I want for my > particular need. I'm also not sure why creating my own cmp for pulling > tuple parts out and passing it to a list sort do

Re: pydoc and imported modules

2007-04-25 Thread Ron Adam
[EMAIL PROTECTED] wrote: > When I "from foo import *" in my __init__.py, sometimes module foo's > docs will be expanded in the pydocs. It seems to depend in what > language foo was implemented. > > For example, if you "from math import *" in your __init__.py, you will > see math's members will app

Re: Controlling gnuplot via subprocess.Popen

2007-04-25 Thread Grant Edwards
On 2007-04-25, Peter Beattie <[EMAIL PROTECTED]> wrote: > I am trying to plot something in gnuplot 4.2 using co-ordinates a Python > 2.5 program computes. Here's what I'm doing: > > py> from subprocess import * > py> plot = Popen("c:/progs/gp/bin/wgnuplot.exe", stdin=PIPE) > py> plot.stdin.write("p

Re: bitwise shift?

2007-04-25 Thread Michael Hoffman
Jean-Paul Calderone wrote: > On Wed, 25 Apr 2007 22:54:12 +0200, desktop <[EMAIL PROTECTED]> wrote: >> I have found a code example with this loop. >> >> for k in range(10, 25): >> n = 1 << k; >> >> >> I have never read Python before but is it correct that 1 get multiplied >> with the numbers

tkinter listbox

2007-04-25 Thread Gigs_
Hi! Im working on paint program with tkinter canvas. I have two listbox and when i click on first listbox second become deselected. I need to take one thing from first listbox and one thing from second at the same time. How to do that? thx, apologies for bad english -- http://mail.python.org/

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Terry Reedy
"Anton Vredegoor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || I didn't realize this was about an PSF internal affair. [snip] Enough of the sour grapes, please. The question posted is whether non-members would be interested in prizes or contracts voted on by members (who woul

sorting question

2007-04-25 Thread belinda thom
Hi, I've had a look at http://wiki.python.org/moin/HowTo/Sorting, but am not sure if I can get the operator.itemgetter to do what I want for my particular need. I'm also not sure why creating my own cmp for pulling tuple parts out and passing it to a list sort doesn't just work. I'm sure th

Re: conditional print statement ?

2007-04-25 Thread Terry Reedy
"Stef Mientki" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | if Print_Info: print Datafile.readline() | else:Datafile.readline() Since both branches discard the data read, I presume Martin's fix is what you really want. | Is there a more compressed way t

Re: Controlling gnuplot via subprocess.Popen

2007-04-25 Thread James Stroud
Peter Beattie wrote: > I am trying to plot something in gnuplot 4.2 using co-ordinates a Python > 2.5 program computes. Here's what I'm doing: > > py> from subprocess import * > py> plot = Popen("c:/progs/gp/bin/wgnuplot.exe", stdin=PIPE) > py> plot.stdin.write("plot x*x") > > The first command d

Re: bitwise shift?

2007-04-25 Thread Terry Reedy
"desktop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I have found a code example with this loop. | | for k in range(10, 25): | n = 1 << k; | | | I have never read Python before but is it correct ... One of the super-nice feature of Python is the interactive mode, also av

Re: Another Python Game Programming Challenge concludes

2007-04-25 Thread Terry Reedy
" ???" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The fourth Python Game Programming Challenge (PyWeek) has now concluded | with | judges (PyWeek being peer-judged) declaring the winners: | | Individual: Which way is up? by Hectigo |http://www.pyweek.org/e/Hectic/ | |

Re: Tutorial creates confusion about slices

2007-04-25 Thread Ant
On Apr 23, 1:38 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > The following is part of the explanation on slices in the > tutorial: > > The best way to remember how slices work is ... > +---+---+---+---+---+ > | H | e | l | p | A | > +---+---+---+---+---+ > 0 1 2 3 4 5 > -5 -4

Re: Controlling gnuplot via subprocess.Popen

2007-04-25 Thread Ben C
On 2007-04-25, Peter Beattie <[EMAIL PROTECTED]> wrote: > I am trying to plot something in gnuplot 4.2 using co-ordinates a Python > 2.5 program computes. Here's what I'm doing: > > py> from subprocess import * > py> plot = Popen("c:/progs/gp/bin/wgnuplot.exe", stdin=PIPE) > py> plot.stdin.write("p

Re: bitwise shift?

2007-04-25 Thread Sherm Pendley
desktop <[EMAIL PROTECTED]> writes: > for k in range(10, 25): > n = 1 << k; > > I have never read Python before but is it correct that 1 get > multiplied with the numbers 10,11,12,12,...,25 assuming that 1 << k > means "1 shift left by k" which is the same as multiplying with k. Shift left

Re: bitwise shift?

2007-04-25 Thread Thomas Krüger
desktop schrieb: > I have found a code example with this loop. > > for k in range(10, 25): > n = 1 << k; > > > I have never read Python before but is it correct that 1 get multiplied > with the numbers 10,11,12,12,...,25 assuming that 1 << k means "1 shift > left by k" which is the same as

Re: bitwise shift?

2007-04-25 Thread Jean-Paul Calderone
On Wed, 25 Apr 2007 22:54:12 +0200, desktop <[EMAIL PROTECTED]> wrote: >I have found a code example with this loop. > >for k in range(10, 25): > n = 1 << k; > > >I have never read Python before but is it correct that 1 get multiplied >with the numbers 10,11,12,12,...,25 assuming that 1 << k m

Re: getting scancodes

2007-04-25 Thread faulkner
On Apr 23, 8:39 pm, [EMAIL PROTECTED] wrote: > Anyone knows if its possible to get scan codes ??? > I tried with getch () but with no success, just keycodes. > May be using the something in the sys.stdin module ?? is this what you're looking for? http://cheeseshop.python.org/pypi/sysio/1.0 and sy

Re: bitwise shift?

2007-04-25 Thread Michael Hoffman
desktop wrote: > I have found a code example with this loop. > > for k in range(10, 25): > n = 1 << k; > > > I have never read Python before but is it correct that 1 get multiplied > with the numbers 10,11,12,12,...,25 No. > assuming that 1 << k means "1 shift left by k" Yes. > which

Embedding Matplotlib in wxpython wx.Panel problem

2007-04-25 Thread Soren
Hi, I'm trying to create a small GUI program where I can do plots using Matplotlib. I've been trying to borrow code from the examples at the matplotlib website, but I can't get it to work. I want to be able to create a wx.Panel that contains an axis for plotting. Around it i want other panels con

bitwise shift?

2007-04-25 Thread desktop
I have found a code example with this loop. for k in range(10, 25): n = 1 << k; I have never read Python before but is it correct that 1 get multiplied with the numbers 10,11,12,12,...,25 assuming that 1 << k means "1 shift left by k" which is the same as multiplying with k. -- http://

Re: conditional print statement ?

2007-04-25 Thread Martin v. Löwis
Stef Mientki schrieb: > hello, > > > As part of a procedure I've a number sequences like this: > > > if Print_Info: print Datafile.readline() > else:Datafile.readline() > > > Is there a more compressed way to write such a statement, > especially I dislike the redundanc

conditional print statement ?

2007-04-25 Thread Stef Mientki
hello, As part of a procedure I've a number sequences like this: if Print_Info: print Datafile.readline() else:Datafile.readline() Is there a more compressed way to write such a statement, especially I dislike the redundancy "Datafile.readline()". thanks, Stef Mient

Re: script for seconds in given month?

2007-04-25 Thread skip
ed> I, unfortunately, failed to realize the actual platform the script ed> is for is IronPython. When trying to import calendar in IronPython, ed> I get: ed> SyntaxError: future feature is not defined: with_statement ed> (c:\Python25\Lib\calendar.py, line 8) So try the 2.4 v

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread TimC
Donald 'Paddy' McCarthy <[EMAIL PROTECTED]> wrote > Could you split the program into one handling the outer loop and > calling another program, with data transfer, to handle the inner > loops? > > - Paddy. I'm afraid this isn't possible, because the python macro is called and started from within

Re: KOREAN MOON revolves around BUSH

2007-04-25 Thread Major Quaternion Dirt Quantum
"Global Warning," an *anonymous* article in an old issue of *National Review*, the so-called conservative mag of the grotesque Establishment creature, William Buckley, was a sort of benignly-spun expose of the Mont Pelerin Society, the vehicle of British imperialist "free trade," free beer & free d

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Anton Vredegoor
Steve Holden wrote: > I'm sorry, but while the PSF is a democratically-run organization its > franchise doesn't extend beyond the membership. I didn't realize this was about an PSF internal affair. Of course a group of people can decide on its internal matters without asking anyone else, as lo

Re: File not read to end

2007-04-25 Thread Facundo Batista
[EMAIL PROTECTED] wrote: > My log is around 200,000 lines but it is stopping at line 26,428. I > checked that line and there aren't any special characters. Are you in Windows? Just in case, put "rb" as the mode of the open. Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyA

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Steven Howe <[EMAIL PROTECTED]> wrote: > Interesting questions. What happens when an object is 'cleaned' up by > using the 'del' command. Does the memory space stay in the python > process, get handed back to the OS, or some combination of both? > I remember 'C' on

Re: File not read to end

2007-04-25 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi, > > I'm trying to write a simple log parsing program. I noticed that it > isn't reading my log file to the end. > > My log is around 200,000 lines but it is stopping at line 26,428. I > checked that line and there aren't any special characters. > > This is the file

File not read to end

2007-04-25 Thread andrew . jefferies
Hi, I'm trying to write a simple log parsing program. I noticed that it isn't reading my log file to the end. My log is around 200,000 lines but it is stopping at line 26,428. I checked that line and there aren't any special characters. This is the file reading code segment that I'm using: s

Controlling gnuplot via subprocess.Popen

2007-04-25 Thread Peter Beattie
I am trying to plot something in gnuplot 4.2 using co-ordinates a Python 2.5 program computes. Here's what I'm doing: py> from subprocess import * py> plot = Popen("c:/progs/gp/bin/wgnuplot.exe", stdin=PIPE) py> plot.stdin.write("plot x*x") The first command dutifully opens gnuplot, but the secon

Re: Python Screen Scraper

2007-04-25 Thread skotjs
On Apr 24, 5:50 am, James Stroud <[EMAIL PROTECTED]> wrote: > Hello, > > Does anyone know of an example, however modest, of a screenscraper > authored in python? I am using Firefox. > > Basically, I am answering problems via my browser and being scored for > each problem. I have a tendency to go pa

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Grant Edwards
On 2007-04-25, Steven Howe <[EMAIL PROTECTED]> wrote: >> I'm a bit fuzzy on this, but I don't think there _is_ a >> practical way to "return memory to the OS" in many OSes. For >> example in Unix the C library uses the sbrk() call to increase >> the size of the data segment when additional memory

Re: q: how to output a unicode string?

2007-04-25 Thread Richard Brodie
"Frank Stajano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I find the encode/decode terminology somewhat confusing, because arguably > both sides are > "encoded". For example, a unicode-encoded string (I mean a sequence of > unicode code > points) should count as "decoded"

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Donald 'Paddy' McCarthy
[EMAIL PROTECTED] wrote: > So I read quite a few things about this phenomenon in Python 2.4.x but > I can hardly believe that there is really no solution to my problem. > > We use a commercial tool that has a macro functionality. These macros > are written in python. So far nothing extraordinary.

lowercase class names, eg., qtgui ? (PyQt4)

2007-04-25 Thread Glen
Hello, In the file generated by pyuic4 from Designer's .ui file I noticed the use of lower case class names (I'm assuming these are the names of classes, not modules). For example: It imports thusly: from PyQt4 import QtGui then uses things like: self.gridlayout = qtgui.qgridlayout(dld

Bibus/python locale not supported problem

2007-04-25 Thread Tom Chilton
Hi, I am running Gentoo Linux. I have emerge'd Bibus and everything seemed to go well. When I try to start it from a shell I get: [EMAIL PROTECTED] ~ $ bibus Traceback (most recent call last): File "/usr/share/bibus/bibus.py", line 63, in ? locale.setlocale(locale.LC_ALL,'en_US')

Re: q: how to output a unicode string?

2007-04-25 Thread Frank Stajano
Diez B. Roggisch wrote: >> So why is it that in the first case I got UnicodeEncodeError: 'ascii' >> codec can't encode? Seems as if, within Idle, a utf-8 codec is being >> selected automagically... why should that be so there and not in the >> first case? > > I'm a bit confused on what you did whe

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Terry Reedy
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Since it's the PSF's money I don't see why the voting shouldn't be | restricted to PSF members. Legally, I believe it *is* that way. And even as a non-member, I think it should be that way. Any expression of opinions

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Steven Howe
Grant Edwards wrote: > On 2007-04-25, Chris Mellon <[EMAIL PROTECTED]> wrote: > > >> "Returning memory to the OS" doesn't affect exhaustion of your virtual >> address space. More likely, your nested loops are just creating more >> objects than is possible to hold within a single process. >>

Re: popen2 results

2007-04-25 Thread Steven Howe
Robert Rawlins - Think Blue wrote: Hello guys, I've recently ported my application from bash to python, however there are still a few bash line utilities I -have- to use in the application as there isn't any alternative available to me. In the old days of bash I would have grep'd the output

Re: Advocacy: "Python up, Ruby down".

2007-04-25 Thread Terry Reedy
"Paddy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I found this blog post on one users migration to Python. It states one | users frustrations but the comments section is quite good too. | | http://blog.cbcg.net/articles/2007/04/22/python-up-ruby-down-if-that-runtime-dont-work-

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Grant Edwards
On 2007-04-25, Chris Mellon <[EMAIL PROTECTED]> wrote: > "Returning memory to the OS" doesn't affect exhaustion of your virtual > address space. More likely, your nested loops are just creating more > objects than is possible to hold within a single process. I'm a bit fuzzy on this, but I don't t

gcov-like python code coverage

2007-04-25 Thread mathieu
Just in case something already exist for this. Is there some tool, that can produce gcov-type coverage out of a python code ? I have an already existing regex code that turn gcov output into XML, which I'd like to reuse. thanks ! -Mathieu -- http://mail.python.org/mailman/listinfo/python-list

key detect

2007-04-25 Thread Alex Taslab
Hi everybody, does anyone know how to detect a key press from a keyboard. Well I do know how to do that, but i need to detect just one press and ignore the others. I mean, my program checks an input from the outside (a sensor) and i emulate that signal as a keypress, but the sensor doesn`t send the

Another Python Game Programming Challenge concludes

2007-04-25 Thread ???? ???
The fourth Python Game Programming Challenge (PyWeek) has now concluded with judges (PyWeek being peer-judged) declaring the winners: Individual: Which way is up? by Hectigo http://www.pyweek.org/e/Hectic/ Team: Bubble Kong by The Olde Battleaxe http://www.pyweek.org/e/toba4/ Congra

key detect

2007-04-25 Thread Alex Taslab
Hi everybody, does anyone know how to detect a key press from a keyboard. Well I do know how to do that, but i need to detect just one press and ignore the others. I mean, my program checks an input from the outside (a sensor) and i emulate that signal as a keypress, but the sensor doesn`t send the

Re: trinary operator - if then else

2007-04-25 Thread Nick Craig-Wood
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Michael >> > >> Does Python 2.4 support it? > > > > Not precisely, but you can *usually* get away with: > > > > a and b or c > > This is really bad advice, as long as you don't explain why it "usually" > works (and often enough not). This for exam

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Chris Mellon
On 25 Apr 2007 15:04:59 GMT, TimC <[EMAIL PROTECTED]> wrote: > Larry Bates <[EMAIL PROTECTED]> wrote: > > > Let's see for this I need to get out my crystal ball... > > > > If it is a commercial application, you should contact their tech > > support for a solution. The problem isn't specifically a

  1   2   >