Re: Need help to write data onto an XML file after reading data from another xml file

2014-05-13 Thread varun7rs
I try to add an edge with the source id and destination id over a loop but this is the error I am getting. And the range for the for addEdge is something I have no clue about. python export.py --output topology.xml --xml germany50.xml Traceback (most recent call last): File "export.py", line

Re: Why isn't my re.sub replacing the contents of my MS Word file?

2014-05-13 Thread wxjmfauth
Le mardi 13 mai 2014 22:26:51 UTC+2, MRAB a écrit : > On 2014-05-13 20:01, scottca...@gmail.com wrote: > > > On Tuesday, May 13, 2014 9:49:12 AM UTC-4, Steven D'Aprano wrote: > > >> > > >> You may have missed my follow up post, where I said I had not noticed you > > >> were operating on a binar

Re: Fortran

2014-05-13 Thread Marko Rauhamaa
Steven D'Aprano : > On Tue, 13 May 2014 22:57:16 +0300, Marko Rauhamaa wrote: > >> Producing an effective JIT for Python seems like a formidable challenge >> but not impossible in principle. > > Or in practice. > > http://pypy.org/ I'm having a hard time finding information on how well it perform

Re: New to Python. For in loops curiosity

2014-05-13 Thread Ben Finney
Leonardo Petry writes: > So I am starting with python and I have been working on some simple > exercises. You are welcome here. Congratulations on starting with Python! You may also be interested to know there is also a separate forum https://mail.python.org/mailman/listinfo/tutor> dedicated to

Re: Fortran

2014-05-13 Thread Ian Kelly
On Tue, May 13, 2014 at 6:10 PM, Steven D'Aprano wrote: > On Tue, 13 May 2014 22:57:16 +0300, Marko Rauhamaa wrote: > >> Producing an effective JIT for Python seems like a formidable challenge >> but not impossible in principle. > > Or in practice. > > http://pypy.org/ > > And it's predecessor: ht

Re: New to Python. For in loops curiosity

2014-05-13 Thread John Gordon
In <2f08e970-1334-4e7f-ba84-14869708a...@googlegroups.com> Leonardo Petry writes: > fin = open('wordplay.txt'); > user_input = raw_input('Enter some characters: ') > count = 0 > for line in fin: > word = line.strip() > if(avoids(word, user_input)): > count += 1; > This is just too

Re: New to Python. For in loops curiosity

2014-05-13 Thread Rustom Mody
On Wednesday, May 14, 2014 9:08:32 AM UTC+5:30, Leonardo Petry wrote: > > This is just too convenient. > > Basically my question is: Why is python not treating the contents of > wordplay.txt as one long string and looping each character? Did you mean convenient or inconvenient? Anyways... Ma

Re: New to Python. For in loops curiosity

2014-05-13 Thread Ian Kelly
On Tue, May 13, 2014 at 9:38 PM, Leonardo Petry wrote: > The loop below (at the bottom) runs each line of the file > > fin = open('wordplay.txt'); > user_input = raw_input('Enter some characters: ') > count = 0 > for line in fin: > word = line.strip() > if(avoids(word, user_input)): >

New to Python. For in loops curiosity

2014-05-13 Thread Leonardo Petry
Hi All, So I am starting with python and I have been working on some simple exercises. Here is something I found curious about python loops This loop run each character in a string def avoids(word,letters): flag = True for letter in letters: if(letter in word):

Re: Need help to write data onto an XML file after reading data from another xml file

2014-05-13 Thread Dave Angel
On 05/13/2014 10:31 AM, varun...@gmail.com wrote: Hello Users, I am in dire need of your help. I have been working on this code for quite some time and it is making me restless. All I am trying to do is, 1. Read data from an xml file. Source: http://sndlib.zib.de/coredata.download.action?obje

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Ethan Furman
On 05/13/2014 05:10 PM, Steven D'Aprano wrote: On Tue, 13 May 2014 10:08:42 -0600, Ian Kelly wrote: Because Python 3 presents stdin and stdout as text streams however, it makes them more difficult to use with binary data, which is why Armin sets up all that extra code to make sure his file obje

[OT] Copyright statements and why they can be useful (was: Everything you did not want to know about Unicode in Python 3)

