Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Shashwat Anand
Here is one simple solution : intext = Lorem [ipsum] dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut [labore] et [dolore] magna aliqua. intext.replace('[', '{').replace(']', '}') 'Lorem {ipsum} dolor sit amet, consectetur adipisicing elit, sed do eiusmod

Re: max / min / smallest float value on Python 2.5

2010-02-07 Thread Mark Dickinson
On Feb 7, 12:52 am, duncan smith buzz...@urubu.freeserve.co.uk wrote: import platform if platform.architecture()[0].startswith('64'):      TINY = 2.2250738585072014e-308 else:      TINY = 1.1754943508222875e-38 As Christian said, whether you're using 32-bit or 64-bit shouldn't make a

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread @ Rocteur CC
On 07 Feb 2010, at 10:03, Shashwat Anand wrote: Here is one simple solution : intext = Lorem [ipsum] dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut [labore] et [dolore] magna aliqua. intext.replace('[', '{').replace(']', '}') 'Lorem {ipsum} dolor sit

ctypes Structure serialization

2010-02-07 Thread rych
I'm not quite familiar with python serialization but the picle module, at least, doesn't seem to be able to serialize a ctypes Structure with array-fields. Even if it was, the ASCII file produced is not in a human-friendly format. Could someone please suggest a method of saving and loading the

Re: new.instancemethod __iter__

2010-02-07 Thread Martin Drautzburg
Steven D'Aprano wrote: If you want iterator operations similar to itertools, why does this mean you need to replace anything? Just create your own iterators. Or use pre-processing and post-processing to get what you want. Can you show an example of what you would like to happen? Steven,

Re: new.instancemethod __iter__

2010-02-07 Thread Martin Drautzburg
Christian Heimes wrote: If you *really* need to overwrite __iter__ on your instance rather than defining it on your class, you need to proxy the method call: class MyObject(object): def __iter__(self): return self.myiter() obj = MyObject() obj.myiter = myiter That should

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-07 Thread News123
Hi JM, Jean-Michel Pichavant wrote: News123 wrote: Jean-Michel Pichavant wrote: Well This was exactly my question. for virtual web servers I cannot just use the IP-address. some XMLRPC servers do need the histname within the HTTP-POST request. a valid IP address would make it

Re: sshd in python for windows 7

2010-02-07 Thread News123
Hi Jerry, Jerry Hill wrote: On Sat, Feb 6, 2010 at 7:07 PM, News123 news...@free.fr wrote: Hi, I wondered which modules would be best to perform following task: A user uses a standard ssh (e.g. putty or openssh) client and performs an ssh to a windows host The windows host would run a

Re: sshd in python for windows 7

2010-02-07 Thread News123
Hi Jerry, Jerry Hill wrote: On Sat, Feb 6, 2010 at 7:07 PM, News123 news...@free.fr wrote: Hi, I wondered which modules would be best to perform following task: A user uses a standard ssh (e.g. putty or openssh) client and performs an ssh to a windows host The windows host would run a

Re: sshd in python for windows 7

2010-02-07 Thread News123
Hi Jerry, Jerry Hill wrote: On Sat, Feb 6, 2010 at 7:07 PM, News123 news...@free.fr wrote: Hi, I wondered which modules would be best to perform following task: A user uses a standard ssh (e.g. putty or openssh) client and performs an ssh to a windows host The windows host would run a

Simulating logging.exception with another traceback

