Everyone,
I'm pleased to announce a new alpha release of GMPY2.
GMPY2 is a wrapper for GMP and MPFR multiple-precision
arithmetic libraries.
GMPY2 alpha2 introduces context manager support for
MPFR arithmetic. It's now possible to trigger an exception
when comparing against "nan" (and other for o
Eric Snow writes:
> p.s. Am I missing something or can you really not change the docstring
> of a class? I was thinking about the idea of inheriting class
> docstrings too.
The docstring of an object (whether function or class or module) is the
object's ‘__doc__’ attribute. Access that attribute
Sometimes when using class inheritance, I want the overriding methods
of the subclass to get the docstring of the matching method in the
base class. You can do this with decorators (after the class
definition), with class decorators, and with metaclasses [1].
However, I was hoping for a way to do
Looks like my 2.7 test_popen failure is an open issue7671... since Jan
2010. Looks like it really does function ok.
At any rate, I was able to test Popen myself today, and it ran fine. I
needed to write a script that will disable the touch pad on this HP g
series, because there is no way to do
On 07Jun2011 20:22, Nitin Pawar wrote:
| import getpass
| user = getpass.getuser()
|
| On Tue, Jun 7, 2011 at 7:54 PM, TheSaint wrote:
| > I was trying to find out whose the program launcher, but os.environ['USER']
| > returns the user whom owns the desktop environment, regardless the program
|
2011/6/8 Sérgio Monteiro Basto :
> hi,
> cat test.py
> #!/usr/bin/env python
> #-*- coding: utf-8 -*-
> u = u'moçambique'
> print u.encode("utf-8")
> print u
>
> chmod +x test.py
> ./test.py
> moçambique
> moçambique
>
> ./test.py > output.txt
> Traceback (most recent call last):
> File "./test.py
Sérgio Monteiro Basto writes:
> ./test.py
> moçambique
> moçambique
In this case your terminal is reporting its encoding to Python, and it's
capable of taking the UTF-8 data that you send to it in both cases.
> ./test.py > output.txt
> Traceback (most recent call last):
> File "./test.py", li
On Wed, 08 Jun 2011 21:58:17 +0800, TheSaint wrote:
>> os.geteuid
> This return 0 for *root* . I don't know if it's a standard for all distro.
UID 0 is the "superuser". The name "root" is conventional, but it's the
EUID (effective UID) which is used in permission checks; the kernel
doesn't care a
>On 03/06/2011 03:58, Chris Torek wrote:
>>> -
>> This is a bit surprising, since both "s1 in s2" and re.search()
>> could use a Boyer-Moore-based algorithm for a sufficiently-long
>> fixed string, and the time required should be proportional to that
hi,
cat test.py
#!/usr/bin/env python
#-*- coding: utf-8 -*-
u = u'moçambique'
print u.encode("utf-8")
print u
chmod +x test.py
./test.py
moçambique
moçambique
./test.py > output.txt
Traceback (most recent call last):
File "./test.py", line 5, in
print u
UnicodeEncodeError: 'ascii' codec
On 11-06-08 06:28 PM, Tom Brown wrote:
I found that PyEval_ReleaseLock() was necessary to keep the program
from hanging. The lock() and unlock() methods were used in a previous
attempt to lock/unlock the GIL.
I just tried your example code and indeed it segfaults as is, but works
fine for me
En Wed, 08 Jun 2011 12:28:56 -0300, Jay Osako
escribió:
I have been trying to get PyODBC to work with Python 2.6 (the latest
version it is known to be compatible with) and Django, but have run
into a problem which, according to the information I've got elsewhere,
probably stems from a DLL inc
On Wed, Jun 8, 2011 at 2:11 PM, Jason Tackaberry wrote:
> On 11-06-07 07:29 PM, Tom Brown wrote:
>
>> Any suggestions will be appreciated.
>>
>
> Why are you calling PyEval_ReleaseLock() in the CmdThread constructor?
> This looks suspicious.
>
> Also, I don't see where CmdThread::lock() and CmdT
Before proceeding further, my system configuration is as follows:
Mac OS X 10.6.6
MATLAB 2010b
ActiveState Python 2.7
I have a gui built using matlab. I wrote the following python script
to open that matlab gui using pymatlab python module:
from pymatlab.matlab import MatlabSession
session = M
On 11-06-07 07:29 PM, Tom Brown wrote:
Any suggestions will be appreciated.
Why are you calling PyEval_ReleaseLock() in the CmdThread constructor?
This looks suspicious.
Also, I don't see where CmdThread::lock() and CmdThread::unlock() are
being invoked in your example. Relics from your e
On Wed, Jun 8, 2011 at 1:05 PM, Raymond Hettinger wrote:
> On Jun 6, 10:47 am, geremy condra wrote:
>> On Fri, Jun 3, 2011 at 1:17 PM, Raymond Hettinger wrote:
>> > Thanks for all the feedback on the earlier post.
>>
>> > I've updated the recipe to use a cleaner API, simpler code,
>> > more easi
In Cathy James
writes:
> b) I would like to append to my list, but my line dogs.dogAppend() is
> giving a TypeError:
> for i in enumerate (self.dogAppend()):
> TypeError: 'list' object is not callable
> def dogAppend(self):
> self.dogAppend = []
You have a method and a list that
On Wed, Jun 8, 2011 at 1:09 PM, Cathy James wrote:
> I am almost there, but I need a little help:
>
> I would like to
>
> a) print my dogs in the format index. name: breed as follows:
>
> 0. Mimi:Poodle
> 1.Sunny: Beagle
> 2. Bunny: German Shepard
> I am getting
>
> (0, ('Mimi', 'Poodle')) . Mimi
Cathy James wrote:
I am almost there, but I need a little help:
I would like to
a) print my dogs in the format index. name: breed as follows:
0. Mimi:Poodle
1.Sunny: Beagle
2. Bunny: German Shepard
I am getting
(0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have I done wrong?
b) I wou
On Wed, Jun 8, 2011 at 11:22 AM, G00gle and Python Lover
wrote:
> Hello.
> I almost like everything in Python. Code shrinking, logic of processes,
> libraries, code design etc.
> But, we... - everybody knows that Python 2.x has lack of unicode support.
> In Python 3.x, this has been fixed :) And I
Hi for all,
I'm very newbie in python and is very good language.
I'm trying to adopt a example:
import smtpd
import asyncore
server = smtpd.PureProxy(('127.0.0.1', 1025), ('mail', 25))
asyncore.loop()
I'm trying to copy the email that is send to another email in maildir format.
Here, i'm read
On Wed, 08 Jun 2011 21:58:17 +0800
TheSaint wrote:
> Kushal Kumaran wrote:
>
> > os.geteuid
> This return 0 for *root* . I don't know if it's a standard for all
> distro. Mine is Archlinux.
> I'd just like to avoid error caused by wrong access by user
>
It is. Until Linux capabilities, EUID==0
On Jun 6, 10:47 am, geremy condra wrote:
> On Fri, Jun 3, 2011 at 1:17 PM, Raymond Hettinger wrote:
> > Thanks for all the feedback on the earlier post.
>
> > I've updated the recipe to use a cleaner API, simpler code,
> > more easily subclassable, and with optional optimizations
> > for better c
I am almost there, but I need a little help:
I would like to
a) print my dogs in the format index. name: breed as follows:
0. Mimi:Poodle
1.Sunny: Beagle
2. Bunny: German Shepard
I am getting
(0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have I done wrong?
b) I would like to append to
On Wed, Jun 8, 2011 at 12:06 PM, Pony wrote:
> Hi all,
>
> I'm a newbie with python, and I have a question about running parallel
> C++ binaries with python.
>
> Suppose I have a C++ binary named "test" and it takes two inputs, if I
> want to run below three commands in bash:
> test a b
> test c d
Hi all,
I'm a newbie with python, and I have a question about running parallel
C++ binaries with python.
Suppose I have a C++ binary named "test" and it takes two inputs, if I
want to run below three commands in bash:
test a b
test c d
test e f
What's the best way to run it parallel with python?
Hello.
I almost like everything in Python. Code shrinking, logic of processes,
libraries, code design etc.
But, we... - everybody knows that Python 2.x has lack of unicode support.
In Python 3.x, this has been fixed :) And I like 3.x more than 2.x
But, still major applications haven't been ported t
On Jun 8, 9:57 am, Santi wrote:
> For static html testing, I'd avoid using Selenium. Even though Selenium is
> *the* tool for RIA and javascript intensive environments, feels like bringing
> up a browser with all the coordination and resources that it takes just to
> crawl the website and find
HI All,
I have created an application for Mac OS using py2app module, in my
python script i have external modules such as MySQLdb and other ,
while trying to run on Mac OS i get an error saying unable to import
the module MySQLdb.
On Windows i convert python script to an exe using py2exe module an
[i'm bcc'ing this to python-list because it's something that is
generic to python, not pyjamas]
On Tue, Jun 7, 2011 at 4:38 PM, Alexander Tsepkov wrote:
> I'm working on a python-based side project where I want to be able to
> generate multiple variations of the program and I really like the way
On Jun 8, 7:38 pm, "ru...@yahoo.com" wrote:
> On 06/07/2011 06:30 PM, Roy Smith wrote:
>
>
>
> > On 06/06/2011 08:33 AM, rusi wrote:
> >>> Evidently for syntactic, implementation and cultural reasons, Perl
> >>> programmers are likely to get (and then overuse) regexes faster than
> >>> python prog
hi folks,
I've installed 3.2 and 2.7.1 on a second development notebook from
sources. 3.2 was smooth, and 2.7.1 make test failed test_popen.
All other tests either passed or were skipped for valid reasons. I do
not remember 3.2 failing popen... so I'm wondering about 2.7? I'm
assuming (witho
Hi,
I need to solve symmetric generalized eigenvalue problems with large,
sparse stiffness
and mass matrices, say 'A' and 'B'. The problem is of the form Av =
lambdaBV. I have been using lobpcg (scipy.sparse.linalg.lobpcg), in
Scipy 0.7.2, although this has been giving me incorrect values that
are
hi
We wholesale Amazon Kindle/ Monster Beats / Ipods / Apple products of
all types
Apple iPad 2 16GB WiFi 450$
Apple iPad 2 32GB WiFi580$
Apple iPad 2 64GB WiFi 620$
iPad 2 16GB Wi-Fi+3G Verizon/AT&T 550$
iPad 2 32GB Wi-Fi+3G Verizon/AT&T 650$
iPad 2 64GB Wi-Fi+3G Verizon/AT&T 750
I have been trying to get PyODBC to work with Python 2.6 (the latest
version it is known to be compatible with) and Django, but have run
into a problem which, according to the information I've got elsewhere,
probably stems from a DLL incompatibility - apparently, the standard
CPython distribution f
:: Call for Proposals 2011
RuPy 11 :: Strongly Dynamic Conference
http://rupy.eu/
Poznan, Poland
October 14th-16th, 2011
RuPy is a conference about dynamically typed programming languages. Held for
the first time in April 2007 it gathered enthusiasts from Poland and other
countries.
The idea
On 06/07/2011 06:30 PM, Roy Smith wrote:
> On 06/06/2011 08:33 AM, rusi wrote:
>>> Evidently for syntactic, implementation and cultural reasons, Perl
>>> programmers are likely to get (and then overuse) regexes faster than
>>> python programmers.
>
> "ru...@yahoo.com" wrote:
>> I don't see how the
On 06/08/2011 03:01 AM, Duncan Booth wrote:
> "ru...@yahoo.com" wrote:
>> On 06/06/2011 09:29 AM, Steven D'Aprano wrote:
>>> Yes, but you have to pay the cost of loading the re engine, even if
>>> it is a one off cost, it's still a cost,
[...]
> At least part of the reason that there's no differen
On Wed, 8 Jun 2011 13:58:18 + (UTC)
Andre Majorel wrote:
> Is there a way to keep the definitions of the high-level
> functions at the top of the source ? I don't see a way to
> declare a function in Python.
You don't declare functions in Python. You simply define them. You
could define all
On Jun 8, 1:22 pm, Stuart MacKay
wrote:
> A simple way to do this is use fabric for deployment. It allows you to
> upload a file as if it was a template and replaces any placeholder
> strings with values supplied when you upload. The values can be supplied
> either in a config file or interactivel
Just write the function, at the top of the source. Easy peasy.
On Wed, Jun 8, 2011 at 9:58 AM, Andre Majorel wrote:
> Is there a way to keep the definitions of the high-level
> functions at the top of the source ? I don't see a way to
> declare a function in Python.
>
> Thanks in advance.
>
> --
Kushal Kumaran wrote:
> os.geteuid
This return 0 for *root* . I don't know if it's a standard for all distro.
Mine is Archlinux.
I'd just like to avoid error caused by wrong access by user
--
goto /dev/null
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to keep the definitions of the high-level
functions at the top of the source ? I don't see a way to
declare a function in Python.
Thanks in advance.
--
André Majorel http://www.teaser.fr/~amajorel/
J'ai des droits. Les autres ont des devoirs.
--
http://mail.python.org/mailman/lis
For static html testing, I'd avoid using Selenium. Even though Selenium is
*the* tool for RIA and javascript intensive environments, feels like bringing
up a browser with all the coordination and resources that it takes just to
crawl the website and find 404s is an overkill.
What we implemented
On 6/8/11 8:00 AM, peter wrote:
I'm writing some fairly simple code using a Tkinter GUI, and found I
wanted a Combo box. As Tkinter does not provide one, I turned to
Tix, and struggled. Extensive googling failed to turn up any python
specific documentation, and there was no obvious way to tran
I'm writing some fairly simple code using a Tkinter GUI, and found I
wanted a Combo box. As Tkinter does not provide one, I turned to
Tix, and struggled. Extensive googling failed to turn up any python
specific documentation, and there was no obvious way to translate the
Tcl documentation.
Noth
A simple way to do this is use fabric for deployment. It allows you to
upload a file as if it was a template and replaces any placeholder
strings with values supplied when you upload. The values can be supplied
either in a config file or interactively when the deployment takes place.
For my dj
Am 08.06.2011 11:13 schrieb Robin Becker:
we have been using base62 ie 0-9A-Za-z just to reduce the name length.
Ugly concerning calculation. Then maybe better use radix32 - 0..9a..v,
case-insensitive.
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Do you have any recommendations for a good book about Web design with
Django?
Thanks for suggestions.
--
http://mail.python.org/mailman/listinfo/python-list
On 07/06/2011 21:42, Paul Rubin wrote:
geremy condra writes:
# adds random junk to the filename- should make it hard to guess
rrr = os.urandom(16)
fname += base64.b64encode(rrr)
Don't use b64 output in a filename -- it can have slashes in it! :-(
Simplest is to use old fashioned hexadeimal
"ru...@yahoo.com" wrote:
> On 06/06/2011 09:29 AM, Steven D'Aprano wrote:
>> Yes, but you have to pay the cost of loading the re engine, even if
>> it is a one off cost, it's still a cost,
>
> ~$ time python -c 'pass'
> real 0m0.015s
> user 0m0.011s
> sys 0m0.003s
>
> ~$ time python
On Jun 7, 11:37 pm, "ru...@yahoo.com" wrote:
> On 06/06/2011 08:33 AM, rusi wrote:
>
> > For any significant language feature (take recursion for example)
> > there are these issues:
>
> > 1. Ease of reading/skimming (other's) code
> > 2. Ease of writing/designing one's own
> > 3. Learning curve
>
On Jun 7, 10:42 pm, Tim wrote:
> On Jun 7, 2:05 pm, Miki Tebeka wrote:
>
> >http://pypi.python.org/pypi/selenium?
>
> I looked at Selenium and it may be what I need, but when I searched
> for selenium and "broken link" (one of the things I need to test for),
> I found only an unanswered
> questi
Hello Everyone:
I am trying to find a way to extract and remove database connection
information (username, password, schema name) from the application
source. I need to do this because in my organization - for security
reasons - access to databases is controlled by a separate department;
and as
Nobody writes:
>>> If you're going to read from /dev/urandom, limit it to a few bytes per
>>> minute, not per request.
>> That's really not going to help you.
> In what way?
> If I need security, I'll use /dev/random or /dev/urandom. If I don't, I'll
> save the real entropy for something which nee
Am 08.06.2011 09:19 schrieb Adam Przybyla:
nazmul.is...@gmail.com wrote:
I need to call a python function from a Matlab environment. Is it
possible?
Let's assume, I have the following python code:
def squared(x):
y = x * x
return y
I want to call squared(3) from Matlab workspace/code
Am 08.06.2011 07:12 schrieb nazmul.is...@gmail.com:
I need to call a python function from a Matlab environment. Is it
possible?
Let's assume, I have the following python code:
def squared(x):
y = x * x
return y
I want to call squared(3) from Matlab workspace/code and get 9.
Thanks f
nazmul.is...@gmail.com wrote:
> I need to call a python function from a Matlab environment. Is it
> possible?
>
> Let's assume, I have the following python code:
>
> def squared(x):
>y = x * x
>return y
>
> I want to call squared(3) from Matlab workspace/code and get 9.
>
> Thanks for
On Tue, 07 Jun 2011 19:38:29 -0700, Paul Rubin wrote:
>> Personally, I'd take whatever "cheap" entropy I can get and hash it.
>> If you're going to read from /dev/urandom, limit it to a few bytes per
>> minute, not per request.
>
> That's really not going to help you.
In what way?
If I need sec
On Wed, Jun 8, 2011 at 4:56 AM, Terry Reedy wrote:
> On 6/7/2011 7:05 PM, John Posner wrote:
>
>> You might want to try "new style" string formatting [1], which I think
>> is better than the "old style" in this particular case:
>>
>> >>> "Testing {0:0{1}d}".format(42, 4)
>> 'Testing 0042'
>
60 matches
Mail list logo