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 Python
On Aug 1, 5:39 pm, Andrea Di Mario 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)
reacto
harrismh777 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 will fix that.
--
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
--
http://mail.python.org/mailman/
On Tue, Aug 2, 2011 at 8:30 AM, AndDM wrote:
> def receive_signal(signum, stack):
> logging.info('Received: %s' % signum)
> reactor.stop()
> signal.signal(signal.SIGTERM, receive_signal)
> signal.signal(signal.SIGHUP, receive_signal)
> sign
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 r
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() , whic
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 t
On Tue, Aug 2, 2011 at 10:20 AM, Stefan Behnel 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 modified script but t
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 ?
>
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 format
Hi Dan,
Thanks for the reply.
On Mon, Aug 1, 2011 at 5:45 PM, Dan Stromberg 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 negate
> the key.
I
> 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
On Tue, Aug 2, 2011 at 11:36 AM, Andrea Di Mario 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 child, do all your w
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
S
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
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 some ideas?
>
> SIGTERM cannot be caught - it kills the proce
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.
Tha
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+ (r27
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 it.
On Tue, Aug 2, 2011 at 12:45 PM, Karim 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 the
string there. I
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 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 alphabetic chars ins
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 som
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 08/
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 format
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.
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 = string.ascii_uppercase[:c
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)
> table.getCellByName(it.next()).se
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)
table
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) = f
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 s
On Jul 31, 2:38 pm, gavino 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 importa
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 r
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 wrote:
> On Tue, Aug 2, 2011 at 11:36 AM, Andrea Di Mario
> wrote:
> > If i use SIGCHLD, i will have difficult when parent receive a SIGTERM, or
> not?
>
> What you would
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 m
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
org
On Tue, Aug 2, 2011 at 3:45 PM, Steven D'Aprano
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 control of my PC again.
> Sigh.)
>
On Aug 1, 3:19 am, Teemu Likonen 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 peopl
On Tue, Aug 2, 2011 at 4:52 PM, smith jack 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 (.*?) how should make it
done? ((.*?)){1,3} seems not work, any method to define repeat
string using python regex?
--
http://mail.python.org/
On Tue, Aug 2, 2011 at 5:03 PM, rantingrick 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 introduce a new Pa
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 wrote:
> Hi Dan,
>
> Thanks for the reply.
>
> On Mon, Aug 1, 2011 at 5:45 PM, Dan Stromberg wrote:
> >
> > Python 2.x, or Python 3.x?
>
> Currently Python 2.x.
>
So it sounds like you may want to move this code to 3.x in the future.
> > What are
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 (.*?) how should make it
done? ((.*?)){1,3} seems not work, any method to define repeat
string using
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
On Tue, Aug 2, 2011 at 9:20 AM, 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 (.*?) how should make it
> done? ((.*?)){1,3} seems not work, any method to define r
On Tue, Aug 2, 2011 at 7:19 AM, Neal Becker 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 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 operations. If
"len" c
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 chang
On Tue, Aug 2, 2011 at 9:55 AM, 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
On 02/08/11 19:42, Chris Angelico wrote:
> On Tue, Aug 2, 2011 at 6:18 PM, Thomas Jollans 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;
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,
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 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 most
> pro
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 to
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)
svr.myn
* smith jack [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,
not java.
The de
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)
s
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 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 than call
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,ma
On Tue, Aug 2, 2011 at 11:21 PM, Gelonida N 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 feature - once again,
On 08/03/2011 12:26 AM, Chris Angelico wrote:
> On Tue, Aug 2, 2011 at 11:21 PM, Gelonida N 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, i
On 08/03/2011 12:26 AM, Chris Angelico wrote:
> On Tue, Aug 2, 2011 at 11:21 PM, Gelonida N 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, i
On Jul 31, 11:38 am, gavino wrote:
> On Jul 13, 1:04 pm, ccc31807 wrote:
>
>
>
>
>
>
>
>
>
> > On Jul 12, 7:54 am, Xah Lee wrote:
>
> > > maybe this will be of interest.
>
> > > 〈What Programing Language Are the Largest Website Written
> > > In?〉http://xahlee.org/comp/website_lang_popularity.ht
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, peopl
On Tue, Aug 2, 2011 at 11:02 AM, 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?
Pass reverse=
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 answe
On Tue, Aug 2, 2011 at 3:13 AM, Thomas Jollans 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 hardlinked dire
On Wed, Aug 3, 2011 at 2:45 AM, gc 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 immutable va
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 l
On Tue, Aug 2, 2011 at 5:53 PM, Chris Rebert wrote:
> On Tue, Aug 2, 2011 at 11:02 AM, smith jack 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
> "sorteddict" (which
On Tue, Aug 2, 2011 at 10:15 PM, 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)
> fo
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 ite
Perhaps:
http://code.google.com/p/python-graph/
On Tue, Aug 2, 2011 at 8:03 PM, Rita 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: a->(b,c)->d
> o
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)
On Wed, Aug 3, 2011 at 7:29 AM, Dan Stromberg wrote:
>
> On Tue, Aug 2, 2011 at 3:13 AM, Thomas Jollans 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 dir
Andrew Berg wrote:
> He hasn't replied to his last two troll threads, though. It does seem
> odd to write a wall of text and then not respond to replies. To be fair,
> though, most replies either mock him or point out that he's a troll. :D
His recent rants do seem a lot more Xah-Lee-like; a huge
95 matches
Mail list logo