2010-02-07 Thread Joan Miller
I would want to get the output from `logging.exception` but with traceback from the caller function (I've already all that information). This would be the error with logging.exception: ERROR: PipeError('/bin/ls -l | ', 'no command after of pipe') Traceback (most recent

Dynamic variable names

2010-02-07 Thread R (Chandra) Chandrasekhar
Dear Folks, I have read that one should use a dictionary in python to accommodate dynamic variable names. Yet, I am puzzled how to achieve that in my case. Here is what I want to do: 1. The user inputs a number of six-digit hex numbers as a comma-separated list. These numbers represent

Re: python admin abuse complaint

2010-02-07 Thread Steve Holden
Aahz wrote: In article 0c535d15-967d-4909-a9bb-b59708181...@l24g2000prh.googlegroups.com, Xah Lee xah...@gmail.com wrote: This is a short complaint on admin abuse on #python irc channel on freenode.net. Let's see, you are complaining about getting banned from #python by CROSS-POSTING

Re: Dreaming of new generation IDE

2010-02-07 Thread Steve Holden
bartc wrote: Arnaud Delobelle arno...@googlemail.com wrote in message news:m28wb6ypfs@googlemail.com... Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Fri, 05 Feb 2010 19:22:39 -0300, bartc ba...@freeuk.com escribió: Steve Holden st...@holdenweb.com wrote in message

Re: TABS in the CPython C source code

2010-02-07 Thread Steve Holden
Nobody wrote: On Sat, 06 Feb 2010 21:31:52 +0100, Alf P. Steinbach wrote: The size-8 tabs look really bad in an editor configured with tab size 4, as is common in Windows. I'm concluding that the CPython programmers configure their Visual Studio's to *nix convention. 8-column tabs aren't

Re: TABS in the CPython C source code

2010-02-07 Thread Steve Holden
Dennis Lee Bieber wrote: On Sun, 07 Feb 2010 05:49:28 +, Nobody nob...@nowhere.com declaimed the following in gmane.comp.python.general: 8-column tabs aren't a *nix convention; that's been the norm since the mechanical typewriter. Really? None of the various Royal, Remington,

Re: new.instancemethod __iter__

2010-02-07 Thread Steve Holden
Martin Drautzburg wrote: Steven D'Aprano wrote: If you want iterator operations similar to itertools, why does this mean you need to replace anything? Just create your own iterators. Or use pre-processing and post-processing to get what you want. Can you show an example of what you would

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
This is a short complaint on admin abuse on #python irc channel on freenode.net. Let's see, you are complaining about getting banned from #python by CROSS-POSTING between c.l.py and comp.lang.lisp. From my POV, that's grounds for extending the IRC ban permanently. It certainly doesn't

Re: How to print all expressions that match a regular expression

2010-02-07 Thread Steve Holden
hzh...@gmail.com wrote: So it seems we both misunderstood the problem. I didn't read the top level article until now, and reading it, I can't make sense of it. Seems that you should read the whole thing before making a post, or else you cannot know what we are talking about. Steven

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Tim Chase
Schif Schaf wrote: On Feb 7, 12:19 am, Alf P. Steinbach al...@start.no wrote: I haven't used regexps in Python before, but what I did was (1) look in the documentation, [snip] code import re text = ( Lorem [ipsum] dolor sit amet, consectetur, adipisicing elit, sed do eiusmod

Re: python admin abuse complaint

2010-02-07 Thread Shashwat Anand
LOL pow(funny, sys.maxint) On Sun, Feb 7, 2010 at 6:27 PM, Daniel Fetchinson fetchin...@googlemail.com wrote: This is a short complaint on admin abuse on #python irc channel on freenode.net. Let's see, you are complaining about getting banned from #python by CROSS-POSTING between

Re: max / min / smallest float value on Python 2.5

2010-02-07 Thread Steve Holden
duncan smith wrote: Christian Heimes wrote: duncan smith wrote: Hello, I'm trying to find a clean and reliable way of uncovering information about 'extremal' values for floats on versions of Python earlier than 2.6 (just 2.5 actually). I don't want to add a dependence on 3rd party

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Steve Holden
@ Rocteur CC wrote: On 07 Feb 2010, at 10:03, Shashwat Anand wrote: Here is one simple solution : intext = Lorem [ipsum] dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut [labore] et [dolore] magna aliqua. intext.replace('[', '{').replace(']', '}')

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
LOL assert funny 1 pow(funny, sys.maxint) This is a short complaint on admin abuse on #python irc channel on freenode.net. Let's see, you are complaining about getting banned from #python by CROSS-POSTING between c.l.py and comp.lang.lisp. From my POV, that's grounds for

Re: Dynamic variable names

2010-02-07 Thread Steve Holden
R (Chandra) Chandrasekhar wrote: Dear Folks, I have read that one should use a dictionary in python to accommodate dynamic variable names. Yet, I am puzzled how to achieve that in my case. Here is what I want to do: 1. The user inputs a number of six-digit hex numbers as a

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Anssi Saari
Schif Schaf schifsc...@gmail.com writes: (brackets replaced by braces). I can do that with Perl pretty easily: for () { s/\[(.+?)\]/\{$1\}/g; print; } Just curious, but since this is just transpose, then why not simply tr/[]/{}/? I.e. why use a regular expression at all

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Steve Holden
Tim Chase wrote: Schif Schaf wrote: On Feb 7, 12:19 am, Alf P. Steinbach al...@start.no wrote: I haven't used regexps in Python before, but what I did was (1) look in the documentation, [snip] code import re text = ( Lorem [ipsum] dolor sit amet, consectetur, adipisicing

Re: python admin abuse complaint

2010-02-07 Thread Steve Holden
Shashwat Anand wrote: LOL pow(funny, sys.maxint) Yes, funny, but it overlooks the point that Xah is a nuisance to multiple communities, not just to ours, and quite often concurrently. I'm all in favor of tolerance, but I'd like to see some evidence that rehabilitation is practical before the

Re: How to print all expressions that match a regular expression

2010-02-07 Thread Tim Chase
hzh...@gmail.com wrote: Given the function hashlib.sha256, enumerate all the possible inputs that give the hexadecimal result 0a2591aaf3340ad92faecbc5908e74d04b51ee5d2deee78f089f1607570e2e91. This is a hash collision problem. Nobody has proved that SHA-256 is collision free It's actually

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Tim Chase
Steve Holden wrote: Tim Chase wrote: And to answer those who are reaching for other non-regex (whether string translations or .replace(), or pyparsing) solutions, it depends on what you want to happen in pathological cases like s = Dangling closing] with properly [[nested]] and

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
LOL pow(funny, sys.maxint) Yes, funny, but it overlooks the point that Xah is a nuisance to multiple communities, not just to ours, and quite often concurrently. I don't think we need to worry about other communities or every internet related problem. The only thing we need to make sure is

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
LOL pow(funny, sys.maxint) Yes, funny, but it overlooks the point that Xah is a nuisance to multiple communities, not just to ours, and quite often concurrently. I don't think we need to worry about other communities or every internet related problem. The only thing we need to make sure is

