Hi,
I've just uploaded pypiserver 0.1.3 to the python package index.
pypiserver is a minimal PyPI compatible server. It can be used to serve
a set of packages and eggs to easy_install or pip.
pypiserver is easy to install (i.e. just easy_install pypiserver). It
doesn't have any external
We're pleased to announce the release of Python Tools for Visual Studio - RC 2.
Python Tools for Visual Studio (PTVS) is an open-source plug-in for Visual
Studio which supports programming with the Python programming language. PTVS is
released under the Apache License, 2.0. This release
On Mon, Aug 1, 2011 at 8:22 PM, Tony Zhang warriorla...@gmail.com wrote:
Thanks!
Actually, I used .readline() to parse file line by line, because I need
to find out the start position to extract data into list, and the end
point to pause extracting, then repeat until the end of file.
My file
The following is intended as a helpful small extension to the xrange()
range() discussion brought up this past weekend by Billy Mays...
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() , which returns an iterator.
With
On Aug 1, 5:39 pm, Andrea Di Mario anddima...@gmail.com wrote:
Thanks Thomas, it is what i'm looking for.
Regards
--
Andrea Di Mario
Hi, i've a little problem, here the code that i use:
def receive_signal(signum, stack):
logging.info('Received: %s' % signum)
harrismh777 har...@member.fsf.org wrote:
these will run on either Python2 or
Python3... except that if you substitute xrange() for range() for
Python2 they will throw an exception on Python3... doh.
if 'xrange' not in dir(__builtins__):
xrange = range
at the beginning of your program
Chris Rebert wrote:
The running result was that read a 500M file consume almost 2GB RAM, I
cannot figure it out, somebody help!
If you could store the floats themselves, rather than their string
representations, that would be more space-efficient. You could then
also use the `array`
Am 02.08.2011 09:30 schrieb AndDM:
The function works for SIGHUP and SIGINT, but it doesn't work for
SIGTERM. I've tried with simple killall and with -15 option.
Have you some ideas?
SIGTERM cannot be caught - it kills the process the hard way.
HTH,
Thomas
--
On Tue, Aug 2, 2011 at 8:30 AM, AndDM anddima...@gmail.com wrote:
def receive_signal(signum, stack):
logging.info('Received: %s' % signum)
reactor.stop()
signal.signal(signal.SIGTERM, receive_signal)
signal.signal(signal.SIGHUP,
harrismh777 wrote:
The following is intended as a helpful small extension to the xrange()
range() discussion brought up this past weekend by Billy Mays...
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() , which
harrismh777, 02.08.2011 09:12:
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() , which returns an iterator.
With Python3 you must use range(), which produces an iterator; while
xrange() does not exist at all (at least not on 3.2).
Am 02.08.2011 09:12 schrieb harrismh777:
The following is intended as a helpful small extension to the xrange()
range() discussion brought up this past weekend by Billy Mays...
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() ,
I am trying to hardlink all files in a directory structure using
os.link.
This works fine for files, but the directory also contains sub-
directories (which themselves contain files and sub-directories).
However I do not think it is possible to hard link directories ?
So presumably I would need
On Tue, Aug 2, 2011 at 10:20 AM, Stefan Behnel stefan...@behnel.de wrote:
What version of Py3 were you using? If you used the latest, maybe even the
latest hg version, you will notice that that's substantially faster for
integers than, e.g. 3.1.x.
I just tried this out, using a slightly
loial wrote:
I am trying to hardlink all files in a directory structure using
os.link.
This works fine for files, but the directory also contains sub-
directories (which themselves contain files and sub-directories).
However I do not think it is possible to hard link directories ?
So
On 02/08/11 11:32, loial wrote:
I am trying to hardlink all files in a directory structure using
os.link.
This works fine for files, but the directory also contains sub-
directories (which themselves contain files and sub-directories).
However I do not think it is possible to hard link
On Tue, Aug 2, 2011 at 10:05 AM, Peter Otten __pete...@web.de wrote:
i/2 returns a float in Python 3; you should use i//2 for consistency.
And I forgot to make this change before doing my tests. Redoing the
Python 3 ones with // quite drastically changes things!
3.2 (r32:88445, Feb 20 2011,
I love named tuples, they rock for this kind of task: storing
complicated structure in a python compatible way, without too much
hassle.
And as far as load/save on disk is concerned, I simply use regular
python structure with safe eval [1]. I get all the flexibility that I
need for the file
Hi Dan,
Thanks for the reply.
On Mon, Aug 1, 2011 at 5:45 PM, Dan Stromberg drsali...@gmail.com wrote:
Python 2.x, or Python 3.x?
Currently Python 2.x.
What are the types of your sort keys?
Both numbers and strings.
If you're on 3.x and the key you need reversed is numeric, you can
You won't be able to catch SIGTERM, as Thomas said, but if you need to
know what caused a process to end, the best way is to have code in the
parent process to catch SIGCHLD. When the child ends, for any reason,
its parent is sent SIGCHLD with some parameters, including the signal
number that
On Tue, Aug 2, 2011 at 11:36 AM, Andrea Di Mario anddima...@gmail.com wrote:
If i use SIGCHLD, i will have difficult when parent receive a SIGTERM, or not?
What you would do is create two processes. Set up your signal
handlers, then fork; in the parent, just watch for the child's death -
in the
Thanks Peter! Your explanation is great!
And one more question:
Why it is still keeping the memory even when I del the large array in
interactive python mode?
-Original Message-
From: Peter Otten [mailto:__pete...@web.de]
Sent: Tuesday, August 02, 2011 4:26 PM
To: python-list@python.org
On 02/08/11 13:00, 张彤 wrote:
Thanks Peter! Your explanation is great!
And one more question:
Why it is still keeping the memory even when I del the large array in
interactive python mode?
This is an optimisation of the way the Python interpreter allocates
memory: it holds on to memory it's
守株待兔 wrote:
from matplotlib.matlab import *
maybe you didn't install it
http://matplotlib.sourceforge.net/
BTW you haven't mention what version of python you're running.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Aug 2, 2011 at 1:56 PM, Thomas Rachel
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de
wrote:
Am 02.08.2011 09:30 schrieb AndDM:
The function works for SIGHUP and SIGINT, but it doesn't work for
SIGTERM. I've tried with simple killall and with -15 option.
Have you
Am 02.08.2011 10:26 schrieb Thomas Rachel:
Am 02.08.2011 09:30 schrieb AndDM:
The function works for SIGHUP and SIGINT, but it doesn't work for
SIGTERM. I've tried with simple killall and with -15 option.
Have you some ideas?
SIGTERM cannot be caught - it kills the process the hard way.
Hello,
I need a generator to create the cellname in a excell (using pyuno)
document to assign value to
the correct cell. The following code does this but do you have some
optimizations
on it, for instance to get the alphabetic chars instead of hard-coding it.
Cheers
karim
Python 2.7.1+
Am 02.08.2011 13:45, schrieb Karim:
Hello,
I need a generator to create the cellname in a excell (using pyuno)
document to assign value to
the correct cell. The following code does this but do you have some
optimizations
on it, for instance to get the alphabetic chars instead of hard-coding
On Tue, Aug 2, 2011 at 12:45 PM, Karim kliat...@gmail.com wrote:
... for char in cellnames.replace('', ' ').split()[:cols]:
for char in cellnames[:cols]:
Strings are iterable over their characters. Alternatively, you could
use chr and ord, but it's probably cleaner and simpler to have
On 08/01/2011 06:06 PM, Steven D'Aprano wrote:
Does your definition of fixed mean gives wrong results for n= 4 ?
fibo(4) == 3
False
Well, I don't know if you're trolling or just dumb:
http://en.wikipedia.org/wiki/Fibonacci_number
In [2]: for i in range(10):
...: print fibo(i)
On Tue, Aug 2, 2011 at 1:45 PM, Karim kliat...@gmail.com wrote:
Hello,
I need a generator to create the cellname in a excell (using pyuno)
document to assign value to
the correct cell. The following code does this but do you have some
optimizations
on it, for instance to get the
Karim wrote:
I need a generator to create the cellname in a excell (using pyuno)
document to assign value to the correct cell.
Isn't there a way to use a (row, column) tuple directly? If so I'd prefer
that. Also, there used to be an alternative format to address a spreadsheet
cell with
On 08/02/2011 04:32 AM, loial wrote:
I am trying to hardlink all files in a directory structure using
os.link.
Or is there an easier way to hardlink everything in a directory
structure?.
The requirement is for hard links, not symbolic links
While Peter Thomas gave good answers, also be aware
Thanks Paul,
I never used string module.
In fact, cellnames.split('') gives a syntax error w/ empty string.
That's why I use the intermediate replace() which accept that.
Cheers
Karim
On 08/02/2011 02:04 PM, Paul Kölle wrote:
Am 02.08.2011 13:45, schrieb Karim:
Hello,
I need a generator
Thanks Chris!
It seems I am blind I should have seen it...
In fact I started with the need (imaginary) to use enumerate() to get
some indices
but ended in a more simple code. Indeed, your's is simpler.
For the double chars extension I will see if I need it in the future.
Cheers
Karim
On
On 08/02/2011 02:27 PM, Peter Otten wrote:
Karim wrote:
I need a generator to create the cellname in a excell (using pyuno)
document to assign value to the correct cell.
Isn't there a way to use a (row, column) tuple directly? If so I'd prefer
that. Also, there used to be an alternative
Billy Mays
81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes:
On 08/01/2011 06:06 PM, Steven D'Aprano wrote:
Does your definition of fixed mean gives wrong results for n= 4 ?
Well, I don't know if you're trolling or just dumb:
Steven is right, and you look dumb.
fibo(4)
Thanks Martin,
This is the generator expression version.
I can use both function generator or generator expression version
correction.
Cheers
Karim
On 08/02/2011 02:47 PM, Martin Gracik wrote:
def get_cellnames2(rows, cols):
rows = range(1, rows + 1)
cols =
On 08/02/2011 08:45 AM, Alain Ketterlin wrote:
produce integers. And it will fail with overflow for big values.
If it would make you feel better I can use decimal.
Also, perhaps I can name my function billy_fibo(n), which is defined as
billy_fibo(n) +error(n) = fibo(n), where error(n) can be
Karim wrote:
values = ( (22.5,21.5,121.5),
(5615.3,615.3,-615.3),
(-2315.7,315.7,415.7) )
it = _xrange_cellnames(rows=len(value), cols=len(values[0]))
table.getCellByName(it.next()).setValue(22.5)
table.getCellByName(it.next()).setValue(5615.3)
On 08/02/2011 03:59 PM, Peter Otten wrote:
Karim wrote:
values = ( (22.5,21.5,121.5),
(5615.3,615.3,-615.3),
(-2315.7,315.7,415.7) )
it = _xrange_cellnames(rows=len(value), cols=len(values[0]))
table.getCellByName(it.next()).setValue(22.5)
table.getCellByName(it.next()).setValue(5615.3)
I thought this was an interesting article
http://www.pipeline.com/~hbaker1/Use1Var.html
--
http://mail.python.org/mailman/listinfo/python-list
Billy Mays wrote:
On 08/02/2011 08:45 AM, Alain Ketterlin wrote:
produce integers. And it will fail with overflow for big values.
If it would make you feel better I can use decimal.
Also, perhaps I can name my function billy_fibo(n), which is defined as
billy_fibo(n) +error(n) = fibo(n),
Hi ,
I need an api that can be used to do following operations on Subversion
repository tool:
1. Create branch
2. Check out
3. Check in
4. Merge
Regards,
Shambhu
--
http://mail.python.org/mailman/listinfo/python-list
On 08/02/2011 10:15 AM, Steven D'Aprano wrote:
So you say, but I don't believe it. Given fibo, the function you provided
earlier, the error increases with N:
fibo(82) - fib(82) # fib returns the accurate Fibonacci number
160.0
fibo(182) - fib(182)
2.92786721937918e+23
Hardly arbitrarily
On Jul 31, 2:38 pm, gavino gavcom...@gmail.com wrote:
facebook is php
myspace is microsoft
aol was tcl and aolserver c embedding tcl interp
priceline is lisp
reddit is python was lisp orig
amazon was perl
livejournal was perl
Most of these are tech companies. Tech companies are very
On 02/08/2011 14:02, Shambhu Rajak wrote:
I need an api that can be used to do following operations on Subversion
repository tool:
1.Create branch
2.Check out
3.Check in
4.Merge
http://pysvn.tigris.org/
(which is, by the way, the first Google hit for Python Subversion
bindings)
TJG
--
harrismh777 wrote:
The following is intended as a helpful small extension to the xrange()
range() discussion brought up this past weekend by Billy Mays...
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() , which
you shouldn't have anything to worry about SIGTERM if you send out a SIGCHLD
On Tue, Aug 2, 2011 at 3:44 AM, Chris Angelico ros...@gmail.com wrote:
On Tue, Aug 2, 2011 at 11:36 AM, Andrea Di Mario anddima...@gmail.com
wrote:
If i use SIGCHLD, i will have difficult when parent receive a
On 8/1/11 8:54 AM, Thorsten Kampe wrote:
The documentation[1] says If you are upgrading to version 0.11 of
IPython, you will need to migrate your old ipythonrc or ipy_user_conf.py
configuration files to the new system. Read on for information on how to
do this. Unfortunately there is no more
I am using pydev plugin in eclipse, all things works just as well
but now i have confronted with a confusing problem, that is i can
import a module write by myself successfully, but when i try to run
this program,
error just shows up, what's wrong?
the directory structure is as follows:
src
On Tue, Aug 2, 2011 at 3:45 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
(But don't make the mistake of doing what I did, which was to attempt to
produce range(29000) in Python 2. After multiple *hours* of swapping, I
was finally able to kill the Python process and get
On Aug 1, 3:19 am, Teemu Likonen tliko...@iki.fi wrote:
* 2011-07-30T10:57:29+10:00 * Steven D'Aprano wrote:
Teemu Likonen wrote:
Pathnames and the separator for pathname components should be
abstracted away, to a pathname object.
Been there, done that, floundered on the inability of
On Tue, Aug 2, 2011 at 4:52 PM, smith jack thinke...@gmail.com wrote:
from org.test.A import A
This is going to look for org/test/A.py but not for org.test/A.py -
are you able to rename your directories to not have dots?
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
if it's for a single character, this should be very easy, such as
c{m,n} the occurrence of c is between m and n,
if i want to define the occurrence of (.*?)/div how should make it
done? ((.*?)/div){1,3} seems not work, any method to define repeat
string using python regex?
--
On Tue, Aug 2, 2011 at 5:03 PM, rantingrick rantingr...@gmail.com wrote:
This thread was intended to expose another PyWart and get the
community juices flowing. os.path is broken and cannot be repaired
because os.path was an improper API to begin with. The only way to
solve this problem is to
As I understand it, Python exclusively late-binds names; when you
define a function, nothing is ever pre-bound. This allows a huge
amount of flexibility (letting you reach into someone else's
function and change its behaviour), but it's flexibility that most
programs use seldom if at all.
First
On Tue, Aug 2, 2011 at 3:25 AM, Alistair Miles aliman...@googlemail.comwrote:
Hi Dan,
Thanks for the reply.
On Mon, Aug 1, 2011 at 5:45 PM, Dan Stromberg drsali...@gmail.com wrote:
Python 2.x, or Python 3.x?
Currently Python 2.x.
So it sounds like you may want to move this code to
On 02/08/2011 17:20, smith jack wrote:
if it's for a single character, this should be very easy, such as
c{m,n} the occurrence of c is between m and n,
if i want to define the occurrence of (.*?)/div how should make it
done? ((.*?)/div){1,3} seems not work, any method to define repeat
On 02/08/11 18:55, Chris Angelico wrote:
As I understand it, Python exclusively late-binds names; when you
define a function, nothing is ever pre-bound. This allows a huge
amount of flexibility (letting you reach into someone else's
function and change its behaviour), but it's flexibility that
On Tue, Aug 2, 2011 at 9:20 AM, smith jack thinke...@gmail.com wrote:
if it's for a single character, this should be very easy, such as
c{m,n} the occurrence of c is between m and n,
if i want to define the occurrence of (.*?)/div how should make it
done? ((.*?)/div){1,3} seems not work,
On Tue, Aug 2, 2011 at 7:19 AM, Neal Becker ndbeck...@gmail.com wrote:
I thought this was an interesting article
http://www.pipeline.com/~hbaker1/Use1Var.html
See also:
http://en.wikipedia.org/wiki/Uniqueness_type
Cheers,
Chris
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Aug 2, 2011 at 6:18 PM, Thomas Jollans t...@jollybox.de wrote:
I suppose it would be possible to introduce a kind of constant
globals namespace that a JIT compiler could then use to optimise, but
how much would this help?
Surely it must help a lot; looking up names is string
the source code is as follows
x={}
x['a'] = 11
x['c'] = 19
x['b'] = 13
print x
tmp = sorted(x.items(), key = lambda x:x[0])# increase order by
default, if i want to have a descending order, what should i do?
# after sorted is called, a list will be generated, and the hash list
x is not
On Tue, Aug 2, 2011 at 9:55 AM, Chris Angelico ros...@gmail.com wrote:
As I understand it, Python exclusively late-binds names; when you
define a function, nothing is ever pre-bound. This allows a huge
amount of flexibility (letting you reach into someone else's
function and change its
On 02/08/11 19:42, Chris Angelico wrote:
On Tue, Aug 2, 2011 at 6:18 PM, Thomas Jollans t...@jollybox.de wrote:
I suppose it would be possible to introduce a kind of constant
globals namespace that a JIT compiler could then use to optimise, but
how much would this help?
Surely it must help
On 02/08/11 20:02, smith jack wrote:
the source code is as follows
x={}
x['a'] = 11
x['c'] = 19
x['b'] = 13
print x
tmp = sorted(x.items(), key = lambda x:x[0])# increase order by
default, if i want to have a descending order, what should i do?
# after sorted is called, a list
If you click the more options link, there is an option in the sub-
menu to report a post as spam. You can also forward it along with the
offending e-mail address to s...@uce.gov
--
http://mail.python.org/mailman/listinfo/python-list
Chris Angelico ros...@gmail.com writes:
As I understand it, Python exclusively late-binds names; when you
define a function, nothing is ever pre-bound. This allows a huge
amount of flexibility (letting you reach into someone else's
function and change its behaviour), but it's flexibility that
ANNOUNCING
eGenix.com mx Base Distribution
Version 3.2.1 for Python 2.4 - 2.7
Open Source Python extensions providing
important and useful services
* 2011-08-02T11:03:24-07:00 * Chris Rebert wrote:
Smart enough JITers can infer that late binding is not being exploited
for certain variables and thus optimize them accordingly. Look how
fast some of the JavaScript VMs are, despite JavaScript also being
highly dynamic.
Or Common Lisp. It
There are so many choice to do the same thing, so is there any special
advantage Django brings to user?
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 03 Aug 2011 03:28:14 +0800, smith jack wrote:
There are so many choice to do the same thing, so is there any special
advantage Django brings to user?
The ability to code in Python instead of Java is the biggest one to me.
--
http://mail.python.org/mailman/listinfo/python-list
On 8/2/2011 12:55 PM, Chris Angelico wrote:
As I understand it, Python exclusively late-binds names; when you
define a function, nothing is ever pre-bound.
By 'pre-bound' you presumably mean bound at definition time rather than
call time. Default arg objects *are* pre-computed and pre-bound
Hi,
Just started playing with m2cryptos xmlrpc
The code I'm is:
import xmlrpclib
from M2Crypto.m2xmlrpclib import Server, SSL_Transport
from M2Crypto.SSL.Context import Context
ctx = Context()
# modify context
svr = Server(rpc_url, SSL_Transport(ctx), encoding='utf-8')
svr.mymethod1(1)
* smith jack thinke...@gmail.com [110802 11:37]:
There are so many choice to do the same thing, so is there any special
advantage Django brings to user?
Django is a python framework, J2EE is a java platform (my apologies
if I use 'framework' incorrectly). Our customers want PHP,perl or python,
Hi,
Just started playing with m2cryptos xmlrpc
The code I'm using is:
import xmlrpclib
from M2Crypto.m2xmlrpclib import Server, SSL_Transport
from M2Crypto.SSL.Context import Context
ctx = Context()
# modify context
svr = Server(rpc_url, SSL_Transport(ctx), encoding='utf-8')
svr.mymethod1(1)
Hi,
Just started playing with m2crypto's xmlrpc
The code I'm using is:
import xmlrpclib
from M2Crypto.m2xmlrpclib import Server, SSL_Transport
from M2Crypto.SSL.Context import Context
ctx = Context()
# modify context
svr = Server(rpc_url, SSL_Transport(ctx), encoding='utf-8')
svr.mymethod1(1)
On Tue, Aug 2, 2011 at 9:23 PM, Terry Reedy tjre...@udel.edu wrote:
On 8/2/2011 12:55 PM, Chris Angelico wrote:
As I understand it, Python exclusively late-binds names; when you
define a function, nothing is ever pre-bound.
By 'pre-bound' you presumably mean bound at definition time rather
On 08/03/2011 12:08 AM, Chris Angelico wrote:
With the local-variable-snapshot technique (len = len), can anything
be optimized, since the parser can guarantee that nothing ever
reassigns to it? If not, perhaps this would be a place where something
might be implemented:
@const(len,max) #
On Tue, Aug 2, 2011 at 11:21 PM, Gelonida N gelon...@gmail.com wrote:
On the other hand: It might be interesting, that the early binding would
just take place when python is invoked with -O
This could be an excellent safety catch, but on the other hand, it
might destroy all value of the
On 08/03/2011 12:26 AM, Chris Angelico wrote:
On Tue, Aug 2, 2011 at 11:21 PM, Gelonida N gelon...@gmail.com wrote:
On the other hand: It might be interesting, that the early binding would
just take place when python is invoked with -O
This could be an excellent safety catch, but on the
On 08/03/2011 12:26 AM, Chris Angelico wrote:
On Tue, Aug 2, 2011 at 11:21 PM, Gelonida N gelon...@gmail.com wrote:
On the other hand: It might be interesting, that the early binding would
just take place when python is invoked with -O
This could be an excellent safety catch, but on the
On Jul 31, 11:38 am, gavino gavcom...@gmail.com wrote:
On Jul 13, 1:04 pm, ccc31807 carte...@gmail.com wrote:
On Jul 12, 7:54 am, Xah Lee xah...@gmail.com wrote:
maybe this will be of interest.
〈What Programing Language Are the Largest Website Written
please see my attachment ,which widget the region1,region2 is?
how to make it??
re2
Description: Binary data
--
http://mail.python.org/mailman/listinfo/python-list
David wrote:
If you click the more options link, there is an option in the sub-
menu to report a post as spam. You can also forward it along with the
offending e-mail address to s...@uce.gov
What more options link? Are you referring to a specific program? If so,
which?
Remember, people are
On Tue, Aug 2, 2011 at 11:02 AM, smith jack thinke...@gmail.com wrote:
the source code is as follows
x={}
x['a'] = 11
x['c'] = 19
x['b'] = 13
print x
tmp = sorted(x.items(), key = lambda x:x[0]) # increase order by
default, if i want to have a descending order, what should i do?
Hi everyone! Longtime lurker, hardly an expert, but I've been using
Python for various projects since 2007 and love it.
I'm looking for either (A) suggestions on how to do a very common
operation elegantly and Pythonically, or (B) input on whether my
proposal is PEP-able, assuming there's no
On Tue, Aug 2, 2011 at 3:13 AM, Thomas Jollans t...@jollybox.de wrote:
On 02/08/11 11:32, loial wrote:
I am trying to hardlink all files in a directory structure using
os.link.
However I do not think it is possible to hard link directories ?
That is pretty true. I've heard of
On Wed, Aug 3, 2011 at 2:45 AM, gc gc1...@gmail.com wrote:
Anyway, I frequently need to initialize several variables to the same
value, as I'm sure many do. Sometimes the value is a constant, often
zero; sometimes it's more particular, such as defaultdict(list). I use
dict() below.
If it's an
I'm not greatly experienced with context managers and the with statement, so
I would like to check my logic.
Somebody (doesn't matter who, or where) stated that they frequently use this
idiom:
spam = MyContextManager(*args)
for ham in my_iter:
with spam:
# do stuff
but to me that
On Tue, Aug 2, 2011 at 5:53 PM, Chris Rebert c...@rebertia.com wrote:
On Tue, Aug 2, 2011 at 11:02 AM, smith jack thinke...@gmail.com wrote:
the source code is as follows
x={}
x['a'] = 11
x['c'] = 19
x['b'] = 13
print x
If you /really/ need a sorted mapping datatype, google for
On Tue, Aug 2, 2011 at 10:15 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
I'm not greatly experienced with context managers and the with statement, so
I would like to check my logic.
Somebody (doesn't matter who, or where) stated that they frequently use this
idiom:
spam
Hello,
This isn't much of a python question but a general algorithm question.
I plan to input the following string and I would like to generate something
like this.
input: a-(b,c)-d
output:
parent a, child b c
parent b c child d
Are there any libraries or tools which will help me evaluate
Perhaps:
http://code.google.com/p/python-graph/
On Tue, Aug 2, 2011 at 8:03 PM, Rita rmorgan...@gmail.com wrote:
Hello,
This isn't much of a python question but a general algorithm question.
I plan to input the following string and I would like to generate something
like this.
input:
On Wed, 03 Aug 2011 12:15:44 +1000, Steven D'Aprano wrote:
I'm not greatly experienced with context managers and the with statement, so
I would like to check my logic.
Somebody (doesn't matter who, or where) stated that they frequently use this
idiom:
spam = MyContextManager(*args)
for
New submission from Matt Joiner anacro...@gmail.com:
from threading import *
ThreadError
Traceback (most recent call last):
File stdin, line 1, in module
NameError: name 'ThreadError' is not defined
--
components: Library (Lib)
files: export-thread-error.patch
keywords: patch
Scott Dial sc...@scottdial.com added the comment:
I haven't seen anyone use a side-effect-less statement (a string) as a comment
before, but I doubt that is an approved style for the CPython codebase. Please
change the string preceeding the spec_line definition into a proper comment.
New submission from Sagiv Malihi sagivmal...@gmail.com:
When trying to cPickle.loads() from several threads at once, there is a race
condition when threads try to import modules.
An example will explain it best:
suppose I have module foo.py which takes some time to load:
import time
class
Sagiv Malihi sagivmal...@gmail.com added the comment:
OK, digging deeper reveals that there are actually two bugs here, one is
conceptual in the python importing mechanism, and the other is technical in
cPickle.
The first bug:
PyImport_ExecCodeModuleEx adds the module to sys.modules *before*
1 - 100 of 161 matches
Mail list logo