Re: Automation

2013-11-15 Thread Larry Hudson
On 11/15/2013 07:02 AM, Grant Edwards wrote: On 2013-11-15, Paul Rudin wrote: Steven D'Aprano writes: A few minor errors is one thing, but when you see people whose posts are full of error after error and an apparent inability to get English syntax right, you have to wonder how on earth they

Re: Implementing #define macros similar to C on python

2013-11-15 Thread JL
On Saturday, November 16, 2013 8:22:25 AM UTC+8, Mark Lawrence wrote: > Yes but please don't top post. Actually print is a statement in Python > 2 so your code should work if you use > from __future__ import print_function > at the top of your code. > Would you also be kind enough to read and ac

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 3:01 PM, Rick Johnson wrote: > Because when i see code that accesses a variable like this: > > var = value > > I have no way of knowing whether the mutation is happening > to a local variable, a module level variable, or even a true > global level variable (one which ex

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 3:01 PM, Rick Johnson wrote: > Let's see... Tkinter's design today is a single module > containing a staggering: > > 155,626 chars > > 3,733 lines Also: I see nothing wrong with a single module having 3-4K lines in it. Hilfe, the Pike REPL/interactive interpreter,

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Rick Johnson
On Friday, November 15, 2013 2:19:01 AM UTC-6, Steven D'Aprano wrote: > But with software, coupling is *easy*. By default, code in > a single process is completely coupled. Think of a chunk > of machine code running in a single piece of memory. We > have to build in our own conventions for decoupl

Re: Bug asking for input number

2013-11-15 Thread Christopher Welborn
Sorry about my previous post, gmane is being really slow. :( I wouldn't have posted if I knew the question was already answered. -- - Christopher Welborn http://welbornprod.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Bug asking for input number

2013-11-15 Thread Christopher Welborn
On 11/15/2013 08:15 PM, Arturo B wrote:> Hi! I hope you can help me. > > I'm writting a simple piece of code. > I need to keep asking for a number until it has all this specifications: > > - It is a number > - It's lenght is 3 > - The hundred's digit differs from the one's digit by at least two >

Re: Suggest an open-source issue tracker, with github integration and kanban boards?

2013-11-15 Thread Jason Friedman
> Can you recommend an open source project (or two) written in Python; > which covers multi project + sub project issue tracking linked across > github repositories? > Why does it need to be written in Python? -- https://mail.python.org/mailman/listinfo/python-list

Re: Bug asking for input number

2013-11-15 Thread Arturo B
MRAB your solution is good thank you I will use it. Terry Eddy I saw my mistake about for example 2 <= 2, I think it's easier to use break in this case thank you! -- https://mail.python.org/mailman/listinfo/python-list

Re: Bug asking for input number

2013-11-15 Thread Terry Reedy
On 11/15/2013 9:15 PM, Arturo B wrote: Hi! I hope you can help me. I'm writting a simple piece of code. I need to keep asking for a number until it has all this specifications: - It is a number - It's lenght is 3 - The hundred's digit differs from the one's digit by at least two My problem is

Re: Bug asking for input number

2013-11-15 Thread MRAB
On 16/11/2013 02:15, Arturo B wrote: Hi! I hope you can help me. I'm writting a simple piece of code. I need to keep asking for a number until it has all this specifications: - It is a number - It's lenght is 3 - The hundred's digit differs from the one's digit by at least two My problem is th

Bug asking for input number

2013-11-15 Thread Arturo B
Hi! I hope you can help me. I'm writting a simple piece of code. I need to keep asking for a number until it has all this specifications: - It is a number - It's lenght is 3 - The hundred's digit differs from the one's digit by at least two My problem is that I enter a valid number like: 123, 32

Re: Automation

2013-11-15 Thread Tim Chase
On 2013-11-15 13:43, xDog Walker wrote: > On Friday 2013 November 15 06:58, Grant Edwards wrote: > > There are people (not many in this group) who grew up speaking > > English and really ought to apologize for their writing -- but > > they never do. > > Can you supply an example of the form such

Re: python 3.3 repr

2013-11-15 Thread Steven D'Aprano
On Fri, 15 Nov 2013 17:47:01 +, Neil Cerutti wrote: > The unicode support I'm learning in Go is, "Everything is utf-8, right? > RIGHT?!?" It also has the interesting behavior that indexing strings > retrieves bytes, while iterating over them results in a sequence of > runes. > > It comes with

Re: Implementing #define macros similar to C on python

2013-11-15 Thread Irmen de Jong
On 16-11-2013 0:36, JL wrote: > Thanks! This is the answer which I am seeking. However, I am not able to get > the following line to work. I am using python 2.7.5 > > debug_print = print > > Can we assign a function into a variable in this manner? Yes, functions are just another object. But 'pr

Re: Implementing #define macros similar to C on python

2013-11-15 Thread Mark Lawrence
On 15/11/2013 23:36, JL wrote: Thanks! This is the answer which I am seeking. However, I am not able to get the following line to work. I am using python 2.7.5 debug_print = print Can we assign a function into a variable in this manner? On Friday, November 15, 2013 11:49:52 AM UTC+8, Chris An

Re: Implementing #define macros similar to C on python

2013-11-15 Thread Terry Reedy
On 11/15/2013 6:36 PM, JL wrote: Thanks! This is the answer which I am seeking. However, I am not able to get the following line to work. I am using python 2.7.5 debug_print = print Start your file with from __future__ import print_function and the above should work. Oh, and please snip stuf

Re: python 3.3 repr

2013-11-15 Thread Terry Reedy
On 11/15/2013 6:28 AM, Robin Becker wrote: I'm trying to understand what's going on with this simple program if __name__=='__main__': print("repr=%s" % repr(u'\xc1')) print("%%r=%r" % u'\xc1') On my windows XP box this fails miserably if run directly at a terminal C:\tmp> \Python33\p

Re: Implementing #define macros similar to C on python

2013-11-15 Thread JL
Thanks! This is the answer which I am seeking. However, I am not able to get the following line to work. I am using python 2.7.5 debug_print = print Can we assign a function into a variable in this manner? On Friday, November 15, 2013 11:49:52 AM UTC+8, Chris Angelico wrote: > On Fri, Nov 15, 2

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Tim Daneliuk
On 11/15/2013 09:42 AM, Chris Angelico wrote: On Sat, Nov 16, 2013 at 2:26 AM, Tim Daneliuk wrote: On 11/15/2013 02:19 AM, Steven D'Aprano wrote: Nobody sets out to*design* a tangled mess. What normally happens is that a tangled mess is the result of*lack of design*. This has been an intere

Re: Implementing #define macros similar to C on python

2013-11-15 Thread Irmen de Jong
On 15-11-2013 3:29, JL wrote: > One of my favorite tools in C/C++ language is the preprocessor macros. > > One example is switching certain print messages for debugging use only > > #ifdef DEBUG_ENABLE > DEBUG_PRINT print > #else > DEBUG_PRINT > > Is it possible to implement something similar

Re: Running python's own unit tests?

2013-11-15 Thread Russell E. Owen
In article <5285223d.50...@timgolden.me.uk>, Tim Golden wrote: > http://docs.python.org/devguide/ Thank you and the other responders. I was expecting to find the information here under Building Python. The developer's guide is a nice resource. -- Ru

Sharing Python installation between architectures

2013-11-15 Thread Paul Smith
One thing I always liked about Perl was the way you can create a single installation directory which can be shared between archictures. Say what you will about the language: the Porters have an enormous amount of experience and expertise producing portable and flexible interpreter installations.

Re: python 2.7.x on MacOSX: failed dlopen() on .so's

2013-11-15 Thread Paul Smith
On Thu, 2013-11-14 at 10:36 -0800, Ned Deily wrote: > In article <1384442536.3496.532.camel@pdsdesk>, > Paul Smith wrote: > [...] > > By relocatable I mean "runnable from any location"; i.e., not fixed. I > > have a wrapper around the Python executable that can compute the correct > > root direc

Re: Automation

2013-11-15 Thread xDog Walker
On Friday 2013 November 15 06:58, Grant Edwards wrote: > There are people (not many in this group) who grew up speaking English > and really ought to apologize for their writing -- but they never do. Can you supply an example of the form such an apology might take? -- Yonder nor sorghum stenches

Re: Automation

2013-11-15 Thread Alister
On Fri, 15 Nov 2013 20:12:27 +, Alister wrote: > On Fri, 15 Nov 2013 16:53:58 +, Neil Cerutti wrote: > >> On 2013-11-15, Steven D'Aprano >> wrote: >>> On Thu, 14 Nov 2013 20:03:44 +, Alister wrote: As a native of England I have to agree it is far to arrogant to expect every

Re: Automation

2013-11-15 Thread Alister
On Fri, 15 Nov 2013 16:53:58 +, Neil Cerutti wrote: > On 2013-11-15, Steven D'Aprano > wrote: >> On Thu, 14 Nov 2013 20:03:44 +, Alister wrote: >>> As a native of England I have to agree it is far to arrogant to expect >>> everyone else to be able to speak good English when I can barley o

Re: Odd msg received from list

2013-11-15 Thread Chris “Kwpolska” Warrick
On Fri, Nov 15, 2013 at 12:30 AM, Gregory Ewing wrote: > Verde Denim wrote: >> >> The message also listed my >> account password, which I found odd. > > > You mean the message contained your actual password, > in plain text? That's not just odd, it's rather worrying > for at least two reasons. Fir

Re: python 3.3 repr

2013-11-15 Thread Gene Heskett
On Friday 15 November 2013 13:52:40 Mark Lawrence did opine: > On 15/11/2013 16:36, Gene Heskett wrote: > > On Friday 15 November 2013 11:28:19 Joel Goldstick did opine: > >> On Fri, Nov 15, 2013 at 10:03 AM, Robin Becker > > > > wrote: > >>> ... > >>> > > became popular. > >

Unicode stdin/stdout (was: Re: python 3.3 repr)

2013-11-15 Thread random832
Of course, the real solution to this issue is to replace sys.stdout on windows with an object that can handle Unicode directly with the WriteConsoleW function - the problem there is that it will break code that expects to be able to use sys.stdout.buffer for binary I/O. I also wasn't able to get th

Re: python 3.3 repr

2013-11-15 Thread Mark Lawrence
On 15/11/2013 16:36, Gene Heskett wrote: On Friday 15 November 2013 11:28:19 Joel Goldstick did opine: On Fri, Nov 15, 2013 at 10:03 AM, Robin Becker wrote: ... became popular. Really? you cried and laughed over 7 vs. 8 bits? That's lovely (?). ;). That eighth bit sure was less

Re: python 3.3 repr

2013-11-15 Thread Neil Cerutti
On 2013-11-15, Chris Angelico wrote: > Other languages _have_ gone for at least some sort of Unicode > support. Unfortunately quite a few have done a half-way job and > use UTF-16 as their internal representation. That means there's > no difference between U+0012, U+0123, and U+1234, but U+12345 >

Re: python 3.3 repr

2013-11-15 Thread Cousin Stanley
> > We don't say len({42: None}) to discover > that the dict requires 136 bytes, > why would you use len("heåvy") > to learn that it uses 23 bytes ? > #!/usr/bin/env python # -*- coding: utf-8 -*- """ illustrate the difference in length of python objects and the size of thei

Re: understanding someone else's program

2013-11-15 Thread Denis McMahon
On Fri, 15 Nov 2013 03:05:04 -0800, C. Ng wrote: > Hi all, > > Please suggest how I can understand someone else's program where - > documentation is sparse - in function A, there will be calls to function > B, C, D and in those functions will be calls to functions R,S,T > and so on so for

Re: python 3.3 repr

2013-11-15 Thread Serhiy Storchaka
15.11.13 17:32, Roy Smith написав(ла): Anybody remember RAD-50? It let you represent a 6-character filename (plus a 3-character extension) in a 16 bit word. RT-11 used it, not sure if it showed up anywhere else. In three 16-bit words. -- https://mail.python.org/mailman/listinfo/python-list

Re: python 3.3 repr

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 4:10 AM, Steven D'Aprano wrote: > No, UTF-8 is okay for writing to files, but it's not suitable for text > strings. Correction: It's _great_ for writing to files (and other fundamentally byte-oriented streams, like network connections). Does a superb job as the default enc

testing - do not reply

2013-11-15 Thread Pedro
-- https://mail.python.org/mailman/listinfo/python-list

Re: python 3.3 repr

2013-11-15 Thread Steven D'Aprano
On Fri, 15 Nov 2013 14:43:17 +, Robin Becker wrote: > Things went wrong when utf8 was not adopted as the standard encoding > thus requiring two string types, it would have been easier to have a len > function to count bytes as before and a glyphlen to count glyphs. Now as > I understand it we

Re: python 3.3 repr

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 4:06 AM, Zero Piraeus wrote: > : > > On Fri, Nov 15, 2013 at 10:32:54AM -0500, Roy Smith wrote: >> Anybody remember RAD-50? It let you represent a 6-character filename >> (plus a 3-character extension) in a 16 bit word. RT-11 used it, not >> sure if it showed up anywhere

Re: python 3.3 repr

2013-11-15 Thread Zero Piraeus
: On Fri, Nov 15, 2013 at 10:32:54AM -0500, Roy Smith wrote: > Anybody remember RAD-50? It let you represent a 6-character filename > (plus a 3-character extension) in a 16 bit word. RT-11 used it, not > sure if it showed up anywhere else. Presumably 16 is a typo, but I just had a moderate amou

Re: Automation

2013-11-15 Thread Neil Cerutti
On 2013-11-15, Steven D'Aprano wrote: > On Thu, 14 Nov 2013 20:03:44 +, Alister wrote: >> As a native of England I have to agree it is far to arrogant >> to expect everyone else to be able to speak good English when >> I can barley order a beer in any other language. (even or >> especially in

Re: python 3.3 repr

2013-11-15 Thread Gene Heskett
On Friday 15 November 2013 11:28:19 Joel Goldstick did opine: > On Fri, Nov 15, 2013 at 10:03 AM, Robin Becker wrote: > > ... > > > >>> became popular. > >> > >> Really? you cried and laughed over 7 vs. 8 bits? That's lovely (?). > >> ;). That eighth bit sure was less confusing than

Re: python 3.3 repr

2013-11-15 Thread William Ray Wing
On Nov 15, 2013, at 10:18 AM, Robin Becker wrote: > On 15/11/2013 15:07, Joel Goldstick wrote: > > > > >> >> Cool, someone here is older than me! I came in with the 8080, and I >> remember split octal, but sixes are something I missed out on. > > The pdp 10/15 had 18 bit words and

Re: python 3.3 repr

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 2:39 AM, Robin Becker wrote: >> Dealing with bytes and Unicode is complicated, and the 2->3 transition is >> not easy, but let's please not spread the misunderstanding that somehow the >> Flexible String Representation is at fault. However you store Unicode code >> points,

Re: Python Front-end to GCC

2013-11-15 Thread sharath . cs . smp
On Sunday, 20 October 2013 10:56:46 UTC-7, Philip Herron wrote: > Hey, > > > > I've been working on GCCPY since roughly november 2009 at least in its > > concept. It was announced as a Gsoc 2010 project and also a Gsoc 2011 > > project. I was mentored by Ian Taylor who has been an extremely b

Re: Automation

2013-11-15 Thread Alister
On Sat, 16 Nov 2013 02:12:16 +1100, Chris Angelico wrote: > On Sat, Nov 16, 2013 at 2:02 AM, Grant Edwards > wrote: >> And yes, people can _easily_ tell the difference between errors caused >> by being lazy/sloppy and errors caused by writing in a second language. > > Yes, and even among people

Re: python 3.3 repr

2013-11-15 Thread Antoon Pardon
Op 15-11-13 16:39, Robin Becker schreef: > . >> >> Dealing with bytes and Unicode is complicated, and the 2->3 transition >> is not easy, but let's please not spread the misunderstanding that >> somehow the Flexible String Representation is at fault. However you >> store Unicode code point

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Tim Daneliuk
On 11/15/2013 02:19 AM, Steven D'Aprano wrote: Nobody sets out to*design* a tangled mess. What normally happens is that a tangled mess is the result of*lack of design*. This has been an interesting thread - to me anyway - but this bit above caught my eye. People write programs for lots of rea

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 2:26 AM, Tim Daneliuk wrote: > On 11/15/2013 02:19 AM, Steven D'Aprano wrote: >> Nobody sets out to*design* a tangled mess. What normally happens is that >> a tangled mess is the result of*lack of design*. > > This has been an interesting thread - to me anyway - but this b

Re: python 3.3 repr

2013-11-15 Thread Robin Becker
. Dealing with bytes and Unicode is complicated, and the 2->3 transition is not easy, but let's please not spread the misunderstanding that somehow the Flexible String Representation is at fault. However you store Unicode code points, they are different than bytes, and it is complex

Re: python 3.3 repr

2013-11-15 Thread Roy Smith
On Nov 15, 2013, at 10:18 AM, Robin Becker wrote: > The pdp 10/15 had 18 bit words and could be organized as 3*6 or 2*9 I don't know about the 15, but the 10 had 36 bit words (18-bit halfwords). One common character packing was 5 7-bit characters per 36 bit word (with the sign bit left over).

Re: python 3.3 repr

2013-11-15 Thread Robin Becker
On 15/11/2013 15:07, Joel Goldstick wrote: Cool, someone here is older than me! I came in with the 8080, and I remember split octal, but sixes are something I missed out on. The pdp 10/15 had 18 bit words and could be organized as 3*6 or 2*9, pdp 8s had 12 bits I think, then came

Re: Automation

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 2:02 AM, Grant Edwards wrote: > And yes, people can _easily_ tell the difference between errors caused > by being lazy/sloppy and errors caused by writing in a second > language. Yes, and even among people for whom English is the first language, idioms can cause offense. O

Re: python 3.3 repr

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 1:43 AM, Robin Becker wrote: > .. > >> I'm still stuck on Python 2, and while I can understand the controversy >> ("It breaks my Python 2 code!"), this seems like the right thing to have >> done. In Python 2, unicode is an add-on. One of the big design drivers in

Re: python 3.3 repr

2013-11-15 Thread Ned Batchelder
On Friday, November 15, 2013 9:43:17 AM UTC-5, Robin Becker wrote: > Things went wrong when utf8 was not adopted as the standard encoding thus > requiring two string types, it would have been easier to have a len function > to > count bytes as before and a glyphlen to count glyphs. Now as I unde

Re: python 3.3 repr

2013-11-15 Thread Joel Goldstick
On Fri, Nov 15, 2013 at 10:03 AM, Robin Becker wrote: > ... > >>> became popular. >>> >> Really? you cried and laughed over 7 vs. 8 bits? That's lovely (?). >> ;). That eighth bit sure was less confusing than codepoint >> translations > > > > no we had 6 bits in 60 bit words as I recall;

Re: Automation

2013-11-15 Thread Grant Edwards
On 2013-11-15, Paul Rudin wrote: > Steven D'Aprano writes: > >> A few minor errors is one thing, but when you see people whose posts are >> full of error after error and an apparent inability to get English syntax >> right, you have to wonder how on earth they expect to be a programmer? > > Th

Re: python 3.3 repr

2013-11-15 Thread Robin Becker
... became popular. Really? you cried and laughed over 7 vs. 8 bits? That's lovely (?). ;). That eighth bit sure was less confusing than codepoint translations no we had 6 bits in 60 bit words as I recall; extracting the nth character involved division by 6; smart people did trick

Re: Automation

2013-11-15 Thread Grant Edwards
On 2013-11-14, Mark Lawrence wrote: > On 14/11/2013 03:56, renato.barbosa.pim.pere...@gmail.com wrote: >> I apologize again for my bad english and any inconvenience that I have >> generated. > > I do wish that people would stop apologising for poor English, it's an > extremely difficult language

Re: python 3.3 repr

2013-11-15 Thread Robin Becker
On 15/11/2013 14:40, Serhiy Storchaka wrote: .. and then use repr throughout. Or rather try: ascii except NameError: ascii = repr and then use ascii throughout. apparently you can import ascii from future_builtins and the print() function is available as

Re: python 3.3 repr

2013-11-15 Thread Joel Goldstick
>> Some of us have been doing this long enough to remember when "just plain >> text" meant only a single case of the alphabet (and a subset of ascii >> punctuation). On an ASR-33, your C program would print like: >> >> MAIN() \( >> PRINTF("HELLO, ASCII WORLD"); >> \) >> >> because ASR-33's

Re: python 3.3 repr

2013-11-15 Thread Robin Becker
.. I'm still stuck on Python 2, and while I can understand the controversy ("It breaks my Python 2 code!"), this seems like the right thing to have done. In Python 2, unicode is an add-on. One of the big design drivers in Python 3 was to make unicode the standard. The idea behind re

Re: python 3.3 repr

2013-11-15 Thread Serhiy Storchaka
15.11.13 15:54, Ned Batchelder написав(ла): No, but I've found that significant programs that run on both 2 and 3 need to have some shims to make the code work anyway. You could do this: try: repr = ascii except NameError: pass and then use repr throughout. Or ra

Re: python 3.3 repr

2013-11-15 Thread Robin Becker
On 15/11/2013 13:54, Ned Batchelder wrote: . No, but I've found that significant programs that run on both 2 and 3 need to have some shims to make the code work anyway. You could do this: try: repr = ascii except NameError: pass yes I tried that, but

Re: python 3.3 repr

2013-11-15 Thread Roy Smith
In article , Ned Batchelder wrote: > In Python3, repr() will return a Unicode string, and will preserve existing > Unicode characters in its arguments. This has been controversial. To get > the Python 2 behavior of a pure-ascii representation, there is the new > builtin ascii(), and a corres

Re: Automation

2013-11-15 Thread Mark Lawrence
On 15/11/2013 06:44, Steven D'Aprano wrote: On Thu, 14 Nov 2013 17:10:02 +, Mark Lawrence wrote: On 14/11/2013 03:56, renato.barbosa.pim.pere...@gmail.com wrote: I apologize again for my bad english and any inconvenience that I have generated. I do wish that people would stop apologisin

Re: understanding someone else's program

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 12:49 AM, Jean-Michel Pichavant wrote: > If the documentation is sparse, writing the doc yourself is one way to dive > into someone else's code. To begin with, you can stick to the function > purpose, and for the WTF functions try to document the parameters and return >

Re: python 3.3 repr

2013-11-15 Thread Ned Batchelder
On Friday, November 15, 2013 7:16:52 AM UTC-5, Robin Becker wrote: > On 15/11/2013 11:38, Ned Batchelder wrote: > .. > > > > In Python3, repr() will return a Unicode string, and will preserve existing > > Unicode characters in its arguments. This has been controversial. To get > > the P

Re: Program Translation - Nov. 14, 2013

2013-11-15 Thread E.D.G.
"E.D.G." wrote in message news:ro-dnch2dptbrhnpnz2dnuvz_rsdn...@earthlink.com... The responses regarding that Etgtab program were encouraging. I was not sure if anyone would even recognize the code as the program was written quite a while ago. The main reason for wanting to tra

Re: understanding someone else's program

2013-11-15 Thread William Ray Wing
On Nov 15, 2013, at 6:05 AM, C. Ng wrote: > Hi all, > > Please suggest how I can understand someone else's program where > - documentation is sparse > - in function A, there will be calls to function B, C, D and in those > functions will be calls to functions R,S,T and so on so forth...

Re: understanding someone else's program

2013-11-15 Thread Jean-Michel Pichavant
- Original Message - > Hi all, > > Please suggest how I can understand someone else's program where > - documentation is sparse > - in function A, there will be calls to function B, C, D and in > those functions will be calls to functions R,S,T and so on so > forth... making it dif

Re: understanding someone else's program

2013-11-15 Thread Joel Goldstick
On Fri, Nov 15, 2013 at 6:19 AM, Ben Finney wrote: > "C. Ng" writes: > >> Please suggest how I can understand someone else's program > > Welcome to this forum! > > I sympathise with this query. Much of the craft of programming is in > understanding the code written by other programmers, and learn

Re: Best approach to edit linux configuration file

2013-11-15 Thread Chris Angelico
On Sat, Nov 16, 2013 at 12:05 AM, Himanshu Garg wrote: > I have to setup the DNS server. For this I have to edit the configuration > files. > > For this I have to search if the lines(block of text) already exist in the > file and if not, I have to add them to the file. > > So, I want to know wh

Best approach to edit linux configuration file

2013-11-15 Thread Himanshu Garg
I have to setup the DNS server. For this I have to edit the configuration files. For this I have to search if the lines(block of text) already exist in the file and if not, I have to add them to the file. So, I want to know what is the best way to accomplish this. -- https://mail.python.org/m

Re: python 3.3 repr

2013-11-15 Thread Robin Becker
On 15/11/2013 11:38, Ned Batchelder wrote: .. In Python3, repr() will return a Unicode string, and will preserve existing Unicode characters in its arguments. This has been controversial. To get the Python 2 behavior of a pure-ascii representation, there is the new builtin ascii(),

Re: python 3.3 repr

2013-11-15 Thread Ned Batchelder
On Friday, November 15, 2013 6:28:15 AM UTC-5, Robin Becker wrote: > I'm trying to understand what's going on with this simple program > > if __name__=='__main__': > print("repr=%s" % repr(u'\xc1')) > print("%%r=%r" % u'\xc1') > > On my windows XP box this fails miserably if run direc

Re: Program Translation - Nov. 14, 2013

2013-11-15 Thread Clive Page
On 14/11/2013 17:36, Gordon Sande wrote: Indeed! Under NAGWare Fortran it runs to completion with C=all but pulls an undefined reference when C=undefined is added. Lots of obsolete features and other warnings but no compiler error messages. The obvious lessons are that 1. Fortran has very good

python 3.3 repr

2013-11-15 Thread Robin Becker
I'm trying to understand what's going on with this simple program if __name__=='__main__': print("repr=%s" % repr(u'\xc1')) print("%%r=%r" % u'\xc1') On my windows XP box this fails miserably if run directly at a terminal C:\tmp> \Python33\python.exe bang.py Traceback (most rece

Re: understanding someone else's program

2013-11-15 Thread Ben Finney
"C. Ng" writes: > Please suggest how I can understand someone else's program Welcome to this forum! I sympathise with this query. Much of the craft of programming is in understanding the code written by other programmers, and learning from that experience how to improve the understandability of

understanding someone else's program

2013-11-15 Thread C. Ng
Hi all, Please suggest how I can understand someone else's program where - documentation is sparse - in function A, there will be calls to function B, C, D and in those functions will be calls to functions R,S,T and so on so forth... making it difficult to trace what happens to a certain

Django Weekend Cardiff

2013-11-15 Thread D.M. Procida
(With apologies if you have already seen this on another email list or newsgroup.) The UK's first-ever Django conference will take place on the 7th-9th February 2014 in Cardiff, Wales. The programme for the event: Friday: tutorials and demonstrations (also ope

Re: Getting globals of the caller, not the defining module

2013-11-15 Thread Steven D'Aprano
On Thu, 14 Nov 2013 20:56:34 +, Rotwang wrote: [...] >> How about this? >> >> # module A.py >> import inspect >> def spam(): >> return inspect.stack()[1][0].f_globals > > Bump. Did this do what you wanted, or not? Sort of. If anything, it convinced me that I don't, in fact, want what I

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Steven D'Aprano
On Thu, 14 Nov 2013 09:26:18 -0800, Rick Johnson wrote: > On Wednesday, November 13, 2013 11:50:40 PM UTC-6, Steven D'Aprano > wrote: [...] >> of course, but that in general *its too damn hard* for human >> programmers to write good, reliable, maintainable, correct (i.e. >> bug-free) code using pr