Re: merge stdin, stdout?

2010-02-07 Thread Anssi Saari
jonny lowe jonny.lowe.12...@gmail.com writes: The result is the same as before. I've tested in fedora11. I don't think script is the answer here, since it only stores what's displayed on a terminal and your program's input comes from a file and is not displayed on the terminal. Simplest

Re: python admin abuse complaint

2010-02-07 Thread D'Arcy J.M. Cain
On Sun, 7 Feb 2010 15:11:41 +0100 Daniel Fetchinson fetchin...@googlemail.com wrote: I'd say let's designate a post Python Community Jester, or PCJ for short, let's name Xah Lee the PCJ and make it clear that he can engage in his activities on c.l.p and #python as he wishes without retribution

Re: new.instancemethod __iter__

2010-02-07 Thread Martin Drautzburg
Steve Holden wrote: y = s1*2 + s2(align=10) which should iterate as Time=1,'a' Time=2,'a' Time=10,'b' I have no difficulty passing align to the object (using __call__) and use it while I furnish my own __iter__() method. However I don't quite see how I can do this with bare

Re: How to print all expressions that match a regular expression

2010-02-07 Thread hzh...@gmail.com
And I really don't see how simple enumeration of range(2^2048) breaks RSA-2048, since that problem requires you to find two factors which, when multiplied together, give that specific value. I can tell you why is that. RSA-2048 has a composite of length less than 2^2048, which is a product

Re: new.instancemethod __iter__

2010-02-07 Thread Steve Holden
Martin Drautzburg wrote: Steve Holden wrote: y = s1*2 + s2(align=10) which should iterate as Time=1,'a' Time=2,'a' Time=10,'b' I have no difficulty passing align to the object (using __call__) and use it while I furnish my own __iter__() method. However I don't quite see how I can

still having problems with Nim. using python 2.6.4

