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
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
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
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
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
--
> >> 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
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
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
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
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
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
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
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
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 +
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
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
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
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
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
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
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
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
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
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
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
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
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>
> 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
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,
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
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 (
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
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 ""
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
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/
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."
>
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
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
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
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
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
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
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
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
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
> 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.
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
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
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
* 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
Are bug reports wanted here, or just in issue tracker?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
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
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.
>
>
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
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
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
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
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
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
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
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
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
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
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,
>
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
80 matches
Mail list logo