Re: An unusual question...

2011-04-18 Thread harrismh777
Steven D'Aprano wrote: > I'm pretty sure I wrote "standard Python" install in one of my replies. IronPython*is* standard Python. As are Jython, PyPy and CPython. This brings up a question I have had for a while; when is PSF going to forward PythonX on over to a formal standards committ

Re: Python IDE/text-editor

2011-04-18 Thread harrismh777
Terry Reedy wrote: IDLE loses syntax highlighting annoyingly often Could you exlain? When does it do that with a file labelled .py? ... never seen this behavior in IDLE with a .py file; not even once. I take that back... there was the time I tried to run IDLE on the mac mini with Apple bu

Re: [OT] Free software versus software idea patents

2011-04-18 Thread geremy condra
On Sun, Apr 17, 2011 at 11:29 PM, harrismh777 wrote: Ok, so, you're basically saying that perfect simulation is not a requirement for something to 'be mathematics'. I don't think you can construct a nontrivial model for mathematics without including that, but I'd be happy to be proven wrong, an

Re: Python IDE/text-editor

2011-04-18 Thread harrismh777
Jorgen Grahn wrote: Based on the comments here, it seems that emacs would have to be the editor-in-chief for programmers. I currently use SciTE at work; is it reasonable to, effectively, bill my employer for the time it'll take me to learn emacs? Editor-in-chief is a bit strong... but many

Re: [ANN] Python 2.5.6 Release Candidate 1

2011-04-18 Thread Werner F. Bruhin
On 04/17/2011 11:57 PM, "Martin v. Löwis" wrote: http://www.python.org/2.5.6 Just FYI, getting a 404 error on the above. I can see a 2.5.6c1 listes on "http://www.python.org/download/releases/2.5/highlights/"; which goes to "http://www.python.org/download/releases/2.5.6/"; Werner --

Re: Make Python "portable" by default! (Re: Python IDE/text-editor)

2011-04-18 Thread Wolfgang Keller
> >> You can't run Python programs without a Python interpreter > >> installed. > > > > Wrong. > > > > See e.g. http://www.portablepython.com/ > > Uhm... how does that disprove? Which part of the word "installed" don't you understand while actually using it? >;-> > Whatever language you distrib

strange use of %s

2011-04-18 Thread Tracubik
Hi all, i'm reading a python tutorial in Ubuntu's Full Circle Magazine and i've found this strange use of %s: sql = "SELECT pkid,name,source,servings FROM Recipes WHERE name like '%%%s% %'" %response response is a string. I've newbie in sql. why do the coder use %%%s%% instead of a simple %s? w

Re: Make Python "portable" by default! (Re: Python IDE/text-editor)

2011-04-18 Thread Chris Angelico
On Mon, Apr 18, 2011 at 6:15 PM, Wolfgang Keller wrote: > Which part of the word "installed" don't you understand while actually > using it? >;-> I have various programs which I distribute in zip/tgz format, and also as a self-extracting executable on Windows. Does this mean they need to be "inst

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread Raymond Hettinger
On Apr 16, 1:24 pm, candide wrote: > Consider the following code : > > # -- > def bool_equivalent(x): >      return True if x else False It's faster to write: def bool_equivalent(x): return not not x Raymond -- http://mail.python.org/mailman/listinfo/py

Re: strange use of %s

2011-04-18 Thread Tim Golden
On 18/04/2011 09:29, Tracubik wrote: Hi all, i'm reading a python tutorial in Ubuntu's Full Circle Magazine and i've found this strange use of %s: sql = "SELECT pkid,name,source,servings FROM Recipes WHERE name like '%%%s% %'" %response response is a string. I've newbie in sql. why do the code

Re: strange use of %s

2011-04-18 Thread Chris Angelico
On Mon, Apr 18, 2011 at 6:29 PM, Tracubik wrote: > Hi all, > i'm reading a python tutorial in Ubuntu's Full Circle Magazine and i've > found this strange use of %s: > > sql = "SELECT pkid,name,source,servings FROM Recipes WHERE name like '%%%s% > %'" %response > > response is a string. I've newbie

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread candide
Le 18/04/2011 10:33, Raymond Hettinger a écrit : # -- def bool_equivalent(x): return True if x else False It's faster to write: def bool_equivalent(x): return not not x faster and ... smarter ;) -- http://mail.python.org/mailman/listinfo/pyth