2010-02-07 Thread Jordan Uchima
I have attached the file that the game is on. feel free to modify it to make it better. all suggestions are welcome. if you don't want to download the file then here's the code:

Re: How to print all expressions that match a regular expression

2010-02-07 Thread Steve Holden
hzh...@gmail.com wrote: And I really don't see how simple enumeration of range(2^2048) breaks RSA-2048, since that problem requires you to find two factors which, when multiplied together, give that specific value. I can tell you why is that. RSA-2048 has a composite of length less than

Re: still having problems with Nim. using python 2.6.4

2010-02-07 Thread Steve Holden
Jordan Uchima wrote: I have attached the file that the game is on. feel free to modify it to make it better. all suggestions are welcome. if you don't want to download the file then here's the code: [...] my problem is that i can't get it to make the players have more than 1 turn each, it

Re: threading+popen2 hang

2010-02-07 Thread Aahz
In article 188bfb67-3334-4325-adfc-3fa4d28f0...@d27g2000yqn.googlegroups.com, lofic louis.coill...@gmail.com wrote: Works fine on RHEL5/python 2.4.3 Hangs on RHEL4/python 2.3.4 Then use Python 2.4 -- surely you don't expect anyone to provide bugfixes for a release that's several years old? --

Re: passing string for editing in input()

2010-02-07 Thread Aahz
In article mailman.1787.1265117353.28905.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: On Tue, Feb 2, 2010 at 5:24 AM, mk mrk...@gmail.com wrote: Is there an easy way to get an editing (readline) in Python that would contain string for editing and would not just be empty? I

Re: Your impression of for-novice writings on assertions

2010-02-07 Thread David
Hi Alf, I think you talk too much... :-) Basically I am all for a verbose approach in a text for beginners, but on the other hand it is necessary to stick to the point you are making. When, for example, you introduce your reader to the thoughts of Francis Glassborrow on page 5 of chapter

Re: TABS in the CPython C source code

2010-02-07 Thread Terry Reedy
On 2/7/2010 7:39 AM, Steve Holden wrote: Clearly written by someone who has never *used* a mechanical typewriter. The original mechanisms had tab set and tab clear keys, so you had variable tabbing according to the needs of the particular document you were working on. Look under T in

Re: WCK and PIL

2010-02-07 Thread darnzen
On Feb 6, 10:19 pm, Nobody nob...@nowhere.com wrote: On Fri, 05 Feb 2010 21:05:53 -0800, darnzen wrote: I've written an app using thewcklibrary (widget construction kit, seehttp://www.effbot.org), in addition to the wckGraph module. What I'd like to do, is take the output of one of my

Checking the coding style

2010-02-07 Thread Pablo Recio Quijano
Hi! I'm finishing a project writen in Python, and I realize about the document PEP8 - Style Guide for Python Code [1]. Is there any app or script that checks if my project pass that style guide? I also worked with Drupal, and I know there is some modules and scripts that checks its coding

Executing Commands From Windows Service

2010-02-07 Thread T
I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands. Specifically, the program will call plink.exe to create a reverse SSH tunnel. Right now I'm using subprocess.Popen to do so. When I run it interactively via an admin

Re: Checking the coding style

2010-02-07 Thread Gerald Britton
pylint and pychecker are good options On Sun, Feb 7, 2010 at 1:36 PM, Pablo Recio Quijano rikuthero...@gmail.com wrote: Hi! I'm finishing a project writen in Python, and I realize about the document PEP8 - Style Guide for Python Code [1]. Is there any app or script that checks if my project

Re: Executing Commands From Windows Service

2010-02-07 Thread Stephen Hansen
On Sun, Feb 7, 2010 at 11:02 AM, T misceveryth...@gmail.com wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands. Specifically, the program will call plink.exe to create a reverse SSH tunnel. Right now I'm using

Re: Checking the coding style

2010-02-07 Thread Kev Dwyer
On Sun, 07 Feb 2010 19:36:10 +0100, Pablo Recio Quijano wrote: Hi! I'm finishing a project writen in Python, and I realize about the document PEP8 - Style Guide for Python Code [1]. Is there any app or script that checks if my project pass that style guide? I also worked with Drupal, and