2014-05-13 Thread Ben Finney
Steven D'Aprano writes: > On Tue, 13 May 2014 14:42:51 +, alister wrote: > > > You do not need any statements at all, copyright is automaticly > > assigned to anything you create (at least that is the case in UK > > Law) although proving the creation date my be difficult. > > (1) In my lifeti

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Roy Smith
In article , Ben Finney wrote: > Roy Smith writes: > > > >p = Subprocess.Popen(shlex.split(cmd), > > > stdout=subprocess.PIPE, > > > stderr=subprocess.PIPE) > > That is PEP 8 conformant, but I find it hurts maintainability: it is far > too m

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Gregory Ewing
Ben Finney wrote: The 80 character line limit is *not* driven by a limitation of computer technology; it is driven by a limitation of human cognition. For that reason, it remains relevant until human cognition in the general reading population improves. Another thing: Just because I may have 20

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 10:08:42 -0600, Ian Kelly wrote: > Because Python 3 presents stdin and stdout as text streams however, it > makes them more difficult to use with binary data, which is why Armin > sets up all that extra code to make sure his file objects are binary. What surprises me is how ha

Re: Fortran

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 22:57:16 +0300, Marko Rauhamaa wrote: > Producing an effective JIT for Python seems like a formidable challenge > but not impossible in principle. Or in practice. http://pypy.org/ And it's predecessor: http://psyco.sourceforge.net/ -- Steven D'Aprano http://import-that

Re: httplib with NETRC authentication

2014-05-13 Thread Chris Angelico
On Wed, May 14, 2014 at 9:33 AM, pratibha natani wrote: > I am trying to establish http connection to a gerrit host using netrc > authentication. I have a netrc file created with following entries: > machine host1.com login name password pass > > I did a debug and saw that my netrc file is being

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Chris Angelico
On Wed, May 14, 2014 at 9:53 AM, Steven D'Aprano wrote: > With the current system, all of us here are technically violating > copyright every time we reply to an email and quote more than a small > percentage of it. Oh wow... so when someone quotes heaps of text without trimming, and adding blank

