On 28 Dic, 18:47, Roy Smith wrote:
> In article
> ,
> "Giampaolo Rodola'" wrote:
>
> > Hi,
> > I know that it's not possible to "kill" threads but I'm wondering if
> > does exist some workaround for my problem.
> > I have a test suite which does a massive usage of threads.
> > Sometimes happens
I'm putting some utility functions in a file and then building a simple
shell interface to them. Is their some way I can automatically get a list of
all the functions in the file? I could wrap them in a class and then use
attributes, but I'd rather leave them as simple functions.
Thanks,
Basu
--
ht
scsoce wrote:
I have a function return a reference, and want to assign to the
reference, simply like this:
>>def f(a)
return a
b = 0
* f( b ) = 1*
but the last line will be refused as "can't assign to function call".
In my thought , the assignment is very nature, but why the
On Dec 29, 12:31 pm, Steve Holden wrote:
> nemo wrote:
> > Hi,all.
> > I'm on a toy ftp project and I want it to be convinient for the user
> > to cancel an undergoing downloading while continue others. The
> > following code explains:
> > for file in download_files:
> > self.ftp.retrbinary('R
En Mon, 29 Dec 2008 04:12:02 -0200, Gabriel Genellina
escribió:
En Sun, 28 Dec 2008 12:10:06 -0200, aspineux
escribió:
I got this.
This is a test script, to help me to understand why I have unexpected
result in application.
But I got a more unexpected result, and probably wrong error mes
En Sun, 28 Dec 2008 15:01:14 -0200, escribió:
1. In Cheetah 2.0.1, both from python 2.5.2 and 2.6, after I do a [...]
2. In reportlab 2.2, when I generate a PDF, no matter how many s
[...]
Better to report those problems to each product authors.
--
Gabriel Genellina
--
http://mail.python
Tim, Thank you for your suggestions that you made. I will modify my class to
what you said. I will also remove find_and_replace. seeing as I won't use it
anywhere else. I think I put it there for some test and forgot to delete it.
I was actually deleting the header outside of the class. This works
On Dec 29, 12:01 am, scsoce wrote:
> I have a function return a reference, and want to assign to the
> reference, simply like this:
> >>def f(a)
> return a
> b = 0
> * f( b ) = 1*
> but the last line will be refused as "can't assign to function call".
> In my thought , the assi
En Sun, 28 Dec 2008 12:10:06 -0200, aspineux escribió:
I got this.
This is a test script, to help me to understand why I have unexpected
result in application.
But I got a more unexpected result, and probably wrong error message
about the read-only cursor.
def server():
dbenv, db=init_db
On Mon, Dec 29, 2008 at 4:01 PM, scsoce wrote:
> I have a function return a reference, and want to assign to the reference,
> simply like this:
>>>def f(a)
> return a
>b = 0
> * f( b ) = 1*
> but the last line will be refused as "can't assign to function call".
> In my thought , the
I have a function return a reference, and want to assign to the
reference, simply like this:
>>def f(a)
return a
b = 0
* f( b ) = 1*
but the last line will be refused as "can't assign to function call".
In my thought , the assignment is very nature, but why the interpreter
refu
En Sun, 28 Dec 2008 10:44:11 -0200, nemo escribió:
My code like this raise an EOFError, It happens if I use the Process
module,
while, if I use thread.start_new_thread(ftp.pwd,()), it seems works
well.
And I wondered why.
from ftplib import FTP
import thread
from multiprocessing import Process
En Sun, 28 Dec 2008 06:43:20 -0200, Pavel Kosina escribió:
well, I am working on a tutorial for youngster (thats why i need to stay
the code as easy as possible). In this game you are hunted by robots. I
could use key"7" on numeric keypad for left-up moving but seems to me,
that "4"+"8" is
En Sun, 28 Dec 2008 08:59:03 -0200, Hendrik van Rooyen
escribió:
"Gabriel Genellina" wrote:
Hmmm, I don't think posting a potentially harmful example is actually a
good idea...
True - its my only example though, and nobody else was
bothering to reply, so I kicked off and flushed out some
r
Hola
En el especial de Navidad de este año: http://xkcd.com/521/
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
On 12月27日, 下午4时08分, "Gabriel Genellina"
wrote:
> En Sat, 27 Dec 2008 03:03:24 -0200,zxo102 escribió:
>
>
>
> > On 12月26日, 下午3时16分, "Mark Tolonen"
> > wrote:
>
> >> I was able to display 中文 successfully with this code:
>
> >> f=open('test.html','wt')
> >> f.write('''
> >>
> >> test
> >> \xd6\xd
En Sun, 28 Dec 2008 15:47:24 -0200, Roy Smith escribió:
In article
,
"Giampaolo Rodola'" wrote:
I know that it's not possible to "kill" threads but I'm wondering if
does exist some workaround for my problem.
I have a test suite which does a massive usage of threads.
Sometimes happens that o
nemo wrote:
> Hi,all.
> I'm on a toy ftp project and I want it to be convinient for the user
> to cancel an undergoing downloading while continue others. The
> following code explains:
> for file in download_files:
> self.ftp.retrbinary('RETR '+file, fileHandler)
> Thers seems not a solid way
Hi,all.
I'm on a toy ftp project and I want it to be convinient for the user
to cancel an undergoing downloading while continue others. The
following code explains:
for file in download_files:
self.ftp.retrbinary('RETR '+file, fileHandler)
Thers seems not a solid way to cancel this transfer an
recently i wrote a blog essay about html correctness and html
validators, with relations to the programing lang communities. I hope
programing lang fans will take more consideration on the correctness
of the doc they produces.
HTML Correctness and Validators
• http://xahlee.org/js/html_correctness
kajnilss...@hotmail.com writes:
> I'm new to the open source comunnity and I was wondering if there are
> any bugs that I can trouble shoot or just some beginner tasks I can be
> sent?
Here are some pointers to how you can assist Python:
http://wiki.python.org/moin/Advocacy>
http://wiki.
Does Anyone know how to Make the ServiceContainer work under SSL
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
So I have a MoinMoin installation running as a cgi and also under wsgi.
Since I was on a roll I decided to press my luck and try running it
under scgi. Following a suggestion in the following article:
http://www.linuxjournal.com/article/9310
I wrote this little server adapter:
from MoinMo
Announcing PyYAML-3.07
A new release of PyYAML is now available:
http://pyyaml.org/wiki/PyYAML
Changes
===
* The emitter learned to use an optional indentation indicator
for block scalars; thus scalars with leading whitespaces
cou
>> cmd = '%s -y %s -l %s' % (conf.twistd, conf.tztac, conf.twistdlog)
>> status, output = commands.getstatusoutput(cmd)
> The commands module is Unix only. See its documentation :
> http://docs.python.org/library/commands.html
Ah. Doh!
I was going back and forth between all of the different wa
See: Chris Moss, Prolog++: The Power of Object-Oriented and Logic Programming
(ISBN 0201565072)
This book is a pretty handy intro to an OO version Prolog produced by Logic
Programming Associates.
Prolog is a wonderful tool for such things as working out a factory layout for
new car producti
s...@pobox.com wrote:
Colin> ... perhaps faster than numpy:
...
For extremely short lists, but not for much else:
% for n in 1 10 100 1000 1 10 ; do
> echo "len:" $n
> echo -n "numpy: "
> python -m timeit -s 'import numpy ; a = numpy.array(range('$n'))' 'a*
Ruby has a package called 'hpricot' which can perform limited xpath
queries, and CSS selector queries. However, what makes it really
useful is that it does a good job of handling the "broken" html that
is so commonly found on the web. Does Python have anything similar,
i.e. something that w
On Dec 28, 5:12 pm, John Machin wrote:
> On Dec 29, 7:06 am, Roger wrote:
>
>
>
> > > Curious. When I see a bare return, the first thing I think is that the
> > > author forgot to include the return value and that it's a bug.
>
> > > The second thing I think is that maybe the function is a genera
Hi, I've switched to Python 3.0 for a new Japanese vocab quizzing
application due to its much improved Unicode support. However, I'm running
into an issue with displaying Unicode characters via curses. In Python 2.x a
simple hello-world looks like:
#!/usr/bin/python
# coding=UTF-8
import curses
i
In article
,
Graham Dumpleton wrote:
> On Dec 28, 7:22 pm, Ron Garret wrote:
> > In article ,
> > Ron Garret wrote:
> >
> >
> >
> > > I successfully installed MoinMoin as a CGI according to the instructions
> > > on the moinmo.in site. But when I tried to switch over to running it
> > > und
On Dec 29, 7:06 am, Roger wrote:
> > Curious. When I see a bare return, the first thing I think is that the
> > author forgot to include the return value and that it's a bug.
>
> > The second thing I think is that maybe the function is a generator, and
> > so I look for a yield. If I don't see a y
On Dec 29, 8:36 am, Benjamin wrote:
> On Dec 28, 1:35 pm, Steven D'Aprano
> cybersource.com.au> wrote:
> > The second thing I think is that maybe the function is a generator, and
> > so I look for a yield.
>
> You shouldn't, though; Generators can't contain any return statement.
What gave you th
Benjamin wrote:
On Dec 28, 1:35 pm, Steven D'Aprano wrote:
The second thing I think is that maybe the function is a generator, and
so I look for a yield.
You shouldn't, though; Generators can't contain any return statement.
Yes, they can. It doesn't return a value, it just raises a StopIter
On Dec 28, 1:35 pm, Steven D'Aprano wrote:
> The second thing I think is that maybe the function is a generator, and
> so I look for a yield.
You shouldn't, though; Generators can't contain any return statement.
--
http://mail.python.org/mailman/listinfo/python-list
The commands module is Unix only. See its documentation :
http://docs.python.org/library/commands.html
On Sun, Dec 28, 2008 at 10:03 PM, Lee Harr wrote:
>
> My application is trying to start twistd in a cross-platform way.
>
> Unfortunately, it works fine on my linux system, but I do not
> have w
My application is trying to start twistd in a cross-platform way.
Unfortunately, it works fine on my linux system, but I do not
have windows, and I am trying to debug this remotely on a
system I never use :o(
Anyhow, here is the error I am getting:
cmd = '%s -y %s -l %s' % (conf.twistd, conf.t
Hey everyone,
Can someone advice me a beautiful or just cool library for form
validation with javascript supporting?
--
http://mail.python.org/mailman/listinfo/python-list
On 28 Gru, 09:43, Pavel Kosina wrote:
> well, I am working on a tutorial for youngster (thats why i need to stay
> the code as easy as possible). In this game you are hunted by robots. I
> could use key"7" on numeric keypad for left-up moving but seems to me,
> that "4"+"8" is much more standard f
> Curious. When I see a bare return, the first thing I think is that the
> author forgot to include the return value and that it's a bug.
>
> The second thing I think is that maybe the function is a generator, and
> so I look for a yield. If I don't see a yield, I go back to thinking
> they've left
Hi,
Is there a way to dynamically overwrite the request handler from within
mod_python scripts? Something along those lines:
---
from mod_python import apache
def myhandler(request):
request.content_type = 'text/plain'
request.write('Hello world')
apache.set_default_handler
On Sun, 28 Dec 2008 12:38:50 -0500, Steve Holden wrote:
> Roger wrote:
>> Hi Everyone,
>>
>> First I want to thank everyone that posts to this group. I read it
>> daily and always learn something new even if I never feel like I have
>> anything to contribute but my questions.
>>
>> When I defin
Gerard Flanagan wrote:
On Dec 28, 5:19 pm, Roger wrote:
Hi Everyone,
[...]
When I define a method I always include a return statement out of
habit even if I don't return anything explicitly:
def something():
# do something
return
Is this pythonic or excessive? Is this an un
Roger wrote:
Hi Everyone,
First I want to thank everyone that posts to this group. I read it
daily and always learn something new even if I never feel like I have
anything to contribute but my questions.
Same here, I always read the news, but hardly post anything since am not
very much expe
mpmath... wow... just did what i needed :-)
Thanks, Mark! Hopefully i did not waste too much of your time... and
perhaps this discussion will send other lost sheeps in the right
direction.
(Still, it would make sense to have the goniometric functions in
decimal.)
--
http://mail.python.org/mai
Roger a écrit :
When I define a method I always include a return statement out of
habit even if I don't return anything explicitly:
def something():
# do something
return
Is this pythonic or excessive?
If it's the last statement in the function body, it is indeed "excessive
On Dec 28, 5:19 pm, Roger wrote:
> Hi Everyone,
[...]
> When I define a method I always include a return statement out of
> habit even if I don't return anything explicitly:
>
> def something():
> # do something
> return
>
> Is this pythonic or excessive? Is this an unnecessary af
In article
,
"Giampaolo Rodola'" wrote:
> Hi,
> I know that it's not possible to "kill" threads but I'm wondering if
> does exist some workaround for my problem.
> I have a test suite which does a massive usage of threads.
> Sometimes happens that one test fails, the test suite keeps running
>
Roger wrote:
> Hi Everyone,
>
> First I want to thank everyone that posts to this group. I read it
> daily and always learn something new even if I never feel like I have
> anything to contribute but my questions.
>
> When I define a method I always include a return statement out of
> habit even
On Dec 28, 11:19 am, Roger wrote:
> Hi Everyone,
>
> First I want to thank everyone that posts to this group. I read it
> daily and always learn something new even if I never feel like I have
> anything to contribute but my questions.
>
> When I define a method I always include a return statement
Hi,
I know that it's not possible to "kill" threads but I'm wondering if
does exist some workaround for my problem.
I have a test suite which does a massive usage of threads.
Sometimes happens that one test fails, the test suite keeps running
until the end, and when it's finished the program hangs
Hi Everyone,
First I want to thank everyone that posts to this group. I read it
daily and always learn something new even if I never feel like I have
anything to contribute but my questions.
When I define a method I always include a return statement out of
habit even if I don't return anything e
In reportlab 2.2, when I generate a PDF, no matter how many s
I put it, I only get one space. I am using it with python 2.6. The
PDF
generates fine and one $nbsp works, but for some reason, when I put
it
in multiple times, I still only get one space.
--
http://mail.python.org/mailman/listinfo/pyth
1. In Cheetah 2.0.1, both from python 2.5.2 and 2.6, after I do a
#from datetime import date, most of the datetime objects seem to work
fine. For example, $date(2008, 12, 15) works. However $date.today()
does not work and I get an exception required argument year not found.
In Python both 2.5.2 and
> 1. mpmath?
> 2. sympy?
> 3. Sage?
Haven't tried those, i guess i have some studying to do.
>
> > x=Decimal.__mod__(x,Decimal('2')*pi())
>
> > Works fine for what i need, but i am sure it's not the right way to do
> > it.
>
> I don't know of any better way to deal with large arguments.
> The m
On Dec 28, 3:55 pm, jerry.carl...@gmail.com wrote:
> But i am after the extra precision:
>
> >>> from math import *
> >>> (1+1e-16)-1
>
> 0.0
Sounds like you don't care too much about the base-10 part,
so there may be other solutions out there.
Have you tried:
1. mpmath?
2. sympy?
3. Sage?
Any
> - are you using Decimal for the base-10-ness or the
> extra precision Decimal provides? Or significant zeros?
> Or compatibility with existing Decimal code, or what?
Oh boy, now I will finally prove myself illiterate... well, so be it.
But i am after the extra precision:
>>> from math imp
On Dec 28, 7:28 am, Steven D'Aprano wrote:
> Ah crap, I forgot that from_float() has been left out of the decimal API.
> That's very annoying.
Agreed. It's maybe even annoying enough that a feature request
at bugs.python.org might be honoured. (Hint, hint!)
It's fairly easy to emulate in Pytho
On Dec 28, 12:02 am, jerry.carl...@gmail.com wrote:
> I have been looking for a Python module with math functions that would
> both eat and spit Decimals. The standard math module eats Decimals
> allright but spits floats.
Yes: it just converts the input (whether float, int, Fraction or
Decimal) t
On Sun, 28 Dec 2008 02:37:55 -0800, Qiangning Hong wrote:
>> > So, my question is, as sys.stdout IS a file object, why it does not
>> > use its encoding attribute to convert the given unicode? An
>> > implementation bug? A documenation bug?
>>
>> hmm I always thought "sys.stdout" is a "file-like
Tim Roberts wrote:
> Scott David Daniels wrote:
>> I avoid using single-letter variables except where I know the types
>>from the name (so I use i, j, k, l, m, n as integers, s as string,
>> and w, x, y, and z I am a little looser with (but usually float or
>> complex).
>
> It's amazing to me tha
I got this.
This is a test script, to help me to understand why I have unexpected
result in application.
But I got a more unexpected result, and probably wrong error message
about the read-only cursor.
The full script is at the end.
db cleanup, 326 records deleted, 9990 remains
Exception in threa
Hi Steven... thanks for your kind and extensive reply. Lots of good
food for thought. I know it's easy to complain about lack of
functionality, but it really was not my intention. Python is very cool
as it is and I still know too little about it to even suggest
anything. I just thought maybe I was
On Sun, 28 Dec 2008 04:06:36 -0800, Hussein B wrote:
> You mean like MoinMoin, Django or Pylons for example?
Yes. Or lxml, BeautifulSoup, psycopg2 and basically anything that is
available on PyPI.
regards,
Marek
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
My code like this raise an EOFError, It happens if I use the Process
module,
while, if I use thread.start_new_thread(ftp.pwd,()), it seems works
well.
And I wondered why.
from ftplib import FTP
import thread
from multiprocessing import Process
if __name__ == '__main__':
ftp = FTP('loc
On Dec 28, 2:04 pm, "Chris Rebert" wrote:
> On Sun, Dec 28, 2008 at 3:40 AM, Hussein B wrote:
> > Hey,
> > What is /usr/lib/pythonx.y/site-packages folder and for what it is
> > used usually?
>
> I believe it's where third-party libraries are typically installed to.
>
> Cheers,
> Chris
>
> --
> F
On Sun, Dec 28, 2008 at 3:40 AM, Hussein B wrote:
> Hey,
> What is /usr/lib/pythonx.y/site-packages folder and for what it is
> used usually?
I believe it's where third-party libraries are typically installed to.
Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
--
http://m
Hey,
What is /usr/lib/pythonx.y/site-packages folder and for what it is
used usually?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
"Gabriel Genellina" wrote:
>Hmmm, I don't think posting a potentially harmful example is actually a
>good idea...
True - its my only example though, and nobody else was
bothering to reply, so I kicked off and flushed out some
response.
Who was it that said that the way to get info out of usen
James Stroud wrote:
py> a = [1, 2, 3]
py> a1 = a
py> a1[:] = [x*3 for x in a1]
py> a1
[3, 6, 9]
py> a1
[3, 6, 9]
This should have been:
py> a = [1, 2, 3]
py> a1 = a
py> a1[:] = [x*3 for x in a1]
py> a
[3, 6, 9]
py> a1
[3, 6, 9]
James
--
James Stroud
UCLA-DOE Institute for
Ben Bush wrote:
On Dec 26, 4:46 pm, Tim Chase wrote:
What does *not* work is
3 * [0,1,2]
As you know, this gives
[0,1,2,0,1,2,0,1,2]
What I am hoping for is
[0,3,6]
I see that I can use
numpy.multiply(3,range(3))
but this seems overkill to me. Can you tell I am
On Dec 27, 12:31 am, Martin wrote:
> Python 2.4.4 (#2, Oct 22 2008, 19:52:44)
> [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> u = u"\u554a"
> >>> print u
> 啊
> >>> sys.stdout.write(u + "\n")
>
> Tracebac
On Dec 28, 7:22 pm, Ron Garret wrote:
> In article ,
> Ron Garret wrote:
>
>
>
> > I successfully installed MoinMoin as a CGI according to the instructions
> > on the moinmo.in site. But when I tried to switch over to running it
> > under wsgi it failed thusly:
>
> > [Sat Dec 27 21:44:14 2008]
On Dec 24, 12:21 pm, "Gabriel Genellina"
wrote:
> En Wed, 24 Dec 2008 17:16:59 -0200, <5lvqbw...@sneakemail.com> escribió:
>
> > I'm writing an application which is structured roughly as follows:
>
> > "db" is a dict, where the values are also dicts.
> > A function searches through db and returns
> > ... "db" is a dict, where the values are also dicts.
> > A function searches through db and returns a list of values, each of
> > which is a dict as described above.
> > I need to perform set operations on these lists (intersection and
> > union)
> > However the objects themselves are not hasha
janislaw napsal(a):
Um, I could be only guessing what are you meant to do, unless you
describe your problem in more detailed way. I.e. describe the desired
behaviour, show code which you have, and describe the current
behaviour.
well, I am working on a tutorial for youngster (thats why i ne
In article ,
Ron Garret wrote:
> I successfully installed MoinMoin as a CGI according to the instructions
> on the moinmo.in site. But when I tried to switch over to running it
> under wsgi it failed thusly:
>
> [Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] Traceback (most
> rece
On Sat, 27 Dec 2008 21:50:09 -0800, jerry.carl.mi wrote:
>> Which math functions? ln, log10, exp, sqrt already exist as methods of
>> Decimal instances. At the end of the Decimal docs there are a few
>> examples, including computing sin and cos (but apparently they naïvely
>> use a McLaurin series
78 matches
Mail list logo