Re: Checking the coding style

2010-02-07 Thread Pablo Recio Quijano
Thanks! Pylint was what i was loking for 2010/2/7 Gerald Britton gerald.brit...@gmail.com pylint and pychecker are good options On Sun, Feb 7, 2010 at 1:36 PM, Pablo Recio Quijano rikuthero...@gmail.com wrote: Hi! I'm finishing a project writen in Python, and I realize about the

Re: Checking the coding style

2010-02-07 Thread Andrej Mitrovic
On Feb 7, 8:22 pm, Kev Dwyer kevin.p.dw...@gmail.com wrote: On Sun, 07 Feb 2010 19:36:10 +0100, Pablo Recio Quijano wrote: Hi! I'm finishing a project writen in Python, and I realize about the document PEP8 - Style Guide for Python Code [1]. Is there any app or script that checks if my

Re: max / min / smallest float value on Python 2.5

2010-02-07 Thread duncan smith
Steven D'Aprano wrote: On Sun, 07 Feb 2010 03:02:05 +, duncan smith wrote: The precise issue is that I'm supplying a default value of 2.2250738585072014e-308 for a parameter (finishing temperature for a simulated annealing algorithm) in an application. I develop on Ubuntu64, but (I am

Re: max / min / smallest float value on Python 2.5

2010-02-07 Thread Mark Dickinson
On Feb 7, 8:45 pm, duncan smith buzz...@urubu.freeserve.co.uk wrote: [...] interested, but the following pseudo-python gives the idea.  For an [...]              try:                  yield rand() exp(dF / temp) Practically speaking, the condition rand() exp(dF / temp) is never going to be

Re: TABS in the CPython C source code

2010-02-07 Thread Neil Hodgson
Aahz: BTW, in case anyone is confused, it's svn blame vs cvs annotate. Possibly earlier versions of SVN only supported blame but the variants annotate, ann, and praise all work with the version of SVN (1.6.5) I have installed. Neil -- http://mail.python.org/mailman/listinfo/python-list

Available for use: Tabs management software

2010-02-07 Thread James Harris
In case someone else finds it useful here is a program I wrote a year or so ago to help manage tab characters. It will convert tabs to runs of spaces, convert runs of spaces to tabs, or count or check for tab characters as required. It supports tab stops at regular and irregular positions.

Re: Executing Commands From Windows Service

2010-02-07 Thread Sean DiZazzo
On Feb 7, 11:02 am, T misceveryth...@gmail.com wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands.  Specifically, the program will call plink.exe to create a reverse SSH tunnel.  Right now I'm using subprocess.Popen

Re: Executing Commands From Windows Service

2010-02-07 Thread T
On Feb 7, 4:43 pm, Sean DiZazzo half.ital...@gmail.com wrote: On Feb 7, 11:02 am, T misceveryth...@gmail.com wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands.  Specifically, the program will call plink.exe to

question on using tarfile to read a *.tar.gzip file

2010-02-07 Thread m_ahlenius
Hi, I have a number of relatively large number *tar.gzip files to process. With the py module tarfile, I see that I can access and extract them, one at a time to a temporary dir, but that of course takes time. All that I need to do is to read the first and last lines of each file and then move

Re: How to print all expressions that match a regular expression

2010-02-07 Thread hzh...@gmail.com
That is a method called brute force. According to my computation, 2^2048= 32317006071311007300714876688669951960444102669715484032130345427524655138867890 89319720141152291346368871796092189801949411955915049092109508815238644828312063

Re: How to print all expressions that match a regular expression

2010-02-07 Thread Steven D'Aprano
On Sun, 07 Feb 2010 03:53:49 +0100, Alf P. Steinbach wrote: Given the function hashlib.sha256, enumerate all the possible inputs that give the hexadecimal result 0a2591aaf3340ad92faecbc5908e74d04b51ee5d2deee78f089f1607570e2e91. I tried some parrot variants but no dice. :-( Oh, everybody

Re: Executing Commands From Windows Service

2010-02-07 Thread Alf P. Steinbach
* T: On Feb 7, 4:43 pm, Sean DiZazzo half.ital...@gmail.com wrote: On Feb 7, 11:02 am, T misceveryth...@gmail.com wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands. Specifically, the program will call plink.exe to

Re: passing string for editing in input()

2010-02-07 Thread Chris Rebert
On Sun, Feb 7, 2010 at 8:24 AM, Aahz a...@pythoncraft.com wrote: In article mailman.1787.1265117353.28905.python-l...@python.org, Chris Rebert  c...@rebertia.com wrote: On Tue, Feb 2, 2010 at 5:24 AM, mk mrk...@gmail.com wrote: Is there an easy way to get an editing (readline) in Python that

Re: question on using tarfile to read a *.tar.gzip file

2010-02-07 Thread Tim Chase
Is there a way to do this, without decompressing each file to a temp dir? Like is there a method using some tarfile interface adapter to read a compressed file? Otherwise I'll just access each file, extract it, grab the 1st and last lines and then delete the temp file. I think you're looking

Re: Available for use: Tabs management software

2010-02-07 Thread James Harris
On 7 Feb, 21:25, James Harris james.harri...@googlemail.com wrote: In case someone else finds it useful here is a program I wrote a year or so ago to help manage tab characters. It will convert tabs to runs of spaces, convert runs of spaces to tabs, or count or check for tab characters as

Re: TABS in the CPython C source code

2010-02-07 Thread Nobody
On Sun, 07 Feb 2010 05:49:28 +, Nobody wrote: The size-8 tabs look really bad in an editor configured with tab size 4, as is common in Windows. I'm concluding that the CPython programmers configure their Visual Studio's to *nix convention. 8-column tabs aren't a *nix convention; that's

Re: Your beloved python features

2010-02-07 Thread Anssi Saari
Julian maili...@julianmoritz.de writes: I've asked this question at stackoverflow a few weeks ago, and to make it clear: this should NOT be a copy of the stackoverflow-thread hidden features of Python. Thanks for the hint, interesting stuff in there. For those guys would be a poster quite

Re: question on using tarfile to read a *.tar.gzip file

2010-02-07 Thread m_ahlenius
On Feb 7, 5:01 pm, Tim Chase python.l...@tim.thechases.com wrote: Is there a way to do this, without decompressing each file to a temp dir?  Like is there a method using some tarfile interface adapter to read a compressed file?  Otherwise I'll just access each file, extract it,  grab the

Possible? Python 2.6.x and PythonWin on 64-bit Windows 7

2010-02-07 Thread escalation746
I am having a heck of a time doing the simplest thing: installing Python and the pywin extensions, including the PythonWin editor I have always relied on, into my new Windows 7 Professional 64-bit OS. I tried the Python package from python.org and pywin32 from sourceforge. But the latter would not

Re: Possible? Python 2.6.x and PythonWin on 64-bit Windows 7

2010-02-07 Thread Stephen Hansen
On Sun, Feb 7, 2010 at 4:26 PM, escalation746 escalation...@yahoo.comwrote: I am having a heck of a time doing the simplest thing: installing Python and the pywin extensions, including the PythonWin editor I have always relied on, into my new Windows 7 Professional 64-bit OS. I tried the

Re: Possible? Python 2.6.x and PythonWin on 64-bit Windows 7

2010-02-07 Thread Andrej Mitrovic
On Feb 8, 1:26 am, escalation746 escalation...@yahoo.com wrote: I am having a heck of a time doing the simplest thing: installing Python and the pywin extensions, including the PythonWin editor I have always relied on, into my new Windows 7 Professional 64-bit OS. I tried the Python package

Re: Possible? Python 2.6.x and PythonWin on 64-bit Windows 7

2010-02-07 Thread escalation746
Andrej Mitrovic wrote: Perhaps you've accidentally downloaded the wrong version of PythonWin? Erk, yes, my bad. Thanks for the quick help! Though I still wonder why the ActiveState build does not include this. -- robin -- http://mail.python.org/mailman/listinfo/python-list

Modifying Class Object

2010-02-07 Thread T
Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self, param1, param2, param3): self.param1 = param1 self.param2 = param2 self.param3 = param3 Next, I have a dictionary mytest that

Re: Modifying Class Object

2010-02-07 Thread Chris Rebert
On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing.  I have a class Test, for example: class Test:    def __init__(self, param1, param2, param3):        self.param1 = param1        self.param2 = param2  

Re: How to print all expressions that match a regular expression

2010-02-07 Thread Steve Holden
Steven D'Aprano wrote: On Sun, 07 Feb 2010 03:53:49 +0100, Alf P. Steinbach wrote: Given the function hashlib.sha256, enumerate all the possible inputs that give the hexadecimal result 0a2591aaf3340ad92faecbc5908e74d04b51ee5d2deee78f089f1607570e2e91. I tried some parrot variants but no

Re: Modifying Class Object

2010-02-07 Thread T
On Feb 7, 8:16 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing.  I have a class Test, for example: class Test:    def __init__(self, param1, param2,

Re: python admin abuse complaint

2010-02-07 Thread Jean-Michel Pichavant
Steve Holden wrote: Shashwat Anand wrote: LOL pow(funny, sys.maxint) Yes, funny, but it overlooks the point that Xah is a nuisance to multiple communities, not just to ours, and quite often concurrently. I'm all in favor of tolerance, but I'd like to see some evidence that

Re: Modifying Class Object

2010-02-07 Thread Steve Holden
T wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self, param1, param2, param3): self.param1 = param1 self.param2 = param2 self.param3 = param3 Next, I have a

Re: python admin abuse complaint

2010-02-07 Thread MRAB
Jean-Michel Pichavant wrote: Steve Holden wrote: Shashwat Anand wrote: LOL pow(funny, sys.maxint) Yes, funny, but it overlooks the point that Xah is a nuisance to multiple communities, not just to ours, and quite often concurrently. I'm all in favor of tolerance, but I'd like to see

Re: Modifying Class Object

2010-02-07 Thread Alf P. Steinbach
* Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self, param1, param2, param3): self.param1 = param1