Re: An unusual question...

2011-04-18 Thread wisecracker
Hi Chris... > It sounds to me like you're trying to pull off a classic buffer > overrun and remote code execution exploit, in someone else's Python > program. And all I have to say is Good luck to you. Talking of nefarious usage... I wonder what this would do left unchecked on a current mach

Re: An unusual question...

2011-04-18 Thread Chris Angelico
On Mon, Apr 18, 2011 at 7:53 PM, wrote: > Talking of nefarious usage... > > I wonder what this would do left unchecked on a current machine and current > Python install... > > ### > > global somestring > somestring = " " > > while 1: >        #print somestring >        somestring = somestring +

Re: Make Python "portable" by default! (Re: Python IDE/text-editor)

2011-04-18 Thread flebber
On Apr 18, 6:33 pm, Chris Angelico wrote: > On Mon, Apr 18, 2011 at 6:15 PM, Wolfgang Keller wrote: > > Which part of the word "installed" don't you understand while actually > > using it? >;-> > > I have various programs which I distribute in zip/tgz format, and also > as a self-extracting execu

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread Duncan Booth
Steven D'Aprano wrote: > So in Python 2.2, Python introduced two new built-in names, True and > False, with values 1 and 0 respectively: > > [steve@sylar ~]$ python2.2 > Python 2.2.3 (#1, Aug 12 2010, 01:08:27) > [GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2 > Type "help", "copyright", "cre

Re: Python IDE/text-editor

2011-04-18 Thread Jean-Michel Pichavant
Alec Taylor wrote: Good Afternoon, I'm looking for an IDE which offers syntax-highlighting, code-completion, tabs, an embedded interpreter and which is portable (for running from USB on Windows). Here's a mockup of the app I'm looking for: http://i52.tinypic.com/2uojswz.png Which would you rec

Re: Python IDE/text-editor

2011-04-18 Thread Ton van Vliet
On Sat, 16 Apr 2011 13:20:32 +1000, Alec Taylor wrote: >Good Afternoon, > >I'm looking for an IDE which offers syntax-highlighting, >code-completion, tabs, an embedded interpreter and which is portable >(for running from USB on Windows). > >Here's a mockup of the app I'm looking for: http://i52.t

Re: An unusual question...

2011-04-18 Thread Steven D'Aprano
On Mon, 18 Apr 2011 10:53:00 +0100, wisecracker wrote: > global somestring > somestring = " " You don't need to declare a name in the global scope as global. It just is global. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

How to create a (transparent) decorator with status information?

2011-04-18 Thread Timo Schmiade
Hi all, I'm currently occupying myself with python's decorators and have some questions as to their usage. Specifically, I'd like to know how to design a decorator that maintains a status. Most decorator examples I encountered use a function as a decorator, naturally being stateless. Consider the

Re: An unusual question...

2011-04-18 Thread Grant Edwards
On 2011-04-18, harrismh777 wrote: > Steven D'Aprano wrote: >>> > I'm pretty sure I wrote "standard Python" install in one of my replies. >> IronPython*is* standard Python. As are Jython, PyPy and CPython. >> > > This brings up a question I have had for a while; when is PSF going > to forwa

Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
Geany I've tried in the past, it's really buggy on my home computer and at Uni... however from my phone it works wonderfully! (Use it for C++ projects on Rhobuntu) Eric 4 was suggested to me on the #python channel on Freenode... however I've never been able to get it compiled/working. Too many dep

Re: Python IDE/text-editor

2011-04-18 Thread Andrea Crotti
Alec Taylor writes: > > Emacs and vim still seem like good alternatives, when I get the time. > However, currently have 3 assignments to start and finish so would > like a simple Notepad2 with python interpreter attached (and keyboard > shortcut to run script) type program. > > Please continue rec

Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes?

2011-04-18 Thread Aldo Ceccarelli
On Apr 15, 11:00 am, Aldo Ceccarelli wrote: > Hello All, > in my specific problem I will be happy of a response where possible > to: > > 1. distinguish different operating systems of answering nodes > 2. collect responses of Wyse thin-clients with "Thin OS" to get node > name and MAC address in pa

