kj wrote:
In Dave Angel
writes:
[snippetty snip]
Why would you need a special hook when the os.walk() generator yields
exactly once per directory? So whatever work you do on the list of
files you get, you can then put the summary logic immediately after.
I think you're missing the p
Hello.
Chris Withers schrieb:
> mname = model.__name__
> fname = mname+'_order'
> value = request.GET.get('order')
> if value:
> request.session[fname]=value
> else:
> value = request.session.get(
> fname,
>
En Tue, 13 Oct 2009 10:21:31 -0300, escribió:
I am using linecache.getline, to access to a line in a long file. It s
really fast, appx 4seconds, but I was just wandering if any of you, know
either another way, or there is something that I can do to speed it
up... thank you very much for y
Buck wrote:
[snip]
Steven had the nicest workaround (with the location = __import__
('__main__').__file__ trick), but none of them solve the problem of
the OP: organization of runnable scripts. So far it's been required to
place all runnable scripts directly above any used packages. The
workaro
En Tue, 13 Oct 2009 13:05:03 -0300, Chris Withers
escribió:
What I'd be looking for is something like:
locals()[name]=value
...or, say:
setattr(,name,value)
Now, I got horribly flamed for daring to be so heretical as to suggest
this might be a desirable thing in #python, so I thought I'
Peter Otten wrote:
kj wrote:
In Dave Angel
writes:
kj wrote:
Perl's directory tree traversal facility is provided by the function
find of the File::Find module. This function accepts an optional
callback, called postprocess, that gets invoked "just before leaving
the curren
On Oct 12, 3:34 pm, "Gabriel Genellina"
wrote:
> En Mon, 12 Oct 2009 15:24:34 -0300, Buck escribió:
>
> > On Oct 10, 9:44 am, "Gabriel Genellina"
> > wrote:
> >> The good thing is that, if the backend package is properly installed
> >> somewhere in the Python path ... it still works with no mo
On Oct 12, 4:30 pm, Carl Banks wrote:
> On Oct 12, 11:24 am, Buck wrote:
>
> > On Oct 10, 9:44 am, "Gabriel Genellina"
> > wrote:
>
> > > The good thing is that, if the backend package is properly installed
> > > somewhere in the Python path ... it still works with no modifications.
>
> > I'd
En Tue, 13 Oct 2009 03:48:00 -0300, Dennis Lee Bieber
escribió:
On Mon, 12 Oct 2009 16:36:58 -0700, Ethan Furman
declaimed the following in gmane.comp.python.general:
coffe table, you look in your car, etc, etc, and so forth. If you move
a file in a package to somewhere else, and you don't
Janto Dreijer wrote:
> I'm looking for code that will calculate the running median of a
> sequence, efficiently. (I'm trying to subtract the running median from
> a signal to correct for gradual drift).
>
> My naive attempt (taking the median of a sliding window) is
> unfortunately too slow as my
Mensanator wrote:
No, it's just that the OP was asking whether
avoiding "while True" is considered Best Practice.
How can you answer such a question without sounding
dogmatic?
I was just pointing out your style of programming seems inflexible.
"Just another line that has to be interpreted l
Hi All,
Say I have a piece of code like this:
mname = model.__name__
fname = mname+'_order'
value = request.GET.get('order')
if value:
request.session[fname]=value
else:
value = request.session.get(
fname,
In article ,
ryniek90 wrote:
>
>But I remember that lambda function also was unwelcome in Python, but
>finally it is and is doing well. So maybe someone, someday decide to
>put in Python an alternative, really great implementation of scanf() ?
How long have you been using Python? lambda has bee
On Oct 13, 8:02 am, Matimus wrote:
> On Oct 13, 7:45 am, Igor Mikushkin wrote:
>
> > Hello all!
>
> > I'm a newbie to Python.
> > Could you please say me when it is better to derive from "object" and
> > when not?
>
> > Thanks,
> > Igor
>
> The only reason to derive from 'object' is ...
erm... t
I'm looking for code that will calculate the running median of a
sequence, efficiently. (I'm trying to subtract the running median from
a signal to correct for gradual drift).
My naive attempt (taking the median of a sliding window) is
unfortunately too slow as my sliding windows are quite large (
On Oct 13, 3:44�am, John Reid wrote:
> Mensanator wrote:
> >> Nothing wrong with a having a break IMHO.
>
> > My opinion is that there is everything wrong with
> > having a break. I don't think I have ever used one,
> > I write code that doesn't depend on that crutch.
>
> I guess its crutch-iness
exar...@twistedmatrix.com wrote:
> On 02:48 pm, m...@egenix.com wrote:
>> exar...@twistedmatrix.com wrote:
>>> On 03:17 pm, pengyu...@gmail.com wrote:
Hi,
If I define my own class and use pickle to serialize the objects in
this class, will the serialized object be successfully r
On 02:48 pm, m...@egenix.com wrote:
exar...@twistedmatrix.com wrote:
On 03:17 pm, pengyu...@gmail.com wrote:
Hi,
If I define my own class and use pickle to serialize the objects in
this class, will the serialized object be successfully read in later
version of python.
What if I serialize (usi
On Oct 13, 7:45 am, Igor Mikushkin wrote:
> Hello all!
>
> I'm a newbie to Python.
> Could you please say me when it is better to derive from "object" and
> when not?
>
> Thanks,
> Igor
The only reason to derive from 'object' is if there is some sort of
weird side effect of using new style classe
Igor Mikushkin a écrit :
Hello all!
I'm a newbie to Python.
Welcome onboard
Could you please say me when it is better to derive from "object" and
when not?
- When not : when using Python >= 3.0, or when already subclassing
another class.
- When : any other case !-)
--
http://mail.pytho
Hello all!
I'm a newbie to Python.
Could you please say me when it is better to derive from "object" and
when not?
Thanks,
Igor
--
http://mail.python.org/mailman/listinfo/python-list
exar...@twistedmatrix.com wrote:
> On 03:17 pm, pengyu...@gmail.com wrote:
>> Hi,
>>
>> If I define my own class and use pickle to serialize the objects in
>> this class, will the serialized object be successfully read in later
>> version of python.
>>
>> What if I serialize (using pickle) an objec
Never mind. I just discovered that os.chmod requires 0755, not just 755.
V
On Tue, Oct 13, 2009 at 9:26 AM, Victor Subervi wrote:
> Hi;
> I have the following code:
>
> if 13 < x < 20:
> y += 1
> w += 1
> try:
> getpic = "getpic" + str(w
Hi;
I have the following code:
if 13 < x < 20:
y += 1
w += 1
try:
getpic = "getpic" + str(w) + ".py"
try:
os.remove(getpic)
except:
pass
code = """#! /usr/bin/pytho
Hi
Does IDLE (the default GUI avalaible with the standard distribution)
support redirection from the standard input ? To be more precise, inside
a Windows or Linux shell I may redirect input data from a text file to
be executed by a python file. For instance suppose I have this python file
# fo
On Mon, Oct 12, 2009 at 4:44 AM, Nadav Chernin wrote:
>
> Chris Withers wrote:
>
> ...becauase you were looking for:
>
> reversed([1,2,3,4])
>
> OK, but my question is generic. Why when I use object's function that
> changed values of the object, I can't to get value of it on
Luca Fabbri wrote:
I've problems while using setuptools for getting an egg and upload it
on pypi. The egg (in bdist_egg or sdist format) are always "corrupted"
as far as a lot of files are not included in the zip, tar.gz or egg
results.
Looking at google it seems that this problem has been fixed
Antoon Pardon wrote:
I have been looking for pexpect. The links I find like
http://pexpect.sourceforge.net all end up at
http://www.noah.org/wiki/Pexpect which produces a 404 not
found problem.
Does someone know the current location?
maybe they removed the distribution so you may use "subpr
Hi, I use Python as scripting tool in LabVIEW. I use lvpython.dll that
include only built-in modules of python.
But I need to use for example also urllib that is not included in
lvpython.dll.
How can I use it also?
Thanks, Nadav
--
http://mail.python.org/mailman/listinfo/python-list
kj writes:
> I think you're missing the point. The hook in question has to be
> called *immediately after* all the subtrees that are rooted in
> subdirectories contained in the current directory have been visited
> by os.walk.
>
> I'd love to see your "5 lines" for *that*.
I'm having trouble un
Hi Everyone!!
I am using linecache.getline, to access to a line in a long file. It s
really fast, appx 4seconds, but I was just wandering if any of you,
know either another way, or there is something that I can do to speed
it up... thank you very much for your help!!
Regards,
Bea
kj wrote:
> In Dave Angel
> writes:
>
>>kj wrote:
>>> Perl's directory tree traversal facility is provided by the function
>>> find of the File::Find module. This function accepts an optional
>>> callback, called postprocess, that gets invoked "just before leaving
>>> the currently processed d
Hi all.
I've problems while using setuptools for getting an egg and upload it
on pypi. The egg (in bdist_egg or sdist format) are always "corrupted"
as far as a lot of files are not included in the zip, tar.gz or egg
results.
Looking at google it seems that this problem has been fixed (related
to
I installed psycopg2 by "easy_install psycopg2" on CentOS 5.3, no
error was reported, but when I tried "import psycopg2", I got :
exceptions.ImportError: /usr/lib/python2.4/site-packages/
psycopg2-2.0.9-py2.4-linux-i686.egg/psycopg2/_psycopg.so: undefined
symbol: TLSv1_method
What might cause
In Dave Angel
writes:
>kj wrote:
>> Perl's directory tree traversal facility is provided by the function
>> find of the File::Find module. This function accepts an optional
>> callback, called postprocess, that gets invoked "just before leaving
>> the currently processed directory." The docum
On Sep 26, 8:54 pm, devilkin wrote:
> I'm just starting learning python, and coding in emacs. I usually
> split emacs window into two, coding in one, and run script in the
> other, which is not very convenient. anyone can help me with it? is
> there any tricks like emacs short cut?
>
> also pleas
On Oct 13, 12:45 pm, Steven D'Aprano
wrote:
>
> Have you looked at the tokenize module?
>
> http://docs.python.org/library/tokenize.html
Thanks Steven -- that was what I was looking for.
--
http://mail.python.org/mailman/listinfo/python-list
My emails must not be making it to list... I posted a solutions about
10 minutes after I posted the questions.
Thanks!
On Tue, Oct 13, 2009 at 12:35 PM, Dave Angel wrote:
> Chris Colbert wrote:
>>
>> Say I use python to talk to a wireless webcamera that delivers images
>> via http requests.
>>
>
Chris Colbert wrote:
Say I use python to talk to a wireless webcamera that delivers images
via http requests.
I request an image and read it into a buffer, but the image is in jpeg format.
I would like to convert this to a simple RGB format buffer to pass to
numpy. Has anyone managed this using
Heh, for whatever reason, your post is dated earlier than my response,
but wasn't here when I sent mine. But yeah, PIL worked.
On Tue, Oct 13, 2009 at 12:04 PM, Stefan Behnel wrote:
> Chris Colbert wrote:
>> Say I use python to talk to a wireless webcamera that delivers images
>> via http request
In answering my own question, this can be done trivially with PIL.
Here is a self contained example:
In [1]: import httplib
In [2]: from PIL import ImageFile
In [3]: import numpy as np
In [4]: conn = httplib.HTTPConnection('www.therealstevencolbert.com')
In [5]: conn.request('GET', '/dump/IMG
Chris Colbert wrote:
> Say I use python to talk to a wireless webcamera that delivers images
> via http requests.
>
> I request an image and read it into a buffer, but the image is in jpeg format.
>
> I would like to convert this to a simple RGB format buffer to pass to
> numpy. Has anyone manage
Say I use python to talk to a wireless webcamera that delivers images
via http requests.
I request an image and read it into a buffer, but the image is in jpeg format.
I would like to convert this to a simple RGB format buffer to pass to
numpy. Has anyone managed this using libjpeg or any other l
Short question:
I am considering two solutions for a distributed system: either
RabbitMQ with py-amqplib or ApacheQpid with its own set of API. I
wander is any of you would be able to compare the two. In particular,
I would expect that since Apache comes with its own documented Python
API this wou
> zxo102 (z) wrote:
>z> Hi everyone,
>z> How can I pass a string generated from python cgi at server side
>z> to a
>z> javascript function as an argument at client side?
>z> I want test.py to "return" a "hello" back so the javascript function
>z> load takes "hello" as argument like lo
> SuperMetroid (S) wrote:
>S> The html code of the form, and my code are below. I can't get the
>S> value to post/submit.. instead I get an error. Can anyone help?
>S> HTML Code of Form:
>S>
>S>
>S>
>S> S> value='92dcd92a8bc16f73f330d118ae1ed891' />
>S>
>S> Grant bad
zxo102 a écrit :
Hi everyone,
How can I pass a string generated from python cgi at server side
to a
javascript function as an argument at client side?
This is common HTTP / javascriot stuff - nothing related to Python.
First learn about the HTTP protocol - something you obviously need if
I'm going to develop further my py. script for
text detection and localization in raster images:
http://funkybee.narod.ru/
Slow Doe...
--
http://mail.python.org/mailman/listinfo/python-list
On 2009-10-12, Gabriel Genellina wrote:
>> my_prissy_little_indicator_variable = true
>> while (my_prissy_little_indicator_variable){
>>
>> }
>> isn't satisfying because it doesn't guard the with any
>> assurance that the loop invariant will be true before you enter into
>> that block of co
TerryP writes:
> One thing you should also learn about me, is I do not deal in
> absolutes.
What, *never*? That's a pretty uncompromising position to h—
I'll get my coat.
--
\ “Smoking cures weight problems. Eventually.” —Steven Wright |
`\
Hello,
Google is your friend:
http://sourceforge.net/projects/pexpect/
http://sourceforge.net/projects/pexpect/files/pexpect/Release%202.3/pexpect-2.3.tar.gz/download
Best regards,
Javier
2009/10/13 Antoon Pardon :
> I have been looking for pexpect. The links I find like
> http://pexpect.sou
Zac Burns schrieb:
I have a class called Signal which is a descriptor. It is a descriptor
so that it can create BoundSignals, much like the way methods work.
What I would like to do is to have the class be a descriptor when
instantiated in what will be the locals of the class, but not a
descripto
On Mon, Oct 12, 2009 at 11:33 AM, Victor Subervi wrote:
> for row in data:
> i += 1
> total = 0
> quantity = form.getfirst('order_' + str(i), '')
> if quantity != '':
> sql = 'select * from products p join %s c on p.ID=c.ID where
> c.ID=%s;' % (client, str(i))
>
The html code of the form, and my code are below. I can't get the
value to post/submit.. instead I get an error. Can anyone help?
HTML Code of Form:
Grant badge:
My Code:
opener = urllib.request.build_opener()
cj = http.cookiejar.MozillaCookieJar()
cj.load('C:/Users/Al
Here is the .emacs file I place at c:\ on xp. I don't understand it and
cannot explain it. It was developed by a few guys I worked with 20
years ago and still does the job. Probably quite obsolete by now, but
if it ain't broke...
In response to your "what do you mean"
With the cursor in a python
hello
im learning twill,but have some problem with unicode.
whenever i use twill's follow function which emulate webbrowser link click
function,it can work well with
english link,but can't work with unicode.
does anybody some know about this probelm?
thank in advance
follow is sample
# -*- codi
Mensanator wrote:
Nothing wrong with a having a break IMHO.
My opinion is that there is everything wrong with
having a break. I don't think I have ever used one,
I write code that doesn't depend on that crutch.
I guess its crutch-iness is in the eye of the beholder. You seem to have
a dogmat
I have been looking for pexpect. The links I find like
http://pexpect.sourceforge.net all end up at
http://www.noah.org/wiki/Pexpect which produces a 404 not
found problem.
Does someone know the current location?
--
Antoon Pardon
--
http://mail.python.org/mailman/listinfo/python-list
In article <89f50109-83f9-4c1e-8e0d-7f985b1c2...@xiao-yu.com>,
Xiao Yu wrote:
> I have Snow Leopard and followed 4.6.1 snapshot 20091010's reference
> 3.4 instructions to configure both SIP and PyQt in i386. Everything
> installed fine but when I open Python and tried to import ImageQt, I
>
On Tue, 13 Oct 2009 12:35:13 +0530, Rustom Mody wrote:
> At http://www.secnetix.de/olli/Python/block_indentation.hawk I find that
> the python code
>
if foo:
> ... if bar:
> ... x = 42
> ... else:
> ... print foo
> ...
>
> has its indentation structure made explicit as
>
>
Hi everyone,
I have Snow Leopard and followed 4.6.1 snapshot 20091010's reference
3.4 instructions to configure both SIP and PyQt in i386. Everything
installed fine but when I open Python and tried to import ImageQt, I
get the following error:
Traceback (most recent call last):
File "",
Rustom Mody wrote:
> I am trying to generate some python code and its
> indentation=structure is giving me a headache!
Have you considered searching the web for "Python code generator"?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
At http://www.secnetix.de/olli/Python/block_indentation.hawk
I find that the python code
>>> if foo:
... if bar:
... x = 42
... else:
... print foo
...
has its indentation structure made explicit as
<:>[0]
<:> [0, 4]
<=> <42> [0, 4,
101 - 163 of 163 matches
Mail list logo