Re: Modifying Class Object

2010-02-07 Thread MRAB
Alf P. Steinbach wrote: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self, param1, param2, param3): self.param1

Re: Modifying Class Object

2010-02-07 Thread Alf P. Steinbach
* MRAB: Alf P. Steinbach wrote: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self, param1, param2, param3):

Re: How to print all expressions that match a regular expression

2010-02-07 Thread Steven D'Aprano
On Sun, 07 Feb 2010 20:19:53 -0500, Steve Holden wrote: Steven D'Aprano wrote: On Sun, 07 Feb 2010 03:53:49 +0100, Alf P. Steinbach wrote: Given the function hashlib.sha256, enumerate all the possible inputs that give the hexadecimal result

Re: Modifying Class Object

2010-02-07 Thread Steve Holden
Alf P. Steinbach wrote: * MRAB: Alf P. Steinbach wrote: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def __init__(self, param1,

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Schif Schaf
On Feb 7, 8:57 am, Tim Chase python.l...@tim.thechases.com wrote: Steve Holden wrote: Really? Under what circumstances does a simple one-for-one character replacement operation fail? Failure is only defined in the clarified context of what the OP wants :)  Replacement operations only fail

Re: Modifying Class Object

2010-02-07 Thread Stephen Hansen
On Sun, Feb 7, 2010 at 5:51 PM, Alf P. Steinbach al...@start.no wrote: Incorrect; Python uses neither. See http://effbot.org/zone/call-by-object.htm for a excellent explanation of what Python does use. Hm. While most everything I've seen at effbot.org has been clear and to the point, that