Re: PYTHONPATH

2011-04-18 Thread MRAB
On 18/04/2011 05:37, harrismh777 wrote: [snip] In retrospect, in many ways this is why I am relatively patient with the Python3 development direction. While I think its non-compatibility may hurt in the short term, the long term goal of stream-lining the language will make for a much better Pytho

Re: Feature suggestion -- return if true

2011-04-18 Thread Aahz
In article , D'Arcy J.M. Cain wrote: >On Sun, 17 Apr 2011 16:21:53 +1200 >Gregory Ewing wrote: >> My idiom for fetching from a cache looks like this: >> >>def get_from_cache(x): >> y = cache.get(x) >> if not y: >>y = compute_from(x) >>cache[x] = y >> return y >

Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
The current finalists: *Editra* with PyShell in Shelf Pros: Syntax highlighting, tabs, ¿portable? and embedded python interpreter (PyShell 0.8) Cons: No run button or keyboard shortcut for quick running of script (made issue: http://code.google.com/p/editra/issues/detail?id=641) and doesn't save

Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
The current finalists: Editra with PyShell in Shelf Pros: Syntax highlighting, tabs, ¿portable? and embedded python interpreter (PyShell 0.8) Cons: No run button or keyboard shortcut for quick running of script (made issue: http://code.google.com/p/editra/issues/detail?id=641) and doesn't save se

installing setuptools on Windows custom python install

2011-04-18 Thread Eric Frederich
Hello, I have a python installation that I built myself using Visual Studio 2005. I need this version because I need to link Python bindings to a 3rd party library that uses VS 2005. I want to get setuptools installed to this Python installation but the installer won't find my version of Python e

Re: installing setuptools on Windows custom python install

2011-04-18 Thread Benjamin Kaplan
On Apr 18, 2011 12:55 PM, "Eric Frederich" wrote: > > Hello, > > I have a python installation that I built myself using Visual Studio 2005. > I need this version because I need to link Python bindings to a 3rd > party library that uses VS 2005. > > I want to get setuptools installed to this Python

Re: installing setuptools on Windows custom python install

2011-04-18 Thread Wolfgang Rohdewald
On Montag 18 April 2011, Eric Frederich wrote: > File "F:\My_Python27\lib\socket.py", line 47, in > import _socket > ImportError: No module named _socket > > F:\pyside\setuptools-0.6c11> I have C:\Python27 and within that, DLLS\_socket.pyd this is what import _socket should find do you

Re: How to create a (transparent) decorator with status information?

2011-04-18 Thread Ian Kelly
On Mon, Apr 18, 2011 at 6:47 AM, Timo Schmiade wrote: > Hi all, > > I'm currently occupying myself with python's decorators and have some > questions as to their usage. Specifically, I'd like to know how to > design a decorator that maintains a status. Most decorator examples I > encountered use a

Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes?

2011-04-18 Thread Chris Angelico
On Tue, Apr 19, 2011 at 1:23 AM, Aldo Ceccarelli wrote: > Hello and thank you All! > I've solved my problem as follows: > 1. installed nmap > 2. wrote a python script calling nmap nmap -sP via os.system and > redirecting output to a file > 3. read results file and made a further processing to get

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread John Nagle
On 4/17/2011 5:12 PM, Gregory Ewing wrote: Chris Angelico wrote: Well, of course you can always implement bool as an int; Which Python used to do once upon a time -- and still does in a way, because bool is a subclass of int. The bool type was added mainly to provide a type that prints out a

logger warning doesn't appear even though propagate flag is True

2011-04-18 Thread Disc Magnet
This program prints both the warnings: #!/usr/bin/env python2.7 import logging import logging.config logging.config.fileConfig('log.conf') log1 = logging.getLogger() log2 = logging.getLogger('foo.bar') log2.addHandler(logging.NullHandler()) log1.warn('warning 1') log2.warn('warning 2') Howeve

Re: [ANN] Python 2.5.6 Release Candidate 1

2011-04-18 Thread Martin v. Loewis
Am 18.04.2011 09:59, schrieb Werner F. Bruhin: > On 04/17/2011 11:57 PM, "Martin v. Löwis" wrote: >> >> http://www.python.org/2.5.6 > Just FYI, getting a 404 error on the above. Thanks. There had been a number of glitches which have been corrected. If anything looks still incorrect, please le

Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes?

2011-04-18 Thread Daniel Kluev
Isn't it better to use subprocess.Popen and read stdout/stderr directly? Should be much more convenient than temporary files. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Two similar logging programs but different ouputs

2011-04-18 Thread Disc Magnet
I have tried writing two programs which are doing similar activities. The little difference between the two programs is that the first one configures logger1 using addHandler() method while the second program configures logger1 from log.conf file. However, the output differs for both. The first pr

Re: Two similar logging programs but different ouputs

2011-04-18 Thread Vinay Sajip
On Apr 18, 10:11 pm, Disc Magnet wrote: > Could you please help me understand this difference? Programs and > log.conf file follow: The first program prints two messages because loggers pass events to handlers attached to themselves and their ancestors. Hence, logger1's message is printed by log

Re: Two similar logging programs but different ouputs

2011-04-18 Thread Vinay Sajip
On Apr 18, 10:11 pm, Disc Magnet wrote: > Could you please help me understand this difference? Programs and > log.conf file follow: The first program prints two messages because loggers pass events to handlers attached to themselves and their ancestors. Hence, logger1's message is printed by log

Programmatically log in and request XML

2011-04-18 Thread Tim Johnson
FYI: Using python 2.7 on ubuntu 10.04. I have acquainted myself with the parsing of XML data using an input file as test data. Now I need to make a request the feed itself, and capture that field as data. I need to do the following: 1)Programmatically log into a site with user and password. 2)Mak

