On Sunday, 11 October 2009 02:24:34 Stephen Hansen wrote:
> It's really better all around for "modules" to be considered like
> libraries, that live over There, and aren't normally executed. Then you
> have scripts over Here which may just be tiny and import a module and call
> that module's "main
I wonder the reason for ELIF. it's not aligned with IF, make code ugly
IMHO
OR maybe better?
if foo == bar:
...
or foo == baz:
...
or foo == bra:
...
else:
...
--
http://mail.python.org/mailman/listinfo/python-list
On Saturday, 10 October 2009 22:15:21 kj wrote:
> I'm coaching a group of biologists on basic Python scripting. One
> of my charges mentioned that he had come across the advice never
> to use loops beginning with "while True". Of course, that's one
> way to start an infinite loop, but this seems
On Oct 10, 7:59 pm, gert wrote:
> http://code.google.com/p/appwsgi/source/browse/appwsgi/wsgi/order.wsgi
>
> I screwed up some sql statement
>
> INSERT INTO orders (pid,uid,bid,time) VALUES (?,?,2,DATETIME('NOW'))",
> (v['pid']),s.UID)
>
> bid does not exist anymore, but why does the KeyError exce
kj wrote:
I use "while True"-loops often, and intend to continue doing this
"while True",
Me too. Of course, in Python, 'while True' actually means 'while ^C not
pressed and window not closed and process not killed:',
whereas in old mainframe Fortran the equivalent might have meant 'while
How can I use Python to complete web form fields automatically? My
work web-based email time-out is like 15 seconds. Every time I need to
access my calendar, address book, or email, I have to type in my
username and password. I'm just tired of it.
I found the ClientForm module and have been workin
On Oct 10, 12:25 pm, omer azazi wrote:
> Sorry for not sending anything related to this group but it might be
> something new to you.
[198 lines deleted]
Reported to GMail admins for spam.
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 10, 2:26 am, niklasr wrote:
> On Oct 8, 10:17 pm, Carl Banks wrote:
>
>
>
> > On Oct 8, 3:11 pm, niklasr wrote:
>
> > > On Oct 8, 5:25 pm, "Diez B. Roggisch" wrote:
>
> > > > NiklasRTZ schrieb:
>
> > > > > Hello, my basic question is which recommendation is after slight
> > > > > restruc
On Sat, Oct 10, 2009 at 4:36 PM, Stef Mientki wrote:
> hello,
>
> I always thought code in a module was only executed once,
> but doesn't seem to be true.
>
This is one of the reasons why that whole big mess of a ton separate scripts
that all call each-other and are sometimes imported and sometim
Hey there,
I just noticed http://mail.python.org/pipermail/python-list/ is
lacking archives prior to December 2005. Is something broken? I see
Google search results from 2003, so it seems something has changed.
David.
--
http://mail.python.org/mailman/listinfo/python-list
Stef Mientki gmail.com> writes:
> Why is the B.py executed twice ?
Because it's executed once as a script and once as a module.
--
http://mail.python.org/mailman/listinfo/python-list
smi...@home.com wrote:
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "./setup.py", line 3, in
import sys, os, glob
ImportError: No module named os
I'm trying to build a small program and I get the above error.
I have had this error popup in the past w
http://code.google.com/p/appwsgi/source/browse/appwsgi/wsgi/order.wsgi
I screwed up some sql statement
INSERT INTO orders (pid,uid,bid,time) VALUES (?,?,2,DATETIME('NOW'))",
(v['pid']),s.UID)
bid does not exist anymore, but why does the KeyError exception occur
when only my sql statement is wron
On 2009-10-10, kj wrote:
> I use "while True"-loops often, and intend to continue doing this
> "while True", but I'm curious to know: how widespread is the
> injunction against such loops? Has it reached the status of
> "best practice"?
This trend is ironic; I remember in the structured-programm
hello,
I always thought code in a module was only executed once,
but doesn't seem to be true.
I'm using Python 2.5.
And this is the example:
== A.py ==
My_List = []
== B.py ==
from A import *
My_List.append ( 3 )
print 'B', My_List
import C
== C.py ==
from A import *
from B import *
print 'C
home.com> writes:
> I'm trying to build a small program and I get the above error.
> I have had this error popup in the past while trying to build other
> programs. What can I do?
You're python is apparently not finding the standard library.
--
http://mail.python.org/mailman/listinfo/python
Gabriel Genellina wrote:
En Sat, 10 Oct 2009 05:57:08 -0300, Steven D'Aprano
escribió:
On Fri, 09 Oct 2009 16:37:28 -0700, Buck wrote:
Here's a scenario. A user does a cvs checkout into some arbitrary
directory and sees this:
project/
+-- python/
+-- animals.py
+-- mammals/
On Oct 10, 6:13 pm, Chris Jones wrote:
> Hmm.. On *nix systems, decent applications understand the $EDITOR
> environment variable - don't know about gnome & friends, though.
>
I tend to write programs that understand EDITOR, BROWSER, etc; wish
the rest of the world did.
> So what does the inter
On Oct 9, 3:45 pm, Christian Heimes wrote:
> Laszlo Nagy wrote:
> > IMHO it is much cleaner to implement this as a decorator. Pro:
> > transparent passing of positional and keyword arguments, keeps function
> > documentation.
>
> You are entitled to your opinion but I STRONGLY recommend against yo
On Oct 10, 6:44 pm, Dave Angel wrote:
> Scott Grant wrote:
> > On Oct 10, 2:42 pm, "Diez B. Roggisch" wrote:
>
> >> Scott Grant schrieb:
>
> >>> Hi there,
>
> >>> I'd like to set up a framework in which I can add or remove new
> >>> classes of a given expected subclass to my package, and have the
Scott Grant wrote:
On Oct 10, 2:42 pm, "Diez B. Roggisch" wrote:
Scott Grant schrieb:
Hi there,
I'd like to set up a framework in which I can add or remove new
classes of a given expected subclass to my package, and have the
system load that set at runtime and be able to use
On Oct 10, 5:02�pm, kj wrote:
> In <01ccc46d-5ea9-4dfe-ba22-699c6b859...@v36g2000yqv.googlegroups.com>
> Mensanator writes:
>
>
>
>
>
> >On Oct 10, 3:15=EF=BF=BDpm, kj wrote:
> >> I'm coaching a group of biologists on basic Python scripting. =EF=BF=BDOn=
> >e
> >> of my charges mentioned that h
I have many times screwed up "while True"-loops. When I thought I had
a safe exit condition which turned out to be never reached in some
rare corner cases. Leading to weird bugs with hanging threads. I have
seen colleges screw up in the same way too. Often it is possible to
reformulate "while True"
On Oct 9, 11:46 pm, "Dr. Phillip M. Feldman"
wrote:
> I would like to put a statement on line N of my program that prints the line
> number that is currently executing.
inspect.currentframe().f_lineno
http://docs.python.org/library/inspect.html
--
http://mail.python.org/mailman/listinfo/python-
In <01ccc46d-5ea9-4dfe-ba22-699c6b859...@v36g2000yqv.googlegroups.com>
Mensanator writes:
>On Oct 10, 3:15=EF=BF=BDpm, kj wrote:
>> I'm coaching a group of biologists on basic Python scripting. =EF=BF=BDOn=
>e
>> of my charges mentioned that he had come across the advice never
>> to use loops b
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "./setup.py", line 3, in
import sys, os, glob
ImportError: No module named os
I'm trying to build a small program and I get the above error.
I have had this error popup in the past while trying to build othe
On Oct 10, 3:15�pm, kj wrote:
> I'm coaching a group of biologists on basic Python scripting. �One
> of my charges mentioned that he had come across the advice never
> to use loops beginning with "while True". �Of course, that's one
> way to start an infinite loop, but this seems hardly a sufficie
I agree there is no rap against "while True"-loops. As an example these are
very useful especially when receiving continuous data over a queue, pipe
socket, or over any other connection. You set to block, receive data,
then process data and finally loop around to wait for next data segment. O
>
> I use "while True"-loops often, and intend to continue doing this
> "while True", but I'm curious to know: how widespread is the
> injunction against such loops?
The injunction is nonexistent (save perhaps in people coming from another
language who insist that Python just /must/ have a "prope
I'm coaching a group of biologists on basic Python scripting. One
of my charges mentioned that he had come across the advice never
to use loops beginning with "while True". Of course, that's one
way to start an infinite loop, but this seems hardly a sufficient
reason to avoid the construct alt
In <0059c2b1$0$26930$c3e8...@news.astraweb.com> Steven D'Aprano
writes:
>But if you absolutely have to write to the program file...
No, don't have to, beyond the urge to satisfy a very idiosyncratic
aesthetic imperative...
>then append your
>data to the end of the file (as a comment) and late
On Oct 10, 2:42 pm, "Diez B. Roggisch" wrote:
> Scott Grant schrieb:
>
>
>
> > Hi there,
>
> > I'd like to set up a framework in which I can add or remove new
> > classes of a given expected subclass to my package, and have the
> > system load that set at runtime and be able to use them. In essen
Scott Grant schrieb:
Hi there,
I'd like to set up a framework in which I can add or remove new
classes of a given expected subclass to my package, and have the
system load that set at runtime and be able to use them. In essence,
if I have a class X, and subclasses A, B, and C that derive from X
Hi there,
I'd like to set up a framework in which I can add or remove new
classes of a given expected subclass to my package, and have the
system load that set at runtime and be able to use them. In essence,
if I have a class X, and subclasses A, B, and C that derive from X,
what's the most pytho
On Thu, Oct 08, 2009 at 12:59:00AM EDT, TerryP wrote:
> On Oct 8, 3:29 am, Chris Jones wrote:
[..]
> It's most valuable for sending data to an existing instance of vim, by
> name. Both files and keystrokes can be sent fwiw.
[..]
> On top of that, I sometimes group instances of vim into 'server
En Sat, 10 Oct 2009 05:57:08 -0300, Steven D'Aprano
escribió:
On Fri, 09 Oct 2009 16:37:28 -0700, Buck wrote:
Here's a scenario. A user does a cvs checkout into some arbitrary
directory and sees this:
project/
+-- python/
+-- animals.py
+-- mammals/
+-- horse.py
+-- o
En Sat, 10 Oct 2009 05:57:08 -0300, Steven D'Aprano
escribió:
On Fri, 09 Oct 2009 16:37:28 -0700, Buck wrote:
Here's a scenario. A user does a cvs checkout into some arbitrary
directory and sees this:
project/
+-- python/
+-- animals.py
+-- mammals/
+-- horse.py
+-- o
Benjamin Peterson wrote:
Helmut Jarausch skynet.be> writes:
As I said, it's 'make' in Python's source directory
(SVN revision 75309 Last Changed Date: 2009-10-10)
I can't reproduce your failure. What are the exact commands you are using?
CFLAGS='-O3 -mtune=native -msse2 -pipe' CXXFLAGS=$C
On Fri, Oct 9, 2009 at 1:11 AM, John Haggerty wrote:
> I am interested in seeing how it would be possible in python to have
> persistent objects (basically be able to save objects midway through a
> computation, etc) and do so across multiple computers.
>
> Something that would allow for memory, d
Helmut Jarausch skynet.be> writes:
> As I said, it's 'make' in Python's source directory
> (SVN revision 75309 Last Changed Date: 2009-10-10)
I can't reproduce your failure. What are the exact commands you are using?
--
http://mail.python.org/mailman/listinfo/python-list
Benjamin Peterson wrote:
Helmut Jarausch skynet.be> writes:
Hi,
I'm trying to build the recent Python-3.2a (SVN).
It fails in
Lib/tokenize.py (line 87)
How are you invoking it?
As I said, it's 'make' in Python's source directory
(SVN revision 75309 Last Changed Date: 2009-10-10)
If it
Helmut Jarausch skynet.be> writes:
>
> Hi,
>
> I'm trying to build the recent Python-3.2a (SVN).
> It fails in
> Lib/tokenize.py (line 87)
How are you invoking it?
--
http://mail.python.org/mailman/listinfo/python-list
in line responses...
On Thu, Oct 8, 2009 at 5:58 PM, Dennis Lee Bieber wrote:
> On Thu, 8 Oct 2009 10:38:02 -0500, Victor Subervi
> declaimed the following in
> gmane.comp.python.general:
>
>First suggestion... Get rid of the confusing dat[0] and dat[1] and
> use names that make sense...
Ah! Thanks :)
V
On Fri, Oct 9, 2009 at 1:10 PM, Stephen Hansen wrote:
>
>
> On Fri, Oct 9, 2009 at 11:04 AM, Victor Subervi
> wrote:
>
>> So, because the results in sstp were duplicates ( ['prescriptions',
>> 'prescriptions'] ) it only returned one result in the dict(zip()) statement.
>> Weird.
On Sep 23, 3:11 pm, kugutsumen wrote:
> Responsibilities:
>
> You will be part of a team responsible for implementing and supporting
> a Google App Engine based application.
>
> Requirements:
>
> Professional: University bachelor's degree in computer science or
> related discipline (web developmen
Hi,
I'm trying to build the recent Python-3.2a (SVN).
It fails in
Lib/tokenize.py (line 87)
85 def group(*choices): return '(' + '|'.join(choices) + ')'
86 def any(*choices): return group(*choices) + '*'
87 def maybe(*choices): return group(*choices) + '?'
with: TypeError: group() argument
>Ethan Furman wrote:
>> A puzzlement:
>>
>> I used easy_install the other day to get xlutils on my system. It
>> automatically installed xlrd and xlwt as well. This is cool. What's
>> not so cool are my tracebacks. E.g.
>>
>> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
On Oct 10, 8:54 am, Chris Rebert wrote:
> On Fri, Oct 9, 2009 at 8:46 PM, Dr. Phillip M. Feldman
>
> wrote:
>
> > I would like to put a statement on line N of my program that prints the line
> > number that is currently executing. This may sound fairly trivial, but I
> > don't want to hard code t
Christian Heimes wote:
Laszlo Nagy wrote:
IMHO it is much cleaner to implement this as a decorator. Pro:
transparent passing of positional and keyword arguments, keeps function
documentation.
You are entitled to your opinion but I STRONGLY recommend against your
decorator. You MUST NO
John Yeung wrote:
P.S. I hope people realize that the concise, intuitive, readable
answers we all tried in our first couple of (failed) attempts are much
more Pythonic than the beasts that were created just for SPOJ.
Well, it is not often that we need to micro optimize stuff (or how would you
Hello All,
I am new to python , and my aim is to use it to write sugar-based
applications on XO(OLPC). I am not new to programming in general, I would
want to know the best route to take in learning python. I have background in
FP and Imperative languages.
Regards,
Emeka
--
http://mail.python.or
Hi all,
After implementing a game server on which 100k people playing games
per-day, it turns out to be that continuous and efficient profiling is
key to improve an long-running applications like these. With this idea
in mind, I am motivated to write a profiler. I am not a Python expert
or even cl
Steven D'Aprano wrote:
...
> But if you absolutely have to write to the program file, then append your
> data to the end of the file (as a comment) and later read that, rather
> than modifying the actual code in place. That is, you fetch the
> LAST_VERSION by reading the last non-empty line in
Sorry about being interpreted as being vague.
You wasn't vague. I'm sorry!
`et me try to narrow it down. program a creates objects b c d which each need to
use 1 disk space 2 ram 3 processor time. I would like to create a checkpoint which
would save the work of the object to be later used a
On Oct 8, 8:33 pm, "Gabriel Genellina" wrote:
> En Thu, 08 Oct 2009 19:11:04 -0300, niklasr escribió:
>
> > On Oct 8, 5:25 pm, "Diez B. Roggisch" wrote:
> >> NiklasRTZ schrieb:
> >> > Hello, my basic question is which recommendation is after slight
> >> > restructuring datetime.datetime to datet
On 10 oct, 05:39, "bouncy...@gmail.com" wrote:
> Sorry about being interpreted as being vague. `et me try to narrow it down.
> program a creates objects b c d which each need to use 1 disk space 2 ram 3
> processor time. I would like to create a heckpoint which would save the work
> of the obje
On Oct 8, 10:17 pm, Carl Banks wrote:
> On Oct 8, 3:11 pm, niklasr wrote:
>
>
>
> > On Oct 8, 5:25 pm, "Diez B. Roggisch" wrote:
>
> > > NiklasRTZ schrieb:
>
> > > > Hello, my basic question is which recommendation is after slight
> > > > restructuring datetime.datetime to datetime
> > > > Both
On Oct 8, 7:34 pm, "Diez B. Roggisch" wrote:
> niklasr schrieb:
>
>
>
> > On Oct 8, 5:25 pm, "Diez B. Roggisch" wrote:
> >> NiklasRTZ schrieb:
>
> >>> Hello, my basic question is which recommendation is after slight
> >>> restructuring datetime.datetime to datetime
> >>> Both works but only one s
On 10 oct, 05:39, "bouncy...@gmail.com" wrote:
> Sorry about being interpreted as being vague. `et me try to narrow it down.
> program a creates objects b c d which each need to use 1 disk space 2 ram 3
> processor time. I would like to create a heckpoint which would save the work
> of the obje
On Oct 5, 5:16 pm, catafest wrote:
> On Sep 25, 12:41 pm, Hacken wrote:
>
> > I have write some python script
>
> > i want to use browser(IE or FF) to call it, an show the returns!
>
> > how to?
>
> Python script running under web browsers only like:
> python + website = django .
u can say that
On Fri, 09 Oct 2009 16:37:28 -0700, Buck wrote:
> Here's a scenario. A user does a cvs checkout into some arbitrary
> directory and sees this:
>
> project/
> +-- python/
> +-- animals.py
> +-- mammals/
> +-- horse.py
> +-- otter.py
> +-- reptiles/
> +-- gator.p
> Is there any python class to display the drive and folder structure as
> a tree(As you see in the windows explorer window)??
http://wiki.wxpython.org/TreeControls
S
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 09 Oct 2009 20:15:48 +0200, Stef Mientki wrote:
[...]
> The above code (with or without the stdout redirection), works perfect,
>
> ... the first time ...
> but does (almost?) nothing (doesn't crash, try / except around
> execfile), although the source file "self.Edit.Filename" has ch
On Fri, 09 Oct 2009 23:30:16 +, gb345 wrote:
> The following fragment is from a tiny maintenance script that, among
> other things, edits itself, by rewriting the line that ends with '###
> REPLACE'.
>
> ##
>
> import re
> i
64 matches
Mail list logo