Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Thomas Jollans
On 19/07/11 06:42, Steven D'Aprano wrote: > Nulpum wrote: > >> I want to make sure that folder exists. >> >> '2011-07-03' is really exists. but 'os.path.isdir' say false >> >> Does anyone know why? > > Yes. > print "logs/2011-07-03" > logs/2011-07-03 print "logs\2011-07-03" > logs�1-07

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Thomas Jollans
On 19/07/11 00:33, Thomas 'PointedEars' Lahn wrote: > Thomas 'PointedEars' Lahn wrote: > >> Dave Angel wrote: >>> On 01/-10/-28163 02:59 PM, Terry Reedy wrote: def makeadder(y) def _add(x): return x+y add2 = makeadder(2) >>> >>> A couple of typos in that code: >>> >>> def makead

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Thomas 'PointedEars' Lahn
Steven D'Aprano wrote: > Nulpum wrote: >> I want to make sure that folder exists. >> >> '2011-07-03' is really exists. but 'os.path.isdir' say false >> >> Does anyone know why? > > Yes. > print "logs/2011-07-03" > logs/2011-07-03 print "logs\2011-07-03" > logs�1-07-03 > > Don't use

Re: a little parsing challenge ☺

2011-07-18 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > with open(os.path.join(dirpath, name), 'r') as f: SHOULD be with open(os.path.join(dirpath, name), 'rb') as f: (as in the original), else the some code units might not be read properly. -- PointedEars Bitte keine Kopien per E-Mail. /

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Tim Roberts
Andrew Berg wrote: > >> I'm not saying it's wise > >Why not? It just makes it more difficult to follow the pattern when you add new code. If you have an editor mnaging that for you, then you might as well have the editor go all tabs or all spaces to avoid trouble. Vi and friends with ts=8 and s

Re: a little parsing challenge ☺

2011-07-18 Thread Chris Angelico
On Tue, Jul 19, 2011 at 2:59 PM, rusi wrote: > Some evidences of leakiness: > code point vs character vs byte > encoding and decoding > UTF-x and UCS-y > > Very important and necessary distinctions? Maybe... But I did not need > them when my world was built of the 127 bricks of ASCII. Codepoint v

Re: a little parsing challenge ☺