Re: Exception problem with module

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 16:59:46 +, Joseph L. Casale wrote: > I am working with a module that I am seeing some odd behavior. > > A module.foo builds a custom exception, module.foo.MyError, its done > right afaict. > > Another module, module.bar imports this and calls > bar.__setattr__('a_new_nam

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 14:42:51 +, alister wrote: > On Tue, 13 May 2014 13:51:20 +, Grant Edwards wrote: > >> On 2014-05-13, Steven D'Aprano >> wrote: >>> On Tue, 13 May 2014 07:20:34 -0400, Roy Smith wrote: >>> ASCII *is* all I need. >>> >>> You've never needed to copyright something?

httplib with NETRC authentication

2014-05-13 Thread pratibha natani
Hi, I am trying to establish http connection to a gerrit host using netrc authentication. I have a netrc file created with following entries: machine host1.com login name password pass I did a debug and saw that my netrc file is being read correctly. Also in the connection object(after sending

Re: How can this assert() ever trigger?

2014-05-13 Thread Joseph Martinot-Lagarde
Le 13/05/2014 11:56, Albert van der Horst a écrit : In article , Joseph Martinot-Lagarde wrote: Le 10/05/2014 17:24, Albert van der Horst a écrit : I have the following code for calculating the determinant of a matrix. It works inasfar that it gives the same result as an octave program on a s

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Ben Finney
Steven D'Aprano writes: > On Tue, 13 May 2014 04:52:26 -0700, Rustom Mody wrote: > > > What this goes to show is that while 80 is ridiculously low by most > > displays today, > > Not for people who like to has two (or three, or four) windows side-by- > side. Or multiple views of the same documen

Re: Why isn't my re.sub replacing the contents of my MS Word file?

2014-05-13 Thread MRAB
On 2014-05-13 20:01, scottca...@gmail.com wrote: On Tuesday, May 13, 2014 9:49:12 AM UTC-4, Steven D'Aprano wrote: You may have missed my follow up post, where I said I had not noticed you were operating on a binary .doc file. If you're not willing or able to use a full-blown doc parser, say b

Re: Real-world use of concurrent.futures

2014-05-13 Thread Andrew McLean
On 08/05/2014 21:44, Ian Kelly wrote: > On May 8, 2014 12:57 PM, "Andrew McLean" > wrote: > > So far so good. However, I thought this would be an opportunity to > > explore concurrent.futures and to see whether it offered any benefits > > over the more explicit approach

Re: Fortran

2014-05-13 Thread Marko Rauhamaa
Alain Ketterlin : > The real nice thing that makes Julia a different language is the > optional static typing, which the JIT can use to produce efficient code. > It's the only meaningful difference with the current state of python. I'm guessing the two main performance roadblocks for Python are:

Re: Why isn't my re.sub replacing the contents of my MS Word file?

2014-05-13 Thread scottcabit
On Tuesday, May 13, 2014 9:49:12 AM UTC-4, Steven D'Aprano wrote: > > You may have missed my follow up post, where I said I had not noticed you > were operating on a binary .doc file. > > If you're not willing or able to use a full-blown doc parser, say by > controlling Word or LibreOffice, the

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread Mark Lawrence
On 13/05/2014 17:33, Ian Kelly wrote: On Tue, May 13, 2014 at 5:59 AM, Simon Evans wrote: I can see no bs4 folder within the contents. I can not see any setup.py file either, but this is how I downloaded it. You do have a setup.py in there, but your Windows explorer is showing it to you witho

Re: Fortran

2014-05-13 Thread Alain Ketterlin
Mark H Harris writes: > On 5/12/14 3:44 AM, Alain Ketterlin wrote: >> When you are doing scientific computation, this overhead is >> unacceptable, because you'll have zillions of computations to perform. > > I'm still trying to sort that out. I have not tested this yet, but > it looks like J

RE: Exception problem with module

2014-05-13 Thread Joseph L. Casale
> Best would be to print out what's in a_new_name to see if it really is > what you think it is. If you think it is what you think it is, have a > look at its __mro__ (method resolution order, it's an attribute of > every class), to see what it's really inheriting. That should show you > what's hap

Re: Exception problem with module

2014-05-13 Thread Chris Angelico
On Wed, May 14, 2014 at 2:59 AM, Joseph L. Casale wrote: > During handling of the above exception, another exception occurred: > > File "C:/dir/test.py", line 12, in > except a_new_name as exc: > TypeError: catching classes that do not inherit from BaseException is not > allowed Best woul

Exception problem with module

2014-05-13 Thread Joseph L. Casale
I am working with a module that I am seeing some odd behavior. A module.foo builds a custom exception, module.foo.MyError, its done right afaict. Another module, module.bar imports this and calls bar.__setattr__('a_new_name', MyError). Now, not in all but in some cases when I catch a_new_name,

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Ian Kelly
On Tue, May 13, 2014 at 5:19 AM, alister wrote: > I am only an amateur python coder which is why I asked if I am missing > something > > I could not see any reason to be using the shutil module if all that the > programm is doing is opening a file, reading it & then printing it. > > is it python t

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread Ian Kelly
On Tue, May 13, 2014 at 5:59 AM, Simon Evans wrote: > I can see no bs4 folder within the contents. > I can not see any setup.py file either, but this is how I downloaded it. You do have a setup.py in there, but your Windows explorer is showing it to you without the .py extension. Something unusu

ANN: Intro+Intermediate Python, San Francisco, Jul 30-31, Aug 1

2014-05-13 Thread wesley chun
Greetings! I'll be offering another hardcore Python course this summer near the San Francisco airport. If you're somewhat new to or have some Python experience under your belt already but want to fill-in the holes, this course is for you. Why take a real course when you can learn Python online or

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Grant Edwards
On 2014-05-13, alister wrote: > On Tue, 13 May 2014 13:51:20 +, Grant Edwards wrote: > >> On 2014-05-13, Steven D'Aprano >> wrote: >>> On Tue, 13 May 2014 07:20:34 -0400, Roy Smith wrote: >>> ASCII *is* all I need. >>> >>> You've never needed to copyright something? Copyright © Roy Smith

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread MRAB
On 2014-05-13 12:59, Simon Evans wrote: Dear Ian, and other programmers, thank you for your advice. I am resending the last message because this twattish cut and paste facility on my computer has a knack of chopping off ones original message, I will try to convey the right message this time :

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread alister
On Tue, 13 May 2014 13:51:20 +, Grant Edwards wrote: > On 2014-05-13, Steven D'Aprano > wrote: >> On Tue, 13 May 2014 07:20:34 -0400, Roy Smith wrote: >> >>> ASCII *is* all I need. >> >> You've never needed to copyright something? Copyright © Roy Smith >> 2014... > > Bah. You don't need the

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Chris Angelico
On Wed, May 14, 2014 at 12:30 AM, Rustom Mody wrote: > Come to think of it why have anything other than zeros and ones? Obligatory: http://xkcd.com/257/ ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Need help to write data onto an XML file after reading data from another xml file

2014-05-13 Thread varun7rs
Hello Users, I am in dire need of your help. I have been working on this code for quite some time and it is making me restless. All I am trying to do is, 1. Read data from an xml file. Source: http://sndlib.zib.de/coredata.download.action?objectName=germany50&format=xml&objectType=network 2. T

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Rustom Mody
On Tuesday, May 13, 2014 7:13:47 PM UTC+5:30, Chris Angelico wrote: > On Tue, May 13, 2014 at 11:39 PM, Steven D'Aprano > > Or price something in cents? I suppose the days of the 25¢ steak dinner > > are long gone, but you might need to sell something for 99¢ a pound... > > > $0.99/lb? :) Dollar

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Skip Montanaro
On Tue, May 13, 2014 at 3:38 AM, Chris Angelico wrote: >> Python 2's ambiguity allows me not to answer the tough philosophical >> questions. I'm not saying it's necessarily a good thing, but it has its >> benefits. > > It's not a good thing. It means that you have the convenience of > pretending t

Re: Why isn't my re.sub replacing the contents of my MS Word file?

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 11:49 PM, Steven D'Aprano wrote: > > This {EN DASH} is an n-dash. > > or: > > x\x9c\x0b\xc9\xc8,V\xa8v\xf5Spq\x0c\xf6\xa8U\x00r\x12 > \xf3\x14\xf2tS\x12\x8b3\xf4\x00\x82^\x08\xf8 > > > (that last one is the text passed through the zlib compressor) I had to deco

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Grant Edwards
On 2014-05-13, Steven D'Aprano wrote: > On Tue, 13 May 2014 07:20:34 -0400, Roy Smith wrote: > >> ASCII *is* all I need. > > You've never needed to copyright something? Copyright © Roy Smith 2014... Bah. You don't need the little copyright symbol at all. The statement without the symbol has the

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Grant Edwards
On 2014-05-13, Chris Angelico wrote: > On Tue, May 13, 2014 at 4:03 PM, Ben Finney wrote: >> (It's always a good day to remind people that the rest of the world >> exists.) > > Ironic that this should come up in a discussion on Unicode, given that > Unicode's fundamental purpose is to welcome tha

Re: Why isn't my re.sub replacing the contents of my MS Word file?

2014-05-13 Thread Steven D'Aprano
On Mon, 12 May 2014 10:35:53 -0700, scottcabit wrote: > On Friday, May 9, 2014 8:12:57 PM UTC-4, Steven D'Aprano wrote: > >> Good: >> >> >> >> fStr = re.sub(b'‒', b'-', fStr) >> >> > Doesn't work...the document has been verified to contain endash and > emdash characters, but this doe

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 04:52:26 -0700, Rustom Mody wrote: > What this goes to show is that while 80 is ridiculously low by most > displays today, Not for people who like to has two (or three, or four) windows side-by- side. Or multiple views of the same document. > it is too high for many web/mai

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 11:39 PM, Steven D'Aprano wrote: > You've never needed to copyright something? Copyright © Roy Smith 2014... > I know some people use (c) instead, but that actually has no legal > standing. (Not that any reasonable judge would invalidate a copyright > based on a technicalit

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Mark Lawrence
On 13/05/2014 12:21, Chris Angelico wrote: On Tue, May 13, 2014 at 9:16 PM, Roy Smith wrote: Sometimes code is still running for 15 years because it's so wonderful nobody has been able to come up with anything better. Sometimes it's because nobody knows how it works anymore and everybody is af

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 07:20:34 -0400, Roy Smith wrote: > ASCII *is* all I need. You've never needed to copyright something? Copyright © Roy Smith 2014... I know some people use (c) instead, but that actually has no legal standing. (Not that any reasonable judge would invalidate a copyright based

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 11:30 PM, Mark Lawrence wrote: > On 13/05/2014 09:38, Chris Angelico wrote: >> >> >> It's not a good thing. It means that you have the convenience of >> pretending there's no problem, which means you don't notice trouble >> until something happens... and then, in all probab

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Mark Lawrence
On 13/05/2014 09:38, Chris Angelico wrote: It's not a good thing. It means that you have the convenience of pretending there's no problem, which means you don't notice trouble until something happens... and then, in all probability, your app is in production and you have no idea why stuff went w

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread Mark Lawrence
On 13/05/2014 12:59, Simon Evans wrote: I suggest that you follow the instructions here http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows to get pip, then let pip do the work for you as that's what it's designed for :) -- My fellow Pythonistas, ask not what our languag

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Rustom Mody
On Tuesday, May 13, 2014 2:15:49 PM UTC+5:30, Peter Otten wrote: > Ganesh Pal wrote: > > what would be the best way to intent the below line . > >p = > > Subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE) > (3) Import names: > > > from subprocess import PIPE > p

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Tim Chase
On 2014-05-13 22:26, Ben Finney wrote: > Changing the name on the first line doesn't entail changing any > other line:: > > proc = Subprocess.Popen( > shlex.split(cmd), > stdout=subprocess.PIPE, > stderr=subprocess.PIPE) > > special_process_map[this_pro

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Ben Finney
Roy Smith writes: > >p = Subprocess.Popen(shlex.split(cmd), > > stdout=subprocess.PIPE, > > stderr=subprocess.PIPE) That is PEP 8 conformant, but I find it hurts maintainability: it is far too much indentation. Horizontal space is costly, becau

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Ben Finney
Ganesh Pal writes: > what would be the best way to intent the below line . You'd need to define “best” in order to get an objective answer. So my answer will be based on my preferences, and general rules I've observed for making code readable. > Example 1 : > >p = > Subprocess.Popen(shlex.

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Roy Smith
In article , Ganesh Pal wrote: > Hi Team , > > > what would be the best way to intent the below line . > > I have few lines in my program exceeding the allowed maximum line Length of > 79./80 characters > > Example 1 : > >p = > Subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread Simon Evans
Dear Ian, and other programmers, thank you for your advice. I am resending the last message because this twattish cut and paste facility on my computer has a knack of chopping off ones original message, I will try to convey the right message this time : I have removed the original Beautiful

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-13 Thread Simon Evans
I have removed the original Beautiful Soup 4 download, that I had unzipped to my Beautiful Soup directory on the C drive. I downloaded the latest version of Beautiful Soup 4 from the Crummy site. I unzipped it, and removed the contents of the unzipped directory and placed contents in my Beautif

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Rustom Mody
On Tuesday, May 13, 2014 12:37:24 PM UTC+5:30, Ganesh Pal wrote: > Hi Team , > > > what would be the best way to intent the below line . > > I have few lines in my program exceeding the allowed maximum line Length of > 79./80 characters > > > Example 1 : > > >p = > Subprocess.Popen(s

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Gene Heskett
On Tuesday 13 May 2014 03:22:28 Steven D'Aprano did opine And Gene did reply: > On Tue, 13 May 2014 02:31:14 -0400, Gene Heskett wrote: > > People who write buggy self-modifying code aren't paying attention. > > [...] > > > IMO, people who bad-mouth self-modifying code are folks who don't > > hav

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Roy Smith
In article , Chris Angelico wrote: > On Tue, May 13, 2014 at 4:03 PM, Ben Finney wrote: > > (It's always a good day to remind people that the rest of the world > > exists.) > > Ironic that this should come up in a discussion on Unicode, given that > Unicode's fundamental purpose is to welcome

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread alister
On Tue, 13 May 2014 01:18:35 +, Steven D'Aprano wrote: > On Mon, 12 May 2014 17:47:48 +, alister wrote: > >> On Mon, 12 May 2014 16:19:17 +0100, Mark Lawrence wrote: >> >>> This was *NOT* written by our resident unicode expert >>> http://lucumr.pocoo.org/2014/5/12/everything-about-unicod

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 9:16 PM, Roy Smith wrote: > Sometimes code is still running for 15 years because it's so wonderful > nobody has been able to come up with anything better. Sometimes it's > because nobody knows how it works anymore and everybody is afraid to > touch it :-) And sometimes, b

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Roy Smith
In article <5371c834$0$11109$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > And after 15 years, I daresay that includes you. Sometimes code is still running for 15 years because it's so wonderful nobody has been able to come up with anything better. Sometimes it's because nobody knows

Re: SQLAlchemy - web framework ?

2014-05-13 Thread Roy Smith
In article , flebber wrote: > Roy.that is interesting that you can use mongoengine. > > Recent google results such as seem to assert there are a lot of inherent risk > in swapping out components, though I may be misinterpreting it. > http://www.slideshare.net/daikeren/tradeoffs-of-replacing-

Re: Simple Function Decorator Sample Snippet

2014-05-13 Thread alister
On Tue, 13 May 2014 01:04:39 -0500, Mark H Harris wrote: > Yes, because depending on your interface the code can get mangled (the > indentation thing breaks). the quoted paste seems to avoid this mostly > with the downside that the quote characters need to be striped from the > py file. by th

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 8:44 PM, Rustom Mody wrote: > On Tuesday, May 13, 2014 3:30:36 PM UTC+5:30, Chris Angelico wrote: >> Actually, even the file system can do some of this to you. I was >> checking lsof on one of my Linux systems a little while ago, and found >> that I had half a dozen old ver

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Rustom Mody
On Tuesday, May 13, 2014 3:30:36 PM UTC+5:30, Chris Angelico wrote: > Actually, even the file system can do some of this to you. I was > checking lsof on one of my Linux systems a little while ago, and found > that I had half a dozen old versions of a program, all with the same > file name, all del

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 7:34 PM, Steven D'Aprano wrote: > On Tue, 13 May 2014 15:56:50 +1000, Chris Angelico wrote: > >> On Tue, May 13, 2014 at 3:48 PM, Steven D'Aprano >> wrote: >>> Self-modifying code is a nightmare inside the head of a Lovecraftian >>> horror. There's a reason why almost the

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Marko Rauhamaa
Johannes Bauer : > The only people who are angered by this now is people who always > treated encodings sloppily and it "just worked". Well, there's a good > chance it has worked by pure chance so far. It's a good thing that > Python does this now more strictly as it gives developers *guarantees*

Re: How can this assert() ever trigger?

2014-05-13 Thread Albert van der Horst
In article , Joseph Martinot-Lagarde wrote: >Le 10/05/2014 17:24, Albert van der Horst a écrit : >> I have the following code for calculating the determinant of >> a matrix. It works inasfar that it gives the same result as an >> octave program on a same matrix. >> >> / --

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Johannes Bauer
On 13.05.2014 10:25, Marko Rauhamaa wrote: > Based on my background (network and system programming), I'm a bit > suspicious of strings, that is, text. For example, is the stuff that > goes to syslog bytes or text? Does an XML file contain bytes or > (encoded) text? The answers are not obvious to

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread alister
On Tue, 13 May 2014 10:45:49 +0200, Peter Otten wrote: > Ganesh Pal wrote: > >> Hi Team , >> >> >> what would be the best way to intent the below line . >> >> I have few lines in my program exceeding the allowed maximum line >> Length of 79./80 characters >> >> Example 1 : >> >>p = >>

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 12:06:50 +0300, Marko Rauhamaa wrote: > Chris Angelico : > >> These are problems that Unicode can't solve. > > I actually think the problem has little to do with Unicode. Text is an > abstract data type just like any class. If I have an object (say, a > subprocess or a dictio

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Johannes Bauer
On 13.05.2014 10:38, Chris Angelico wrote: >> Python 2's ambiguity allows me not to answer the tough philosophical >> questions. I'm not saying it's necessarily a good thing, but it has its >> benefits. > > It's not a good thing. It means that you have the convenience of > pretending there's no p

Re: ctypes does not load .dll and generate windowsError 127

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 6:45 PM, Ji Xia wrote: > Could anybody help me out? I am trying to use python ctypes and load a .dll > file. It works on my colleagues’ machine, just does not work on mine > > Python on my machine is : python 2.7.6 > > OS: windows 7 > > Result is always: > > File "C:\Pyth

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 15:56:50 +1000, Chris Angelico wrote: > On Tue, May 13, 2014 at 3:48 PM, Steven D'Aprano > wrote: >> Self-modifying code is a nightmare inside the head of a Lovecraftian >> horror. There's a reason why almost the only people still using self- >> modifying code are virus writer

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 7:06 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> These are problems that Unicode can't solve. > > I actually think the problem has little to do with Unicode. Text is an > abstract data type just like any class. If I have an object (say, a > subprocess or a dictionary)

ctypes does not load .dll and generate windowsError 127

2014-05-13 Thread Ji Xia
Hi all, Could anybody help me out? I am trying to use python ctypes and load a .dll file. It works on my colleagues' machine, just does not work on mine Python on my machine is : python 2.7.6 OS: windows 7 Result is always: File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Marko Rauhamaa
Chris Angelico : > These are problems that Unicode can't solve. I actually think the problem has little to do with Unicode. Text is an abstract data type just like any class. If I have an object (say, a subprocess or a dictionary) in memory, I don't expect the object to have any existence indepen

Re: PEP 8 : Maximum line Length :

2014-05-13 Thread Peter Otten
Ganesh Pal wrote: > Hi Team , > > > what would be the best way to intent the below line . > > I have few lines in my program exceeding the allowed maximum line Length > of 79./80 characters > > Example 1 : > >p = > Subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subproce

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Chris Angelico
On Tue, May 13, 2014 at 6:25 PM, Marko Rauhamaa wrote: > Johannes Bauer : > >> Having dealt with the UTF-8 problems on Python2 I can safely say that >> I never, never ever want to go back to that freaky hell. If I deal >> with strings, I want to be able to sanely manipulate them and I want >> to b

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Marko Rauhamaa
Johannes Bauer : > Having dealt with the UTF-8 problems on Python2 I can safely say that > I never, never ever want to go back to that freaky hell. If I deal > with strings, I want to be able to sanely manipulate them and I want > to be sure that after manipulation they're still valid strings. > M

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Johannes Bauer
On 13.05.2014 03:18, Steven D'Aprano wrote: > Armin Ronacher is an extremely experienced and knowledgeable Python > developer, and a Python core developer. He might be wrong, but he's not > *obviously* wrong. He's correct about file name encodings. Which can be fixed really easily wihtout messi

ANN: verynice 0.3 - a nice(1) like utility for throttling processes

2014-05-13 Thread garabik-news-2005-05
verynice is a nice(1)-like command line utility for unix systems to throttle long running processes beyond what can be achieved by nice(1), by repeatedly suspending and resuming the process. Author: Radovan Garabík URL: http://kassiopeia.juls.savba.sk/~garabik/software/verynice/ License: GPL (v3

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread gregor
Am 13 May 2014 01:18:35 GMT schrieb Steven D'Aprano : > > - have a simple way to write bytes to stdout and stderr. there is the underlying binary buffer: https://docs.python.org/3/library/sys.html#sys.stdin greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-13 Thread Steven D'Aprano
On Tue, 13 May 2014 02:31:14 -0400, Gene Heskett wrote: > People who write buggy self-modifying code aren't paying attention. [...] > IMO, people who bad-mouth self-modifying code are folks who don't have > the patience to do it right, because stable self-modifying code CAN most > certainly be don

Re: Why isn't my re.sub replacing the contents of my MS Word file?

2014-05-13 Thread Dave Angel
On 05/12/2014 01:35 PM, scottca...@gmail.com wrote: On Friday, May 9, 2014 8:12:57 PM UTC-4, Steven D'Aprano wrote: Good: # Untested fStr = re.sub(b'&#x(201[2-5])|(2E3[AB])|(00[2A]D)', b'-', fStr) Still doesn't work. Guess whatever the code is for endash and mdash are not

PEP 8 : Maximum line Length :

2014-05-13 Thread Ganesh Pal
Hi Team , what would be the best way to intent the below line . I have few lines in my program exceeding the allowed maximum line Length of 79./80 characters Example 1 : p = Subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE) Iam running pylint and it says t

Twisted 14.0.0 Release Announcement

2014-05-13 Thread HawkOwl
On behalf of Twisted Matrix Laboratories, I am honoured to announce the release of Twisted 14.0! It has been a long road to get here, but we’ve done it! The highlights of this release are: - Twisted Positioning (`twisted.positioning`) makes its entry into Twisted! It comes ready to talk with c