Re: An unusual question...

2011-04-18 Thread Rhodri James
On Mon, 18 Apr 2011 08:01:00 +0100, wrote: Hi Rhodri... You do realise that what id() returns is implementation-dependent, don't you? In particular, what IronPython returns isn't an address. I'm pretty sure I wrote "standard Python" install in one of my replies. Yeah here it is in a reply

Re: How to create a (transparent) decorator with status information?

2011-04-18 Thread Wayne Witzel III
> > Thinking object-orientedly, my first idea was to use an object as a > decorator: > > class CallCounter: > def __init__(self, decorated): > self.__function = decorated > self.__numCalls = 0 > > def __call__(self, *args, **kwargs): > self.__numCalls += 1 > return self.__fun

Popen to get stdout and stderr for ffmpeg - No such file or directory ?

2011-04-18 Thread goldtech
Hi, Trying to learn how to run a linux command and get the stdout and stderr. I'm trying the following: >>> cmd3 = r'ffmpeg -i /home/giga/Desktop/Guitar1.flv' >>> p = Popen(cmd3, stdout=PIPE, stderr=PIPE) Traceback (most recent call last): File "", line 1, in p = Popen(cmd3, stdout=PIPE,

Python3 "designed right" (was: PYTHONPATH)

2011-04-18 Thread Brendan Simon (eTRIX)
On 19/04/2011 2:15 AM, python-list-requ...@python.org wrote: Subject: Re: PYTHONPATH From: MRAB Date: Mon, 18 Apr 2011 16:31:31 +0100 To: python-list@python.org On 18/04/2011 05:37, harrismh777 wrote: [snip] In retrospect, in many ways this is why I am relatively patient with the Python3 dev

Re: [ANN] Python 2.5.6 Release Candidate 1

2011-04-18 Thread Brendan Simon (eTRIX)
On 19/04/2011 9:05 AM, python-list-requ...@python.org wrote: Am 18.04.2011 09:59, schrieb Werner F. Bruhin: > On 04/17/2011 11:57 PM, "Martin v. Löwis" wrote: >>http://www.python.org/2.5.6 If there is an official release of source (e.g. 2.5.5 and 2.5.6) why aren't binaries produced (

Re: Popen to get stdout and stderr for ffmpeg - No such file or directory ?

