Re: Modifying Class Object

2010-02-07 Thread Arnaud Delobelle
"Alf P. Steinbach" writes: > * Chris Rebert: >> On Sun, Feb 7, 2010 at 5:05 PM, 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.par

Re: [PyOpenGL-Users] Mouse wheel events?

2010-02-07 Thread Craig Berry
On Sun, Feb 7, 2010 at 22:26, Gary Herron wrote: > Didn't I answer this already? If you did, for whatever reason I didn't see it; I just rechecked my inbox to be sure. Thanks for doing so again! I assume, given the list we're on, that Freeglut can be used with Python. I'll look into it. Thank

Re: C/C++ Import

2010-02-07 Thread Austin Bingham
Does the 'python' directory contain a file named '__init__.py'? This is required to let that directory act as a package (see: http://docs.python.org/tutorial/modules.html#packages); without it, you'll see the symptoms you're seeing. Austin On Mon, Feb 8, 2010 at 4:56 AM, 7H3LaughingMan wrote: >

Re: Executing Commands From Windows Service

2010-02-07 Thread Sean DiZazzo
On Feb 7, 4:57 pm, T wrote: > Thanks for the suggestions -  I think my next step is to try running > it under an admin user account, as you guys both mentioned.  Alf - > you're absolutely right, Microsoft has srvany.exe, which allows you to > run any EXE as a Windows service.  I've done this in th

Re: [PyOpenGL-Users] Mouse wheel events?

2010-02-07 Thread Gary Herron
Craig Berry wrote: Can someone please tell me if there's a way to do this, or answer definitively that there is no way? I have a design in progress that could really use mousewheel control, and I don't want to settle for Plan B until I know Plan A is impossible. :) On Fri, Feb 5, 2010 at 19:48,

convention for documenting function parameters in doc strings

2010-02-07 Thread danielx
Is there a convention for how to document function (or method) parameters in doc strings? Recently, I've been doing alot of PHP programming, and in PHPdoc, you'd do it like this: /* * @param type $foo Description. * * @return type Description. */ function bar($foo) { ... } Is there an equiv

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 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 try and overco

Re: python admin abuse complaint

2010-02-07 Thread Aahz
In article , Jean-Michel Pichavant 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 self-control, that doesn't work. Idiots like Xah will always get responses

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: 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. > >

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 t

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 abstr

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 t

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 rew

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 Ja

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 adde

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 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, pa

Re: Modifying Class Object

2010-02-07 Thread alex23
"Alf P. Steinbach" 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 words or so.

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 adv

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" 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 program should

Re: Modifying Class Object

2010-02-07 Thread Stephen Hansen
On Sun, Feb 7, 2010 at 5:51 PM, Alf P. Steinbach 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 pa

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

2010-02-07 Thread Schif Schaf
On Feb 7, 8:57 am, Tim Chase 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 if the OP's desired

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 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

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 0a2591aaf3340ad92faecbc5908e74d0

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 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 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.para

Re: Modifying Class Object

2010-02-07 Thread Alf P. Steinbach
* Chris Rebert: On Sun, Feb 7, 2010 at 5:05 PM, 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.p

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 s

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

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 rehabilitat

Re: Modifying Class Object

2010-02-07 Thread T
On Feb 7, 8:16 pm, Chris Rebert wrote: > On Sun, Feb 7, 2010 at 5:05 PM, 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 = para

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" vari

Re: Modifying Class Object

2010-02-07 Thread Chris Rebert
On Sun, Feb 7, 2010 at 5:05 PM, 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.param

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 con

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

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 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 from python.org and py

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 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 from pyth

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: question on using tarfile to read a *.tar.gzip file

2010-02-07 Thread m_ahlenius
On Feb 7, 5:01 pm, Tim Chase 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 1st and last lines and

Re: Your beloved python features

2010-02-07 Thread Anssi Saari
Julian 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 cool which describes

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"

Re: Available for use: Tabs management software

