On Mon, Apr 4, 2011 at 10:25 PM, Steven D'Aprano
wrote:
> On Mon, 04 Apr 2011 20:59:52 -0700, geremy condra wrote:
>
>> On Mon, Apr 4, 2011 at 7:45 PM, Steven D'Aprano
>> wrote:
>
>>> * The disclaimers about timing code snippets that can be found in the
>>> timeit module apply. If possible, use t
Hi,
So i want to replace multiple lines in a text file and I have reasoned
the best way to do this is with a dictionary. I have simplified my
example and broadly I get what I want however I am now printing my
replacement string and part of the original expression. I am guessing
that I will need to
Jabba Laci, 04.04.2011 18:54:
I want to construct an XML file with lxml but I don't find how to add
the '' header.
This is not required. According to the XML spec, the default is:
So, unless you diverge from these values, you do not need an XML
declaration in your file. If you want to out
Chroma Key, 04.04.2011 21:49:
On 2011-04-04 18:54:40 +0200, Jabba Laci said:
I want to construct an XML file with lxml but I don't find how to add
the '' header.
from lxml import etree as ET
html = ET.Element("html")
print ET.tostring(html)
Add the "xml_declaration=True" as an argument of e
2011/4/5 Martin De Kauwe :
> Hi,
>
> So i want to replace multiple lines in a text file and I have reasoned
> the best way to do this is with a dictionary. I have simplified my
> example and broadly I get what I want however I am now printing my
> replacement string and part of the original express
How can I make maybe 3D subfigures with Python and matplotlib?
I found the following example (http://matplotlib.sourceforge.net/
examples/mplot3d/subplot3d_demo.html), but it doesn't work.
---
from mpl_toolkits.mplot3d.axes3d import Axes3D
import matplotlib.pyplot as plt
# imports specific to th
How about creating a new string instead of replacing the original.
def replace_keys(text, replacements_dict):
text_list = text.split('\n')
new_text = ''
for line in text_list:
key=line.split('=')[0]
if key.strip() in replacements_dict:
new_text = new_text +
I just came across the Cobra language, which appears to be heavily
influenced by Python (and other languages). The pitch sounds great.
It's supposed to have:
1. Quick, expressive coding
2. Fast execution
3. Static and dynamic binding
4. Language level support for quality
http:/
On 05-Apr-11 06:22 AM, Brendan Simon (eTRIX) wrote:
I just came across the Cobra language, which appears to be heavily
influenced by Python (and other languages). The pitch sounds great. It's
supposed to have:
1. Quick, expressive coding
2. Fast execution
3. Static and dynamic binding
what are the advantages? if it wasn't for python 3 breaking backwards
compatibility would it be the better choice?
--
http://mail.python.org/mailman/listinfo/python-list
are there any good fighting games in the style of street fighter or
guilty gear?
--
http://mail.python.org/mailman/listinfo/python-list
Cobra seems interessant, open-source, but the dependance on Mono and
.Net annoy me a bit.
Otherwise, cobra have good ideas, a syntax similar to python.
One thing i really love is the "How-To" and the "Samples" pages on
it's website, i think it's a very good thing for beginners.
FELD Boris
2011/
Hi all,
I'm a new bie. I have just started learning Python (3.0), finished with
official tutorial. I would like to have your opinion on some
1. Good books (for an intermediate in programming) with lot's of exercise i
can try it out. For example when i started with Perl i was going through a
book
>> what is the character limit on a one liner :P.
>
> For PEP 8 compliance, 80 characters. :-)
Yeah, but we don't live in the 80's or 90's anymore and our screens
can support xterms (or let alone IDE widows) much wider than 80
characters. I'm using 140 for python these days. Seriously, who would
w
On 2011-04-04, Alia Khouri wrote:
> Nice! I didn't think of that. I guess I could get some
> additional performance by taking the re.compile step out of the
> function. Thanks for the tip!
I recommend "The Pragmatic Programmer," (Hunt, Thomas) ISBN
978-0201616224 and "The Practice of Programming,
rusi wrote:
Not sure if this is relevant...
python-mode (emacs mode for python development) is broken for python 3
I submitted a 1-line patch which makes python-mode work for 2.x and
3.x
Its relevant to Mac OSX, but not so much for what I'm doing in Linux, here.
On the other hand, I can't see
neil wrote:
> what are the advantages? if it wasn't for python 3 breaking backwards
> compatibility would it be the better choice?
IMHO the killer app for Python 3 is in more reasonable support for
foreign character sets (no matter where your are, at least one out of
the hundred-odd Unicode char
Here is my problem: Want to program in python to run sysadmin
commands across 1000s of servers and gather the result in one place.
Many times the commands need to be run as root. We cannot use ssh as
root remote connectivity as well. What are the different ways of
programming in python to achie
On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote:
>>> what is the character limit on a one liner :P.
>>
>> For PEP 8 compliance, 80 characters. :-)
>
> Yeah, but we don't live in the 80's or 90's anymore and our screens can
> support xterms (or let alone IDE widows) much wider than 80
On Tue, 2011-04-05 at 18:43 +0530, Jins Thomas wrote:
> Hi all,
>
> I'm a new bie. I have just started learning Python (3.0), finished
> with official tutorial. I would like to have your opinion on some
>
> 1. Good books (for an intermediate in programming) with lot's of
> exercise i can try it
On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano
wrote:
> On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote:
>
>> Seriously, who would want to limit
>> him/herself to 80 characters in 2011?
>
> Seriously, or is that a rhetorical question?
>
> People who like to have two source files side-
On Tue, 2011-04-05 at 15:38 +0200, Daniel Fetchinson wrote:
> Yeah, but we don't live in the 80's or 90's anymore and our screens
> can support xterms (or let alone IDE widows) much wider than 80
> characters. I'm using 140 for python these days. Seriously, who would
> want to limit him/herself to
On Apr 5, 3:59 am, Martin De Kauwe wrote:
> Hi,
>
> So i want to replace multiple lines in a text file and I have reasoned
> the best way to do this is with a dictionary. I have simplified my
> example and broadly I get what I want however I am now printing my
> replacement string and part of the
On 4/4/11 7:05 PM, Robert Kern wrote:
On 4/4/11 3:20 PM, John Ladasky wrote:
However, at least in Python 2.7, multiprocessing seems to have a C extension
module defining the Connection objects. Unfortunately, it looks like this C
extension just imports the regular pickler that is not aware of
On 4/5/2011 8:42 AM, neil wrote:
what are the advantages?
Py3 complete many transitions begun in Py2. In some cases, that means
deleting old obsolete stuff, such as old-style classes.
if it wasn't for python 3 breaking backwards
compatibility would it be the better choice?
Assuming equal
On Apr 5, 6:42 am, neil wrote:
> what are the advantages? if it wasn't for python 3 breaking backwards
> compatibility would it be the better choice?
I adopted Py3 because of support of OrderedDict and many new features.
Since mine was a new project using no existing libraries, it made
sense.
--
On Tue, Apr 5, 2011 at 7:51 AM, Babu wrote:
>
> Here is my problem: Want to program in python to run sysadmin
> commands across 1000s of servers and gather the result in one place.
> Many times the commands need to be run as root. We cannot use ssh as
> root remote connectivity as well. What ar
Hi Philip,
Thanks for the reply.
On Apr 4, 4:34 pm, Philip Semanchuk wrote:
> So if you're going to use multiprocessing, you're going to use pickle, and you
> need pickleable objects.
OK, that's good to know.
> > Pickling is still a pretty
> > vague progress to me, but I can see that you have
On 4/5/2011 9:13 AM, Jins Thomas wrote:
I'm a new bie. I have just started learning Python (3.0),
Please download, install, and use 3.2.
finished with official tutorial.
> I would like to have your opinion on some
1. Good books (for an intermediate in programming) with lot's of
...
2. O
On Tue, 05 Apr 2011 13:18:19 -0400, Terry Reedy wrote:
> On 4/5/2011 9:13 AM, Jins Thomas wrote:
>
>> I'm a new bie. I have just started learning Python (3.0),
>
> Please download, install, and use 3.2.
To elaborate further: Python 3.0 is not supported, and is buggy and slow.
You should avoid
python wrote:
> I have looked a while for this answer. Sorry if it right before me.
>
> I have move from Windows to os x. The thing I miss most is pywin.
> I know you can purchase or download full IDE's for python or even use
> Eclipse. I really liked the ability to switch from interactive
>
On Tue, Apr 5, 2011 at 6:13 AM, Jins Thomas wrote:
> Hi all,
>
> I'm a new bie. I have just started learning Python (3.0), finished with
> official tutorial. I would like to have your opinion on some
>
> 1. Good books (for an intermediate in programming) with lot's of exercise i
> can try it out.
On Wed, 06 Apr 2011 01:19:06 +1000, Chris Angelico wrote:
> On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano
> wrote:
>> On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote:
>>
>>> Seriously, who would want to limit
>>> him/herself to 80 characters in 2011?
>>
>> Seriously, or is that a rh
what is the character limit on a one liner :P.
>>>
>>> For PEP 8 compliance, 80 characters. :-)
>>
>> Yeah, but we don't live in the 80's or 90's anymore and our screens can
>> support xterms (or let alone IDE widows) much wider than 80 characters.
>> I'm using 140 for python these days. Serio
On Apr 5, 2011, at 12:58 PM, John Ladasky wrote:
> Hi Philip,
>
> Thanks for the reply.
>
> On Apr 4, 4:34 pm, Philip Semanchuk wrote:
>> So if you're going to use multiprocessing, you're going to use pickle, and
>> you
>> need pickleable objects.
>
> OK, that's good to know.
But as Dan Str
On Wed, Apr 6, 2011 at 3:48 AM, Steven D'Aprano
wrote:
>> and has on occasion gone as far as 12-16.
>
> I would consider anything more than four indents a code smell. That is,
> four is unexceptional; five would make me look over the code to see if it
> could be refactored; six would make me look
On 05/04/2011 18:24, Steven D'Aprano wrote:
On Tue, 05 Apr 2011 13:18:19 -0400, Terry Reedy wrote:
On 4/5/2011 9:13 AM, Jins Thomas wrote:
I'm a new bie. I have just started learning Python (3.0),
Please download, install, and use 3.2.
To elaborate further: Python 3.0 is not supported, an
On 4/5/2011 7:46 AM, Mel wrote:
neil wrote:
what are the advantages? if it wasn't for python 3 breaking backwards
compatibility would it be the better choice?
IMHO the killer app for Python 3 is in more reasonable support for
foreign character sets (no matter where your are, at least one out
Greetings,
I've been playing around (in Python 3.1) with permutations of
0,1,...,n-1, represented by lists, p, of length n, where p[i] = the
image of i under the permutation. I wanted to be able to calculate the
inverse of such a permutation, and came up with the following succint
but not quite re
On Tue, Apr 5, 2011 at 3:17 PM, scattered wrote:
> Greetings,
>
> I've been playing around (in Python 3.1) with permutations of
> 0,1,...,n-1, represented by lists, p, of length n, where p[i] = the
> image of i under the permutation. I wanted to be able to calculate the
> inverse of such a permuta
yes thanks both work nicely, I will ponder the suggestions.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 5, 5:46 pm, Ian Kelly wrote:
> On Tue, Apr 5, 2011 at 3:17 PM, scattered wrote:
> > Greetings,
>
> > I've been playing around (in Python 3.1) with permutations of
> > 0,1,...,n-1, represented by lists, p, of length n, where p[i] = the
> > image of i under the permutation. I wanted to be ab
[Ian Kelly]
> Which is O(n). If that is too verbose, you could also use a dictionary:
>
> def invert(p):
> return dict(map(reversed, enumerate(p)))
def inv(p):
return dict(zip(p, itertools.count()))
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 5, 6:38 am, Daniel Fetchinson
wrote:
> >> what is the character limit on a one liner :P.
>
> > For PEP 8 compliance, 80 characters. :-)
>
> Yeah, but we don't live in the 80's or 90's anymore and our screens
> can support xterms (or let alone IDE widows) much wider than 80
> characters. I'm
On Tuesday, April 5, 2011 6:17:34 AM UTC-4, MATLABdude wrote:
> How can I make maybe 3D subfigures with Python and matplotlib?
>
> I found the following example (http://matplotlib.sourceforge.net/
> examples/mplot3d/subplot3d_demo.html), but it doesn't work.
>
> [snip]
>
> I am using Python 2.6.6
In article ,
geremy condra wrote:
> On Tue, Apr 5, 2011 at 7:51 AM, Babu wrote:
> >
> > Here is my problem: Want to program in python to run sysadmin
> > commands across 1000s of servers and gather the result in one place.
> > Many times the commands need to be run as root. We cannot use ssh
Is it possible, and if so is it easy, to limit the amount of memory an
embedded Python interpreter is allowed to allocate? I don't want to
ulimit/rlimit the process if I don't have to (or rather, I want the
process's limit to be high, and the Python limit much lower), but just
to force Python to th
I am working on a program to monitor directory file changes and am would
like a configuration file. This file would specify email addresses, file and
directory locations.. Is there a preferred format to use with python?
--
Thanks
Vincent Davis
--
http://mail.python.org/mailman/listinfo/python
On Tue, Apr 5, 2011 at 7:16 PM, Vincent Davis wrote:
> I am working on a program to monitor directory file changes and am would
> like a configuration file. This file would specify email addresses, file and
> directory locations.. Is there a preferred format to use with python?
ConfigParser s
Raymond Hettinger writes:
> On Apr 5, 6:38 am, Daniel Fetchinson
> wrote:
> > Yeah, but we don't live in the 80's or 90's anymore and our screens
> > can support xterms (or let alone IDE widows) much wider than 80
> > characters. I'm using 140 for python these days. Seriously, who
> > would want
> On 05-Apr-11 06:22 AM, Brendan Simon (eTRIX) wrote:
>>
>> Any other arguments where Python has benefits over Cobra ??
>>
>> Cheers, Brendan.
>>
> Two questions:
> 1. Is Cobra Open Source?
> 2. The blog ended on October, did he run out of steam?
>
> I liked the '.', in place of '.s
Hi, everyone:
I encouter a problem: I invoke some c libraries in python
through the api "CDLL".Possibly, there is sth. wrong in my c libraries.
It would appear segment fault when executing some func in c libraries
which invoked through "CDLL". How can I debug?
I attempted to debug it with
On 4/5/2011 4:42 PM, John Nagle wrote:
Well, actually Unicode support went in back around Python 2.4.
Even earlier, I think, but there were and still are problems with
unicode in 2.x. Some were and will only be fixed in 3.x.
In 3.x, ASCII strings went away, but that was more of a removal.
On Tue, Apr 5, 2011 at 10:04 PM, Terry Reedy wrote:
> On 4/5/2011 4:42 PM, John Nagle wrote:
>
> Well, actually Unicode support went in back around Python 2.4.
>>
>
> Even earlier, I think, but there were and still are problems with unicode
> in 2.x. Some were and will only be fixed in 3.x.
>
>
neil harper wrote:
I'm a new bie. I have just started learning Python (3.0), finished
with official tutorial. I would like to have your opinion on some
Opinions around here are pretty much like elbows and knee caps...
everybody has them, and yours are really the only ones that matter to
55 matches
Mail list logo