2011-04-18 Thread Chris Rebert
On Mon, Apr 18, 2011 at 4:07 PM, goldtech wrote: > Hi, > > Trying to learn how to run a linux command and get the stdout and > stderr. I'm trying the following: > cmd3 = r'ffmpeg -i /home/giga/Desktop/Guitar1.flv' p = Popen(cmd3, stdout=PIPE, stderr=PIPE) > > Traceback (most recent call

Re: Popen to get stdout and stderr for ffmpeg - No such file or directory ?

2011-04-18 Thread Rhodri James
On Tue, 19 Apr 2011 00:07:46 +0100, goldtech wrote: Trying to learn how to run a linux command and get the stdout and stderr. I'm trying the following: cmd3 = r'ffmpeg -i /home/giga/Desktop/Guitar1.flv' p = Popen(cmd3, stdout=PIPE, stderr=PIPE) Traceback (most recent call last): File ""

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread Gregory Ewing
John Nagle wrote: Pascal got this right. (A nice feature of Pascal was that "packed array of boolean" was a bit array). C, which originally lacked a "bool" type, got it wrong. So did Python. If Python had had a boolean type from the beginning, it probably wouldn't have been a subclass of in

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread Gregory Ewing
Chris Angelico wrote: Remind me some day to finish work on my "ultimate programming language", which starts out with a clean slate and lets the programmer define his own operators and everything. Didn't someone already do that and call it "lisp"? :-) -- Greg -- http://mail.python.org/mailman/

Re: [Tutor] working with strings in python3

2011-04-18 Thread James Mills
On Tue, Apr 19, 2011 at 10:17 AM, Rance Hall wrote: > pseudo code: > > > message = "Bah." > > if test: >   message = message + " Humbug!" > > print(message) > > end pseudo code Normally it's considered bad practise to concatenate strings. Use a a format specifier like this: > message = "Bah." >

Re: Feature suggestion -- return if true

2011-04-18 Thread Gregory Ewing
Chris Angelico wrote: Question: How many factorial functions are implemented because a program needs to know what n! is, and how many are implemented to demonstrate recursion (or to demonstrate the difference between iteration and recursion)? :) A related question is how often factorial functi

Re: [Tutor] working with strings in python3

2011-04-18 Thread Westley Martínez
On Tue, 2011-04-19 at 10:34 +1000, James Mills wrote: > On Tue, Apr 19, 2011 at 10:17 AM, Rance Hall wrote: > > pseudo code: > > > > > > message = "Bah." > > > > if test: > > message = message + " Humbug!" > > > > print(message) > > > > end pseudo code > > Normally it's considered bad practise

Re: [Tutor] working with strings in python3