2011-07-18 Thread rusi
On Jul 19, 8:11 am, Steven D'Aprano wrote: > rusi wrote: > > Every time I try to understand unicode and remain stuck I come to the > > conclusion that I must be an imbecile. > > http://www.joelonsoftware.com/articles/Unicode.html > > -- > Steven Yes Ive read that and understood a little bit more

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Rob Williscroft
Nulpum wrote in news:0bf400a3-735c-487a-8d74- feb3b56be...@g5g2000prn.googlegroups.com in gmane.comp.python.general: > I want to make sure that folder exists. > '2011-07-03' is really exists. but 'os.path.isdir' say false > Does anyone know why? > os.path.isdir("C:\Users\Á¶Ã¢ÁØ\Desktop\logs"

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Steven D'Aprano
Nulpum wrote: > I want to make sure that folder exists. > > '2011-07-03' is really exists. but 'os.path.isdir' say false > > Does anyone know why? Yes. >>> print "logs/2011-07-03" logs/2011-07-03 >>> print "logs\2011-07-03" logs�1-07-03 Don't use backslashes as path separators in Python. Back

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Michael Hrivnak
What is the output of: >>> os.path.exists("C:\Users\조창준\Desktop\logs\2011-07-03") ? One possible issue here is that for some reason os.path.isdir() can't even access the directory either because of permissions, misinterpretation of the path, or some other reason. Michael 2011/7/19 Nulpum : > I

Re: os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Kushal Das
2011/7/19 Nulpum : > I want to make sure that folder exists. > > '2011-07-03' is really exists. but 'os.path.isdir' say false > > Does anyone know why? > > > os.path.isdir("C:\Users\조창준\Desktop\logs") > True os.path.isdir("C:\Users\조창준\Desktop\logs\2011-07-03") > False Works here. Are you

Re: a little parsing challenge ☺

2011-07-18 Thread Steven D'Aprano
Billy Mays wrote: > TL;DR version: international character sets are a problem, and Unicode > is not the answer to that problem). Shorter version: FUD. Yes, having a rich and varied character set requires work. Yes, the Unicode standard itself, and any interface to it (including Python's) are imp

os.path.isdir do not work for Foder named '2011-07-03'

2011-07-18 Thread Nulpum
I want to make sure that folder exists. '2011-07-03' is really exists. but 'os.path.isdir' say false Does anyone know why? >>> os.path.isdir("C:\Users\조창준\Desktop\logs") True >>> os.path.isdir("C:\Users\조창준\Desktop\logs\2011-07-03") False -- http://mail.python.org/mailman/listinfo/python-list

Re: a little parsing challenge ☺

2011-07-18 Thread Benjamin Kaplan
On Mon, Jul 18, 2011 at 7:07 PM, Billy Mays wrote: > > On 7/18/2011 7:56 PM, Steven D'Aprano wrote: >> >> Billy Mays wrote: >> >>> On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 >>> >>> I gave it a shot.  It doesn't do any of the Unicode delims, because >>> let's face it, Unicode is f

Re: a little parsing challenge ☺

2011-07-18 Thread Steven D'Aprano
rusi wrote: > Every time I try to understand unicode and remain stuck I come to the > conclusion that I must be an imbecile. http://www.joelonsoftware.com/articles/Unicode.html -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: a little parsing challenge ☺

2011-07-18 Thread MRAB
On 19/07/2011 03:07, Billy Mays wrote: On 7/18/2011 7:56 PM, Steven D'Aprano wrote: Billy Mays wrote: On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 I gave it a shot. It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers. Goobers... that would be one of

Re: a little parsing challenge ☺

2011-07-18 Thread rusi
On Jul 19, 7:07 am, Billy Mays wrote: > On 7/18/2011 7:56 PM, Steven D'Aprano wrote: > > > > > Billy Mays wrote: > > >> On 07/17/2011 03:47 AM, Xah Lee wrote: > >>> 2011-07-16 > > >> I gave it a shot.  It doesn't do any of the Unicode delims, because > >> let's face it, Unicode is for goobers. > >

Re: a little parsing challenge ☺

2011-07-18 Thread Billy Mays
On 7/18/2011 7:56 PM, Steven D'Aprano wrote: Billy Mays wrote: On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 I gave it a shot. It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers. Goobers... that would be one of those new-fangled slang terms that the

Re: a little parsing challenge ☺

2011-07-18 Thread Steven D'Aprano
Billy Mays wrote: > On 07/17/2011 03:47 AM, Xah Lee wrote: >> 2011-07-16 > > I gave it a shot. It doesn't do any of the Unicode delims, because > let's face it, Unicode is for goobers. Goobers... that would be one of those new-fangled slang terms that the young kids today use to mean its opposi

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Roy Smith
In article , Duncan Booth wrote: > Tim Chase wrote: > > > On 07/17/2011 08:01 PM, Steven D'Aprano wrote: > >> Roy Smith wrote: > >>> We don't have that problem any more. It truly boggles my > >>> mind that we're still churning out people with 80 column > >>> minds. I'm willing to entertain a

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > Dave Angel wrote: >> On 01/-10/-28163 02:59 PM, Terry Reedy wrote: >>> def makeadder(y) >>> def _add(x): return x+y >>> add2 = makeadder(2) >> >> A couple of typos in that code: >> >> def makeaddr(y): >> def _add(x): return x+y >> return _add > >

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Thomas 'PointedEars' Lahn
Dave Angel wrote: > On 01/-10/-28163 02:59 PM, Terry Reedy wrote: >> def makeadder(y) >> def _add(x): return x+y >> add2 = makeadder(2) > > A couple of typos in that code: > > > def makeaddr(y): > def _add(x): return x+y > return _add I agree about the `return' statement, but not

Re: a little parsing challenge ☺

2011-07-18 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > Billy Mays wrote: >> I gave it a shot. It doesn't do any of the Unicode delims, because let's >> face it, Unicode is for goobers. > > Uh, okay... > > Your script also misses the requirement of outputting the index or row > and column of the first mismatched bracket. Thanks t

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Terry Reedy wrote: On 7/18/2011 8:24 AM, Paul Woolcock wrote: Partial function application (or "currying") is the act of taking a function with two or more parameters, and applying some of the arguments in order to make a new function. The "hello world" example for th

Re: Crazy what-if idea for function/method calling syntax

2011-07-18 Thread Pierre Quentel
On 18 juil, 07:54, Steven D'Aprano wrote: > On Mon, 18 Jul 2011 08:54 am ΤΖΩΤΖΙΟΥ wrote: > > > Jumping in: > > > What if a construct > > >    xx(*args1, **kwargs1)yy(*args2, **kwargs2) > > > was interpreted as > > >   xxyy(*(args1+args2), **(kwargs1+kwargs2)) > > > (Note: with **(kwargs1+kwargs2)

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Terry Reedy
On 7/18/2011 3:23 PM, woooee wrote: Partial can be used in a GUI program, like Tkinter, to send arguments to functions. There are other ways to do that as well as using partial. The following program uses partial to send the color to the change_buttons function. from Tkinter import * from funct

Re: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic?

2011-07-18 Thread Terry Reedy
On 7/18/2011 8:20 AM, Anthony Kong wrote: Thanks for all the great suggestion. First of all, Carl is right that it does not take much to impress a java programmer about the expressiveness of functional programming. Covered map, reduce and filter as Rainer suggested. Emphasized the advantages

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Terry Reedy
On 7/18/2011 8:24 AM, Paul Woolcock wrote: Partial function application (or "currying") is the act of taking a function with two or more parameters, and applying some of the arguments in order to make a new function. The "hello world" example for this seems to be this: Let's say you have a func

Re: Looking for general advice on complex program

2011-07-18 Thread Josh English
That would be one of mine, probably. http://code.google.com/p/pyxmlcheck/ It's an old version. I haven't updated it in a while. And while my program worked fine at home, my test environment gave me some grief. Apparently the lock files are being deleted properly. I have a few ideas about that,

Re: a little parsing challenge ?

2011-07-18 Thread sln
On Sun, 17 Jul 2011 00:47:42 -0700 (PDT), Xah Lee wrote: >2011-07-16 > >folks, this one will be interesting one. > >the problem is to write a script that can check a dir of text files >(and all subdirs) and reports if a file has any mismatched matching >brackets. > [snip] >i hope you'll participa

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread woooee
Partial can be used in a GUI program, like Tkinter, to send arguments to functions. There are other ways to do that as well as using partial. The following program uses partial to send the color to the change_buttons function. from Tkinter import * from functools import partial class App: def

Re: AUTO: Craig Churchill is out of the office (returning 27/07/2011)

2011-07-18 Thread Waldek M.
> I am out of the office until 27/07/2011. > > I will respond to your message when I return. > If you require assitance in relation to the SPEAR Integration project > please contact Terry Mandalios. Why, thank you Craig. I will definitely contact Terry ;-) Br. Waldek PS. Sorry, couldn't stop mys

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Chris Angelico
On Tue, Jul 19, 2011 at 5:06 AM, Andrew Berg wrote: > Personally, I think that 80 is pretty arbitrary now, and not the best > limit. I'm more comfortable with 120-130 myself. In any case, Python > won't complain about how many characters are on a line, and that's the > way it should be. > It's a

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.18 01:51 PM, Dotan Cohen wrote: > Let me see if I understand: because there exists a possibility that > someone might want (not need) to edit code on a telephone to make a > quick edit to code being interpreted on that machine, _all_

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Dotan Cohen
On Mon, Jul 18, 2011 at 02:55, Andrew Berg > I think the reason the idea isn't dead is because of the emergence of > new devices with small displays (tablets/smartphones/etc.) and their > increasing popularity. When writing code that is meant to be run on > desktops or servers, the 80-column limit

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Anders J. Munch
Thomas 'PointedEars' Lahn wrote: > I am getting the idea here that you mean the right thing, but that you > explain it wrong. Feel free to write the much longer essay that explains it all unambiguously, I'm not going to. regards, Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: a little parsing challenge ☺

2011-07-18 Thread Rouslan Korneychuk
On 07/18/2011 12:46 PM, Thomas 'PointedEars' Lahn wrote: Rouslan Korneychuk wrote: I don't know why, but I just had to try it (even though I don't usually use Perl and had to look up a lot of stuff). I came up with this: I don't know why … you replied to my posting/e-mail (but quoted nothing

Re: a little parsing challenge ☺

2011-07-18 Thread Ian Kelly
On Mon, Jul 18, 2011 at 11:12 AM, Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com> wrote: > I gave it a shot.  It doesn't do any of the Unicode delims, because let's > face it, Unicode is for goobers. Uh, okay... Your script also misses the requirement of outputting the i

AUTO: Craig Churchill is out of the office (returning 27/07/2011)

2011-07-18 Thread craig . churchill
I am out of the office until 27/07/2011. I will respond to your message when I return. If you require assitance in relation to the SPEAR Integration project please contact Terry Mandalios. Note: This is an automated response to your message "Re: Tabs -vs- Spaces: Tabs should have won." sent on

Re: a little parsing challenge ☺

2011-07-18 Thread Billy Mays
On 07/17/2011 03:47 AM, Xah Lee wrote: 2011-07-16 I gave it a shot. It doesn't do any of the Unicode delims, because let's face it, Unicode is for goobers. import sys, os pairs = {'}':'{', ')':'(', ']':'[', '"':'"', "'":"'", '>':'<'} valid = set( v for pair in pairs.items() for v in pair

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Steven D'Aprano wrote: Tim Chase wrote: On 07/17/2011 08:01 PM, Steven D'Aprano wrote: Roy Smith wrote: We don't have that problem any more. It truly boggles my mind that we're still churning out people with 80 column minds. I'm willing to entertain arguments abou

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Thomas 'PointedEars' Lahn
Anssi Saari wrote: > Thorsten Kampe writes: >> The "perfect programming font" is just the one that looks so good that >> you would also use it for writing email. Dejavu Sans Mono is pretty >> good. Consolas looks also looks good but it is Windows only. > > How is Consolas Windows only? Not that

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Thomas 'PointedEars' Lahn
Gregory Ewing wrote: > Anders J. Munch wrote: >> > Cameron Simpson wrote: >> >> Personally, I like to use the tab _key_ as an input device, but to >> >> have my editor write real spaces to the file in consequence. >> Just like in the old days:) > > Most editors can be configured to do that. T

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread MRAB
On 18/07/2011 14:52, Duncan Booth wrote: Tim Chase wrote: On 07/17/2011 08:01 PM, Steven D'Aprano wrote: Roy Smith wrote: We don't have that problem any more. It truly boggles my mind that we're still churning out people with 80 column minds. I'm willing to entertain arguments about readab

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Thorsten Kampe
* Anssi Saari (Mon, 18 Jul 2011 19:28:49 +0300) > > Thorsten Kampe writes: > > > The "perfect programming font" is just the one that looks so good that > > you would also use it for writing email. Dejavu Sans Mono is pretty > > good. Consolas looks also looks good but it is Windows only. > >

Re: a little parsing challenge ☺

2011-07-18 Thread Thomas 'PointedEars' Lahn
Rouslan Korneychuk wrote: > I don't know why, but I just had to try it (even though I don't usually > use Perl and had to look up a lot of stuff). I came up with this: I don't know why … you replied to my posting/e-mail (but quoted nothing from it, much less referred to its content), and posted

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Anssi Saari
Thorsten Kampe writes: > The "perfect programming font" is just the one that looks so good that > you would also use it for writing email. Dejavu Sans Mono is pretty > good. Consolas looks also looks good but it is Windows only. How is Consolas Windows only? Not that I'd put it in my Windows-f

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread gene heskett
On Monday, July 18, 2011 09:32:19 AM Tim Chase did opine: > On 07/17/2011 08:01 PM, Steven D'Aprano wrote: > > Roy Smith wrote: > >> We don't have that problem any more. It truly boggles my > >> mind that we're still churning out people with 80 column > >> minds. I'm willing to entertain argumen

Re: Recommendations for household finance scripting?

2011-07-18 Thread rusi
On Jul 18, 8:03 pm, markolopa wrote: > Hello! > > I would like to find a good system to keep track of my household > finance. Do Python programmers have suggestions on that? Do you use > Python to help on this task? > > I am considering a large set of solutions: > - Pure spreadsheet >   - Easy to

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Steven D'Aprano
Kurian Thayil wrote: > Hi, > > I am a newbie in python and would like to learn GUI programming. I would > like to know what exactly is Partial Function Applicaton > (functool.partial())? Or how is it advantageous compared to normal > functions? Or is there any advantange? Thanks in advance. It i

Recommendations for household finance scripting?

2011-07-18 Thread markolopa
Hello! I would like to find a good system to keep track of my household finance. Do Python programmers have suggestions on that? Do you use Python to help on this task? I am considering a large set of solutions: - Pure spreadsheet - Easy to start, but I know I will soon feel blocked by the lack

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Steven D'Aprano
Tim Chase wrote: > On 07/17/2011 08:01 PM, Steven D'Aprano wrote: >> Roy Smith wrote: >>> We don't have that problem any more. It truly boggles my >>> mind that we're still churning out people with 80 column >>> minds. I'm willing to entertain arguments about readability >>> of long lines, but t

Re: a little parsing challenge ☺

2011-07-18 Thread Xah Lee
On Jul 17, 12:47 am, Xah Lee wrote: > 2011-07-16 > > folks, this one will be interesting one. > > the problem is to write a script that can check a dir of text files > (and all subdirs) and reports if a file has any mismatched matching > brackets. > … Ok, here's my solution (pasted at bottom). I

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Duncan Booth
Tim Chase wrote: > On 07/17/2011 08:01 PM, Steven D'Aprano wrote: >> Roy Smith wrote: >>> We don't have that problem any more. It truly boggles my >>> mind that we're still churning out people with 80 column >>> minds. I'm willing to entertain arguments about readability >>> of long lines, but

Re: Argparse, and linking to methods in Subclasses

2011-07-18 Thread Karim
Hello Michele, Your solution is great! You can combine it perhaps with the use of set_defaults() method of the argparse parser, I gave. Cheers karim On 07/18/2011 01:56 PM, Michele Simionato wrote: Here is an example by using my own library plac (http://pypi.python.org/pypi/plac): class

Re: open urls in browser

2011-07-18 Thread srikanth
On Jul 18, 6:21 pm, Chris Angelico wrote: > On Mon, Jul 18, 2011 at 10:05 PM, srikanth wrote: > > Ex:http://www.google.com- Pass/Fail. > > What do you mean by "Pass" or "Fail"? If you send a URL to a web > browser, all you'll find out is whether or not the browser accepted it > - it won't tell yo

Re: open urls in browser

2011-07-18 Thread Chris Angelico
On Mon, Jul 18, 2011 at 10:05 PM, srikanth wrote: > Ex: http://www.google.com - Pass/Fail. What do you mean by "Pass" or "Fail"? If you send a URL to a web browser, all you'll find out is whether or not the browser accepted it - it won't tell you if the page is valid. If you want that, you don't

Re: planet.python.org blog registration

2011-07-18 Thread Thomas Jollans
On 07/18/2011 03:04 PM, Markus Schmidberger wrote: > Hello, > > whom I have to contact to get a blog aggregated in planet.python.org? > > Thanks > Markus > I quote planet.python.org (below the list of names) > To request addition or removal: > e-mail planet at python.org (note, responses can t

planet.python.org blog registration

2011-07-18 Thread Markus Schmidberger
Hello, whom I have to contact to get a blog aggregated in planet.python.org? Thanks Markus -- http://mail.python.org/mailman/listinfo/python-list

RE: Ordered list question

2011-07-18 Thread jyoung79
>> Can you share a website that goes into more detail on this good variable >> naming? > I'd Google that one. You'll find more articles than you can read in a > lifetime... Very true! :-) -- http://mail.python.org/mailman/listinfo/python-list

Running Python on a Computer Cluster in the Cloud - cloudnumbers.com

2011-07-18 Thread Markus Schmidberger
Dear Python users, cloudnumbers.com provides researchers and companies with the access to resources to perform high performance calculations in the cloud. As cloudnumbers.com's community manager I may invite you to register and test your Python application on a computer cluster in the cloud for fr

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread python
> Bah, when I started programming > on the Apple ][+, we had no > lower-case and a 40-column limit > on the TV display. Keyboards??? That was a luxery! We had mechanical switches that one had to physically push and pull to enter commands. And a 40 column display??? Unheard of! We were happy with

Re: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic?

2011-07-18 Thread Anthony Kong
Thanks for all the great suggestion. First of all, Carl is right that it does not take much to impress a java programmer about the expressiveness of functional programming. Covered map, reduce and filter as Rainer suggested. Emphasized the advantages of functional style as summarised by Steve

Re: Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Paul Woolcock
Partial function application (or "currying") is the act of taking a function with two or more parameters, and applying some of the arguments in order to make a new function. The "hello world" example for this seems to be this: Let's say you have a function called `add`, that takes two parameters:

open urls in browser

2011-07-18 Thread srikanth
Hi All, I am new to python. Before posting i have done some google regarding my question. But i didn't get exact information. So thought of posting it here. I want to open a list of urls in browser that too in same window with out exiting. it should load one by one on same window and also it should

Re: Argparse, and linking to methods in Subclasses

2011-07-18 Thread Michele Simionato
Here is an example by using my own library plac (http://pypi.python.org/pypi/plac): class Server(): def configure_logging(self, logging_file): pass def check(self): pass def deploy(self): pass def configure(self): pass def __init__(self, hostnam

Re: Argparse, and linking to methods in Subclasses

2011-07-18 Thread Karim
with global: SERVER = None A the end of Argparse declarations: parser_check.set_defaults(action=do_the_check) parser_build.set_defaults(action=do_the_build) Then declare the action functions: def do_the_check(namespace_args): if not SERVER: SERVER = Server(namespace_arg.type_of_s

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Tim Chase
On 07/17/2011 08:01 PM, Steven D'Aprano wrote: Roy Smith wrote: We don't have that problem any more. It truly boggles my mind that we're still churning out people with 80 column minds. I'm willing to entertain arguments about readability of long lines, but the idea that there's something magic

Partial Function Application -- Advantages over normal function?

2011-07-18 Thread Kurian Thayil
Hi, I am a newbie in python and would like to learn GUI programming. I would like to know what exactly is Partial Function Applicaton (functool.partial())? Or how is it advantageous compared to normal functions? Or is there any advantange? Thanks in advance. Regards, Kurian Thayil. -- http://

Re: a little parsing challenge ☺

2011-07-18 Thread Rouslan Korneychuk
On 07/18/2011 03:24 AM, Stefan Behnel wrote: That's solid Perl. Both the code generator and the generated code are unreadable. Well done! Stefan Why, thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ordered list question

2011-07-18 Thread Chris Angelico
On Mon, Jul 18, 2011 at 2:12 PM, wrote: > Can you share a website that goes into more detail on this good variable > naming? I'd Google that one. You'll find more articles than you can read in a lifetime... ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for general advice on complex program

2011-07-18 Thread Chris Angelico
On Mon, Jul 18, 2011 at 1:33 PM, Josh English wrote: > Sadly, I'm the type of guy who almost has to re-invent the wheel. When I > started XML processing, it was on an old computer and I couldn't get things > like lxml to work, or understand the ones I did manage to install. To fully > understan

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread gene heskett
On Sunday, July 17, 2011 08:24:12 PM Dotan Cohen did opine: > On Sun, Jul 17, 2011 at 17:29, gene heskett wrote: > >> I'm still looking for the perfect programming font. Suggestions > >> welcomed. > > > > When you find it Dotan, let me know, I've been looking since the later > > '70's. > > Hey

Re: a little parsing challenge ☺

2011-07-18 Thread Stefan Behnel
Rouslan Korneychuk, 18.07.2011 09:09: I don't know why, but I just had to try it (even though I don't usually use Perl and had to look up a lot of stuff). I came up with this: /(?| (\()(?&matched)([\}\]”›»】〉》」』]|$) | (\{)(?&matched)([\)\]”›»】〉》」』]|$) | (\[)(?&matched)([\)\}”›»】〉》」』]|$) | (“)(?&m

Re: a little parsing challenge ☺

2011-07-18 Thread Rouslan Korneychuk
I don't know why, but I just had to try it (even though I don't usually use Perl and had to look up a lot of stuff). I came up with this: /(?| (\()(?&matched)([\}\]”›»】〉》」』]|$) | (\{)(?&matched)([\)\]”›»】〉》」』]|$) | (\[)(?&matched)([\)\}”›»】〉》」』]|$) | (“)(?&matched)([\)\}\]›»】〉》」』