Re: How to print all expressions that match a regular expression

2010-02-07 Thread Paul McGuire
On Feb 6, 1:36 pm, hzh...@gmail.com hzh...@gmail.com wrote: Hi, I am a fresh man with python. I know there is regular expressions in Python. What I need is that given a particular regular expression, output all the matches. For example, given “[1|2|3]{2}” as the regular expression, the

Re: Modifying Class Object

2010-02-07 Thread Steven D'Aprano
On Sun, 07 Feb 2010 22:03:06 -0500, Steve Holden wrote: Alf: This topic was discussed at great, nay interminable, length about a year ago. I'd appreciate it if you would search the archives and read what was said then rather than hashing the whole topic over again to nobody's real

Re: Modifying Class Object

2010-02-07 Thread alex23
Alf P. Steinbach al...@start.no wrote: Hm. While most everything I've seen at effbot.org has been clear and to the point, that particular article reads like a ton of obfuscation. Must. Resist. Ad hominem. Python passes pointers by value, just as e.g. Java does. There, it needed just 10

Re: Modifying Class Object

2010-02-07 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * MRAB: Alf P. Steinbach wrote: * Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, T misceveryth...@gmail.com wrote: Ok, just looking for a sanity check here, or maybe something I'm missing. I have a class Test, for example: class Test: def