2011-04-18 Thread Benjamin Kaplan
On Mon, Apr 18, 2011 at 8:58 PM, Westley Martínez wrote: > On Tue, 2011-04-19 at 10:34 +1000, James Mills wrote: >> On Tue, Apr 19, 2011 at 10:17 AM, Rance Hall wrote: >> > pseudo code: >> > >> > >> > message = "Bah." >> > >> > if test: >> >   message = message + " Humbug!" >> > >> > print(messag

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread Christian Heimes
Am 18.04.2011 21:58, schrieb John Nagle: > This is typical for languages which backed into a "bool" type, > rather than having one designed in. The usual result is a boolean > type with numerical semantics, like > > >>> True + True > 2 I find the behavior rather useful. It allows multi-xor

Re: Questions about GIL and web services from a n00b

2011-04-18 Thread Hank Fay
Today I just happened to watch this session from PyCon 2011 on gevent and gunicorn: http://blip.tv/file/4883016 gevent uses greenlet, fwiw. I found it informative, but then I find most things informative. H -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] working with strings in python3

2011-04-18 Thread Westley Martínez
On Mon, 2011-04-18 at 21:23 -0400, Benjamin Kaplan wrote: > message = "%s %s" % (message, " Humbug!") fix'd -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] working with strings in python3

2011-04-18 Thread Steven D'Aprano
On Tue, 19 Apr 2011 10:34:27 +1000, James Mills wrote: > Normally it's considered bad practise to concatenate strings. *Repeatedly*. There's nothing wrong with concatenating (say) two or three strings. What's a bad idea is something like: s = '' while condition: s += "append stuff to end

Re: [Tutor] working with strings in python3

2011-04-18 Thread Dan Stromberg
On Mon, Apr 18, 2011 at 6:23 PM, Benjamin Kaplan wrote: > On Mon, Apr 18, 2011 at 8:58 PM, Westley Martínez wrote: >> On Tue, 2011-04-19 at 10:34 +1000, James Mills wrote: >>> On Tue, Apr 19, 2011 at 10:17 AM, Rance Hall wrote: >>> > pseudo code: >>> > >>> > >>> > message = "Bah." >>> > >>> > if

Re: [ANN] Python 2.5.6 Release Candidate 1

2011-04-18 Thread Terry Reedy
On 4/18/2011 7:33 PM, Brendan Simon (eTRIX) wrote: If there is an official release of source (e.g. 2.5.5 and 2.5.6) why aren't binaries produced (other than to make it really hard for users and force them to upgrade to a later major revision -- 2.6, 2.7, etc) ?? Unofficial answer: A. Binaries

Re: Popen to get stdout and stderr for ffmpeg - No such file or directory ?

2011-04-18 Thread goldtech
> Read The Fine > Manual:http://docs.python.org/library/subprocess.html#subprocess.Popen: snip... > > Try instead: > cmd3 = ['ffmpeg', '-i', '/home/giga/Desktop/Guitar1.flv'] > > Cheers, > Chris > --http://blog.rebertia.com No doubt, I should RTFM...you're right! Yes, works like a charm now.

Re: [Tutor] working with strings in python3

2011-04-18 Thread Chris Angelico
On Tue, Apr 19, 2011 at 12:16 PM, Steven D'Aprano wrote: > See Joel on Software for more: > > http://www.joelonsoftware.com/articles/fog000319.html The bulk of that article is reasonable; he's right in that a good programmer MUST have at least some understanding of what's happening on the low

Re: [Tutor] working with strings in python3

2011-04-18 Thread Westley Martínez
On Tue, 2011-04-19 at 02:16 +, Steven D'Aprano wrote: > On Tue, 19 Apr 2011 10:34:27 +1000, James Mills wrote: > > > Normally it's considered bad practise to concatenate strings. > > *Repeatedly*. > > There's nothing wrong with concatenating (say) two or three strings. > What's a bad idea

Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
SPE looks good, however I couldn't get it running (svn'd it). Do you know if there's an installer? Editra has a really active support team, and have addressed all 3 of the bugs I found. (although mostly the bugs were me not knowing how it works!) Code completion would be nice, especially for a be

Re: Python IDE/text-editor

2011-04-18 Thread Teemu Likonen
* 2011-04-19T00:40:09+10:00 * Alec Taylor wrote: > Please continue recommending Emacs. * 2011-04-19T02:41:11+10:00 * Alec Taylor wrote: > Please continue suggesting Python IDEs and/or fixes for the above > Cons. Emacs. * 2011-04-19T13:44:29+10:00 * Alec Taylor wrote: > Please continue with your

IDLE bug

2011-04-18 Thread harrismh777
Are bug reports wanted here, or just in issue tracker? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE bug

2011-04-18 Thread James Mills
On Tue, Apr 19, 2011 at 2:05 PM, harrismh777 wrote: > Are bug reports wanted here, or just in issue tracker? Pretty sure they're wanted in the Issue Tracker. cheers James -- -- James Mills -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE/text-editor

2011-04-18 Thread Westley Martínez
On Tue, 2011-04-19 at 06:51 +0300, Teemu Likonen wrote: > * 2011-04-19T00:40:09+10:00 * Alec Taylor wrote: > > Please continue recommending > > Vim. > > * 2011-04-19T02:41:11+10:00 * Alec Taylor wrote: > > Please continue suggesting Python IDEs and/or fixes for the above > > Cons. > > Vim. > >

Re: IDLE bug

2011-04-18 Thread Westley Martínez
On Mon, 2011-04-18 at 23:05 -0500, harrismh777 wrote: > Are bug reports wanted here, or just in issue tracker? > > thanks > If it's a super-critical bug that can destroy data, yes, else just the issue tracker. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE/text-editor