2010-02-07 Thread James Harris
On 7 Feb, 21:25, James Harris 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 required. It supports tab stop

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: passing string for editing in input()

2010-02-07 Thread Chris Rebert
On Sun, Feb 7, 2010 at 8:24 AM, Aahz wrote: > In article , > Chris Rebert   wrote: >>On Tue, Feb 2, 2010 at 5:24 AM, mk 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 googled but found not

Re: Executing Commands From Windows Service

2010-02-07 Thread Alf P. Steinbach
* T: On Feb 7, 4:43 pm, Sean DiZazzo wrote: On Feb 7, 11:02 am, T 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 us

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, e

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 087736730099609175019775038965210679605763838406756827679221864

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 o

Re: Executing Commands From Windows Service

2010-02-07 Thread T
On Feb 7, 4:43 pm, Sean DiZazzo wrote: > On Feb 7, 11:02 am, T 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

Re: Executing Commands From Windows Service

2010-02-07 Thread Sean DiZazzo
On Feb 7, 11:02 am, T 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 to do so.  When I run

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. http:

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/

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

2010-02-07 Thread Mark Dickinson
On Feb 7, 8:45 pm, duncan smith 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 satisfied if dF / temp <

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 told

Re: Checking the coding style

2010-02-07 Thread Andrej Mitrovic
On Feb 7, 8:22 pm, Kev Dwyer 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 project pass

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 > pylint and pychecker are good options > > On Sun, Feb 7, 2010 at 1:36 PM, Pablo Recio Quijano > wrote: > > Hi! > > I'm finishing a project writen in Python, and I realize about the > document > > PEP8 - Style Guide for Python C

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 Drupa

Re: Executing Commands From Windows Service

2010-02-07 Thread Stephen Hansen
On Sun, Feb 7, 2010 at 11:02 AM, T 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 to do s

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 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 guid

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 account

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 standar

Re: WCK and PIL

2010-02-07 Thread darnzen
On Feb 6, 10:19 pm, Nobody 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 windows (happens

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 h

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 three

Re: passing string for editing in input()

2010-02-07 Thread Aahz
In article , Chris Rebert wrote: >On Tue, Feb 2, 2010 at 5:24 AM, mk 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 googled but found nothing. > >Er...: http://docs.python.org/library/readline

Re: threading+popen2 hang

2010-02-07 Thread Aahz
In article <188bfb67-3334-4325-adfc-3fa4d28f0...@d27g2000yqn.googlegroups.com>, lofic 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? -- Aahz (a...@pythoncra

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 ea

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

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: 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. How

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 prod

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

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 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 and fear, and nobody

Re: merge stdin, stdout?

2010-02-07 Thread Anssi Saari
jonny lowe 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 solution is probably that you ha

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

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 su

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 c

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 pr

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 th

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" wrote: >>> I haven't used regexps in Python before, but what I did was (1) look >>> in the >>> documentation, > [snip] >>> >>> import re >>> >>> text = ( >>> "Lorem [ipsum] dolor sit amet, consectetur", >>>

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

2010-02-07 Thread Anssi Saari
Schif Schaf 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 for this?

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 > comma-s

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, tha

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('[',

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 >>> dependen

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 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 c.l.py and com

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" wrote: I haven't used regexps in Python before, but what I did was (1) look in the documentation, [snip] import re text = ( "Lorem [ipsum] dolor sit amet, consectetur", "adipisicing elit, sed do eiusmod tempor", "incid

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. >

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 certai

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

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 > 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, and Oli

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 tab

Re: Dreaming of new generation IDE

2010-02-07 Thread Steve Holden
bartc wrote: > "Arnaud Delobelle" wrote in message > news:m28wb6ypfs@googlemail.com... >> "Gabriel Genellina" writes: >> >>> En Fri, 05 Feb 2010 19:22:39 -0300, bartc escribió: "Steve Holden" wrote in message news:mailman.1998.1265399766.28905.python-l...@python.org... > Arnau

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 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

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 colou

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 call

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 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 p

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 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 p

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 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 p

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 w

  1   2   >