C/C++ Import

2010-02-07 Thread 7H3LaughingMan
To make the background information short, I am trying to take a program that uses Python for scripting and recompile it for Linux since it originally was built to run on Win32. The program itself was designed to be able to be compiled on Linux and someone made there on release with source that

Re: Modifying Class Object

2010-02-07 Thread Steven D'Aprano
On Mon, 08 Feb 2010 02:51:05 +0100, Alf P. Steinbach wrote: Python passes pointers by value, just as e.g. Java does. How do I get a pointer in pure Python code (no ctypes)? I tried both Pascal and C syntax (^x and *x), but both give syntax errors. For that matter, how do I get a pointer in

Re: Modifying Class Object

2010-02-07 Thread T
Oops, this one was my fault - the object I was having the issues with was actually a shelve file, not a dictionary..so just re-assigning the variable isn't working, but re-writing the object to the shelve file does. So in this case, is there any way to just change a single value, or am I stuck

Python 2.4 and list of dictionary issues

2010-02-07 Thread Chris Stevens
Hi all, I'm a python newbie so please excuse me if I am missing something simple here. I am writing a script which requires a list of dictionaries (originally a dictionary of dictionaries, but I changed it to a list to try and overcome the below problem). Now my understanding is that you create

Re: Modifying Class Object

2010-02-07 Thread Steven D'Aprano
On Mon, 08 Feb 2010 03:21:11 +0100, Alf P. Steinbach wrote: A pointer tells you where something is; a reference doesn't. Sorry, I don't know of any relevant terminology where that is the case. Taken from Wikipedia: A pointer is a simple, less abstracted implementation of the more

Re: Modifying Class Object

2010-02-07 Thread Alf P. Steinbach
* Steven D'Aprano: On Mon, 08 Feb 2010 02:51:05 +0100, Alf P. Steinbach wrote: Python passes pointers by value, just as e.g. Java does. How do I get a pointer in pure Python code (no ctypes)? I tried both Pascal and C syntax (^x and *x), but both give syntax errors. Well, I don't believe

Re: How to print all expressions that match a regular expression

2010-02-07 Thread hzh...@gmail.com
Please check out this example on the pyparsing wiki, invRegex.py:http://pyparsing.wikispaces.com/file/view/invRegex.py.  This code implements a generator that returns successive matching strings for the given regex.  Running it, I see that you actually have a typo in your example. print

Re: Modifying Class Object

2010-02-07 Thread Alf P. Steinbach
* Steven D'Aprano: On Mon, 08 Feb 2010 03:21:11 +0100, Alf P. Steinbach wrote: A pointer tells you where something is; a reference doesn't. Sorry, I don't know of any relevant terminology where that is the case. Taken from Wikipedia: A pointer is a simple, less abstracted implementation of

Re: python admin abuse complaint

2010-02-07 Thread Aahz
In article mailman.2130.1265592763.28905.python-l...@python.org, Jean-Michel Pichavant jeanmic...@sequans.com wrote: So guys, just ignore him if you don't like him. Mailers news readers have plenty of feature to make it happen. Unfortunately, unless you have a stable group of people with

Re: Python 2.4 and list of dictionary issues

2010-02-07 Thread Chris Rebert
On Sun, Feb 7, 2010 at 9:08 PM, Chris Stevens cjstev...@gmail.com wrote: Hi all, I'm a python newbie so please excuse me if I am missing something simple here. I am writing a script which requires a list of dictionaries (originally a dictionary of dictionaries, but I changed it to a list to

  1   2   >