2011-04-18 Thread Ben Finney
Alec Taylor writes: > Please continue with your recommendations. At some point you need to act on these recommendations by picking one for the time being. If you're so tight for time, why are you still evaluating editors after several days of recommendations? Why have you not yet chosen an edit

Re: Python IDE/text-editor

2011-04-18 Thread rusi
On Tue, 2011-04-19 at 06:51 +0300, Teemu Likonen wrote: emacs * 3 On Apr 19, 9:17 am, Westley Martínez wrote: vi * 3 This would be a competition except for viper: http://www.emacswiki.org/emacs/ViperMode IOW emacs can be morphed into vi -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE/text-editor

2011-04-18 Thread Chris Angelico
On Tue, Apr 19, 2011 at 2:37 PM, rusi wrote: > On Tue, 2011-04-19 at 06:51 +0300, Teemu Likonen wrote: > emacs * 3 > > On Apr 19, 9:17 am, Westley Martínez wrote: > vi * 3 > > This would be a competition except for viper: > http://www.emacswiki.org/emacs/ViperMode > IOW emacs can be morphed into

Re: Python IDE/text-editor

2011-04-18 Thread rusi
On Apr 19, 9:32 am, Ben Finney wrote: > Alec Taylor writes: > > Please continue with your recommendations. > > At some point you need to act on these recommendations by picking one > for the time being. > > If you're so tight for time, why are you still evaluating editors after > several days of

Re: Python IDE/text-editor

2011-04-18 Thread rusi
On Apr 19, 9:44 am, Chris Angelico wrote: > On Tue, Apr 19, 2011 at 2:37 PM, rusi wrote: > > On Tue, 2011-04-19 at 06:51 +0300, Teemu Likonen wrote: > > emacs * 3 > > > On Apr 19, 9:17 am, Westley Martínez wrote: > > vi * 3 > > > This would be a competition except for viper: > >http://www.emacsw

Re: strange use of %s

2011-04-18 Thread Chris Angelico
On Tue, Apr 19, 2011 at 3:22 PM, Dennis Lee Bieber wrote: > On Mon, 18 Apr 2011 09:44:40 +0100, Tim Golden > declaimed the following in gmane.comp.python.general: > > >>    sql = "SELECT ... WHERE name LIKE '%' + ? + '%'" >>    q = db.cursor () >>    q.execute (sql, [response]) >> >        That w

Re: Two similar logging programs but different ouputs

2011-04-18 Thread Disc Magnet
Thank you Vinay for the quick reply. I have a few more questions. On Tue, Apr 19, 2011 at 3:27 AM, Vinay Sajip wrote: > On Apr 18, 10:11 pm, Disc Magnet wrote: > >> Could you please help me understand this difference? Programs and >> log.conf file follow: > > The first program prints two message

Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes?

2011-04-18 Thread Aldo Ceccarelli
On 18 Apr, 22:38, Daniel Kluev wrote: > Isn't it better to use subprocess.Popen and read stdout/stderr > directly? Should be much more convenient than temporary files. > > -- > With best regards, > Daniel Kluev Thanks Daniel, your solution is far better WKR! Aldo -- http://mail.python.org/mailma

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread Kushal Kumaran
On Tue, Apr 19, 2011 at 7:09 AM, Christian Heimes wrote: > Am 18.04.2011 21:58, schrieb John Nagle: >>     This is typical for languages which backed into a "bool" type, >> rather than having one designed in.  The usual result is a boolean >> type with numerical semantics, like >> >>  >>> True + T

Re: Equivalent code to the bool() built-in function

2011-04-18 Thread Chris Angelico
On Tue, Apr 19, 2011 at 4:23 PM, Kushal Kumaran wrote: >> if a + b + c + d != 1: >>    raise ValueError("Exactly one of a, b, c or d must be true.") >> > > Unless you're sure all of a, b, c, and d are boolean values, an int > with a negative value slipping in could result in the sum equaling 1, >

Re: Feature suggestion -- return if true

2011-04-18 Thread Jussi Piitulainen
Gregory Ewing writes: > Chris Angelico wrote: > > > Question: How many factorial functions are implemented because a > > program needs to know what n! is, and how many are implemented to > > demonstrate recursion (or to demonstrate the difference between > > iteration and recursion)? :) (I can't