Bengt Richter wrote:
So, e.g., for
>>> presets = dict(a=1, b=2, deftime=__import__('time').ctime())
in the decorator args, the next version will act as if the decorated
function had the source code
>>> print '%s = __frompresets__' % ', '.join(sorted(presets))
a, b, deftime = __frompresets__
for
On Sun, 23 Jan 2005 13:14:10 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>> On Sat, 22 Jan 2005 16:22:33 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
>>
>>
[Steven Bethard]
> If you really want locals that don't contribute to arguments, I'd be
> much happie
Chris Line wrote:
> When the 'stop' button is selected after 'count', it does
> not execute until the count command finishes at 500.
> Instead, it is desired to stop counting immediately and
> execute the 'stop' method.
>
> Is there a simple way to handle this situation?
calling self.update() at
Daniel Bickett wrote:
> You guys are just begging for a YHBT ;-)
Point taken :) I've noticed very few people even acknowledge his posts
at all; I'll follow the group lead and do the same.
Cheers!
- alex23
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Bickett wrote:
> Chris Mattern wrote:
> > alex23 wrote:
> >
> > > Having read your comments on women,
> >
> > I hadn't looked at that part of his site until now. I can only
say:
> > gah. Haven't seen something like that since Dave Sim's infamous
> > "Tangent" essay.
>
> It's painfully obvi
Mark Fanty <[EMAIL PROTECTED]> wrote:
> In perl, I might do (made up example just to illustrate the point):
>
> if(/add (\d+) (\d+)/) {
>do_add($1, $2);
> } elsif (/mult (\d+) (\d+)/) {
>do_mult($1,$2);
> } elsif(/help (\w+)/) {
>show_help($1);
> }
There was a thread about this r
On Wed, 19 Jan 2005 14:35:22 -0500, "GMane Python"
<[EMAIL PROTECTED]> wrote:
> Anyone know if there's a module which will allow me to 'create' windows
> printer definitions? Not from a Windows domain network, but just to add a
> printer that sends to a jet-direct-attached printer.
The easiest w
Peter Hansen wrote:
Daniel Bickett wrote:
Fredrik Lundh wrote:
oh, you mean that "python compiler" didn't mean "the python compiler".
[snip]
I simply inferred that he was using the wrong terminology, being that
he said "binary" twice ;-)
While I suspect you've guessed correctly at what the OP
mea
Fredrik Lundh wrote:
Daniel Bickett wrote:
I believe Sam was talking about "frozen" python scripts using tools
such as py2exe:
oh, you mean that "python compiler" didn't mean "the python compiler".
here are links to some more tools, btw:
http://effbot.org/zone/python-compile.htm
Thanks for th
Daniel Bickett wrote:
> [snip]
> You guys are just begging for a YHBT ;-)
I apologize, that should have been "we" -- I was criticizing him too.
no-one-wants-to-be-a-hypocrite-ly y'rs,
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
The application below has two buttons, 'count' and 'stop'.
When the 'stop' button is selected after 'count', it does not execute until the count command finishes at 500. Instead, it is desired to stop counting immediately and execute the 'stop' method.
Is there a simple way to handle this situ
Chris Mattern wrote:
> alex23 wrote:
>
> > Having read your comments on women,
>
> I hadn't looked at that part of his site until now. I can only say:
> gah. Haven't seen something like that since Dave Sim's infamous
> "Tangent" essay.
It's painfully obvious that it is all for the sole purpose
Hi
I am fairly new to Python threading and my needs are simple(!)
I want to establish a number of threads each of which work on the same
computationally intensive problem in different ways.
I am using the thread module rather than the threading module.
My problem is I can't see how (when one t
Andrew,
> Basically, I have two databases containing lists of postal addresses
and
> need to look for matching addresses in the two databases. More
> precisely, for each address in database A I want to find a single
> matching address in database B.
What percent of addresses in A have a unique co
torment wrote:
[snip]
Have you tried just parsing the output from the command "ipconfig"?
It's pretty obvious from the output that might give you if a connection
is availible.
It's tempting to use ipconfig's output, but the info it gives you is unreliable
- you can incorrectly infer the presence o
alex23 wrote:
> Having read your comments on women,
I hadn't looked at that part of his site until now. I can only say:
gah. Haven't seen something like that since Dave Sim's infamous
"Tangent" essay.
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir.
[EMAIL PROTECTED] wrote:
Thanks for the response. However, I continue to have problems. Allow me
to give some more detail.
For simplicity of testing, I hard coded the classpath and JVM path
(BTW getDefaultJVMPath() returns None on my system)
import os, os.path
from jpype import *
startJVM("C:/jdk1.
> the first paragraph of 9.1 "A Word About Terminology" is
> epitome of masturbation.
I'm tempted to concede this point to you given the sheer overwhelming
testament to onanism that is your website but this is just nonsense.
Defining terms is *always* necessary, it ensures that participants in
wha
> > Also, is this a good way to use variables in an insert/update
> > statement, or is there a better way?
> >
> > sql = "insert into test(a,b) values('%s','%s')" % (a,b)
> > cursor.execute(sql)
>
> If you do it like this:
>
> sql = "INSERT INTO test(a, b) VALUES(%s, %s)" # no quotes around the %
On Sun, 23 Jan 2005 21:00:25 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote:
> Peter Hansen wrote:
> > snacktime wrote:
> >> Is there a module that sets the parity of a string?
> >
> > As to the specific question: a module is not really required.
>
> But here's one for you anyway. It raises an exc
Peter Hansen wrote:
> snacktime wrote:
> > Is there a module that sets the parity of a string? I have an
> > application that needs to communicate with a host using even parity
> > So what I need is before sending the message, convert it from space
to
> > even parity. And when I get the respons
Georg Brandl wrote:
Hello,
to train my Python skills I am looking for some project I can contribute
to. I learned Python about one year ago, and had already some
programming background behind (I contributed to SharpDevelop for
instance), so I'm not the complete newbie.
About myself: I'm a 20 year o
Peter Hansen wrote:
snacktime wrote:
Is there a module that sets the parity of a string?
As to the specific question: a module is not really required.
But here's one for you anyway. It raises an exception if any
input character is non-ASCII, otherwise when you call set_parity()
with a string and
Anyone has any info if there's something similar to Newt lib for win32?
Thanks
Gabriel
--
http://mail.python.org/mailman/listinfo/python-list
Georg Brandl wrote:
Hello,
to train my Python skills I am looking for some project I can contribute
to. I learned Python about one year ago, and had already some
programming background behind (I contributed to SharpDevelop for
instance), so I'm not the complete newbie.
About myself: I'm a 20 year o
[Mike C. Fletcher]
> I'm looking at rewriting parts of Twisted and TwistedSNMP to eliminate
> __del__ methods (and the memory leaks they create).
A worthy goal!
> Looking at the docs for 2.3's weakref.ref, there's no mention of whether the
> callbacks are held with a strong reference.
A callback
snacktime wrote:
I'm used to using the perl DBI and not very familiar with the python
DB-API. I am using PyGreSQL. My question is what is the standard way
to quote strings in sql queries? I didn't see any quoting functions
in the DB-API docs. Is quoting handled internally by the PyGreSQL
module
In article <[EMAIL PROTECTED]>, John
Machin <[EMAIL PROTECTED]> writes
Andrew McLean wrote:
In case anyone is interested, here is the latest.
def insCost(tokenList, indx, pos):
"""The cost of inserting a specific token at a specific
normalised position along the sequence."""
if containsNu
Hi all,
I am seeking advice/help from those with more win32 experience than myself. I
am trying to build a proper win32 installer for IPython, after a user did most
of the hard work. For the most part, it's working very well, but I am running
into a nasty problem, which took me a few hours to fi
Bob Smith wrote:
To do this efficiently on a large file (dozens or hundreds of megs), you
should use the 'sizehint' parameter so as not to use too much memory:
sizehint = 0
mylist = f.readlines(sizehint)
It doesn't make any difference. .readlines reads the entire file into
memory at once.
--
E
[Francis Girard]
> ...
> In the meantime, I couldn't resist to test the new Python features about
> laziness on a classical FP problem, i.e. the "Hamming" problem.
...
> Nevertheless, while the Haskell version prints Hamming sequence for as long as
> I can stand it, and with very little memory cons
Lucas Raab wrote:
> Daniel Bickett wrote:
> >>Most texts in computing are written by authors to defend and showcase
> >>their existence against their peers.
> >
> >
> > When you aren't busy `showcasing' your ignorance, this is *all* i see
> > in everything you write.
>
>
>
> Um, maybe that was h
snacktime wrote:
Is there a module that sets the parity of a string? I have an
application that needs to communicate with a host using even parity
So what I need is before sending the message, convert it from space to
even parity. And when I get the response I need to convert that from
even to s
Alex Martelli wrote:
Mike C. Fletcher <[EMAIL PROTECTED]> wrote:
weakref.ref( self, self.close )
but the self.close reference in the instance is going away *before* the
object is called.
Uh -- what's holding on to this weakref.ref instance? I guess the
weakreference _itself_ is goin
Daniel Bickett wrote:
John Lenton wrote:
On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
Is there a reason that Google Groups isn't mirroring python-list
exactly like it used to, or is it simply a conspiracy I'm not in on?
You should not ask this kind of question in a public forum,
I'm used to using the perl DBI and not very familiar with the python
DB-API. I am using PyGreSQL. My question is what is the standard way
to quote strings in sql queries? I didn't see any quoting functions
in the DB-API docs. Is quoting handled internally by the PyGreSQL
module?
Also, is this
Erik Max Francis wrote:
Bob Smith wrote:
To do this efficiently on a large file (dozens or hundreds of megs),
you should use the 'sizehint' parameter so as not to use too much memory:
sizehint = 0
mylist = f.readlines(sizehint)
It doesn't make any difference. .readlines reads the entire file in
Daniel Bickett wrote:
Fredrik Lundh wrote:
oh, you mean that "python compiler" didn't mean "the python compiler".
[snip]
I simply inferred that he was using the wrong terminology, being that
he said "binary" twice ;-)
While I suspect you've guessed correctly at what the OP
meant, one should also co
Paul Rubin wrote:
If he understood how Python is actually used, he'd understand that any
C module is a lot more useful in the core than out of it.
This is non-sense. I have been distributing C modules outside
the core for quite some time now, and I found that the modules
are quite useful. distuti
Erik Max Francis wrote:
>> To do this efficiently on a large file (dozens or hundreds of megs), you
>> should use the
>> 'sizehint' parameter so as not to use too much memory:
>>
>> sizehint = 0
>> mylist = f.readlines(sizehint)
>
> It doesn't make any difference. .readlines reads the entire fi
On Sun, 23 Jan 2005 23:52:29 +0100, Fredrik Lundh
<[EMAIL PROTECTED]> wrote:
> "snacktime" wrote:
>
> > Is there a module that sets the parity of a string? I have an
> > application that needs to communicate with a host using even parity
> > So what I need is before sending the message, convert i
Michael Goettsche wrote:
I convinced my CS teacher to use Python in school. We currently have 2.2
installed on a Windows 2000 Terminal server. I asked the system administrator
to upgrade to Python 2.4, but he didn't succeed in doing it. He used the
microsoft installer package, which according to
Paul Rubin wrote:
There's tons of such examples, but python-dev apparently reached
consensus that the Python maintainers were less willing than the
maintainers of those other packages to deal with those issues.
As Andrew says, it is not apparent that there was consensus.
Martin, do you know more ab
Mike C. Fletcher <[EMAIL PROTECTED]> wrote:
> weakref.ref( self, self.close )
>
> but the self.close reference in the instance is going away *before* the
> object is called.
Uh -- what's holding on to this weakref.ref instance? I guess the
weakreference _itself_ is going away right afte
Andrew McLean wrote:
> In case anyone is interested, here is the latest.
> def insCost(tokenList, indx, pos):
> """The cost of inserting a specific token at a specific
normalised position along the sequence."""
> if containsNumber(tokenList[indx]):
> return INSERT_TOKEN_WITH_NUMBER
John Lenton wrote:
> > On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
> > >
> > > Is there a reason that Google Groups isn't mirroring python-list
> > > exactly like it used to, or is it simply a conspiracy I'm not in on?
> >
> > You should not ask this kind of question in a publi
"snacktime" wrote:
> Is there a module that sets the parity of a string? I have an
> application that needs to communicate with a host using even parity
> So what I need is before sending the message, convert it from space to
> even parity. And when I get the response I need to convert that from
I'm looking at rewriting parts of Twisted and TwistedSNMP to eliminate
__del__ methods (and the memory leaks they create). Looking at the docs
for 2.3's weakref.ref, there's no mention of whether the callbacks are
held with a strong reference. My experiments suggest they are not...
i.e. I'm
I have a similar problem. Here's what I do:
.def new_robot_named(name,indict=globals()):
. execstr = name + " = robot('" + name + "')"
. exec(execstr,indict)
.class robot(object):
. def __init__(self,name):
. self.name = name
. def sayhi(self):
. print "Hi! I'm %s!" % self.nam
Your formulation in Python is recursive (hamming calls hamming()) and I
think that's why your program gives up fairly early.
Instead, use itertools.tee() [new in Python 2.4, or search the internet
for an implementation that works in 2.3] to give a copy of the output
sequence to each "multiply by N
Leif K-Brooks wrote:
I'm writing a relatively simple multi-user public Web application with
Python. It's a rewrite of a similar application which used PHP+MySQL
(not particularly clean code, either). My opinions on various Web
frameworks tends to vary with the phase of the moon, but currently, I
Daniel Bickett wrote:
Most texts in computing are written by authors to defend and showcase
their existence against their peers.
When you aren't busy `showcasing' your ignorance, this is *all* i see
in everything you write.
Um, maybe that was his point...
--
http://mail.python.org/mailman/listinf
Fredrik Lundh wrote:
Tim Daneliuk wrote:
Thanks - very helpful. One followup - your re works as advertised. But
if I use: r'\[PROMPT:[^]].*\]' it seems not to. the '.*' instead of just '*'
it matches the entire string ...
it's not "just '*'", it's "[^]]*". it's the "^]" set (anything but ])
Is there a module that sets the parity of a string? I have an
application that needs to communicate with a host using even parity
So what I need is before sending the message, convert it from space to
even parity. And when I get the response I need to convert that from
even to space parity.
The
Frans Englich wrote:
The reason I thinks about this is I need to implement a debug print for my
program; very simple, a function/print statement that conditionally prints
its message whether a bool is true. Not overly complex.
Sounds like you want to override sys.stdout:
py> class ConditionalWrit
Hi,
First,
My deepest thanks to Craig Ringer, Alex Martelli, Nick Coghlan and Terry Reedy
for having generously answered on the "Need help on need help on generator"
thread. I'm compiling the answers to sketch myself a global pictures about
iterators, generators, iterator-generators and lazine
Thanks for the response. However, I continue to have problems. Allow me
to give some more detail.
For simplicity of testing, I hard coded the classpath and JVM path
(BTW getDefaultJVMPath() returns None on my system)
import os, os.path
from jpype import *
startJVM("C:/jdk1.5.0/jre/bin/client/jvm
Dear Python Colleague:
The PyCon Program Committee is happy to announce that
the opening keynote speech, at 9:30 am on Wednesday
March 23 will be:
Python on the .NET Platform, by
Jim Hugunin, Microsoft Corporation
Jim Hugunin is well-known in the Python world for his
pioneering work on
Nick Coghlan wrote:
It also directly addresses the question of aliasing. Think about how
Steven's modified dictionary would react to this code:
pete = CreateRobot(2, 3)
dad = pete
dad.move()
pete.move()
If you'd like to handle these cases, but you don't want to have to
explain aliasing right off
Frans Englich <[EMAIL PROTECTED]> writes:
> The reason I thinks about this is I need to implement a debug print for my
> program; very simple, a function/print statement that conditionally prints
> its message whether a bool is true. Not overly complex.
As several folks have said, print is a sta
På 23. jan 2005 kl. 21:55 skrev Nils Emil P.Larsen:
I connect to my server using SSH and then run 'python' to enter the
shell. I can't use the arrow buttons (up, down, left and right).
Instead I get this ^[[A , ^[[B, ^[[C or ^[[D.
Your Python installation is probably compiled without readline su
Hello
I'm not sure this is Python-related but it might be since Bash and vim
works perfectly.
I connect to my server using SSH and then run 'python' to enter the
shell. I can't use the arrow buttons (up, down, left and right).
Instead I get this ^[[A , ^[[B, ^[[C or ^[[D.
How do I get my arro
Roy Smith wrote:
>> So I wonder, what _is_ exactly the print statement? The untraditional way of
>> invoking it(without paranteses) makes me wonder.
>
> It's a statement, just like "write" in Fortran. When C came around, the
> idea of a language having no built-in print statement and having to
In case anyone is interested, here is the latest.
I implemented an edit distance technique based on tokens. This
incorporated a number of the ideas discussed in the thread.
It works pretty well on my data. I'm getting about 95% matching now,
compared with 90% for the simple technique I originall
Frans Englich <[EMAIL PROTECTED]> wrote:
> Nah, I don't think it's a function, but rather a builtin "statement". But
> it's possible to invoke it as an function; print( "test" ) works fine.
That's not calling it as a function. The parens in this case are simply
evaluated as grouping operators a
Michael Tobis wrote:
> I have a similar problem. Here's what I do:
>
> .def new_robot_named(name,indict=globals()):
> . execstr = name + " = robot('" + name + "')"
> . exec(execstr,indict)
>
> .class robot(object):
> . def __init__(self,name):
> . self.name = name
>
> . def sayhi(se
Michael Tobis wrote:
I have a similar problem. Here's what I do:
.def new_robot_named(name,indict=globals()):
. execstr = name + " = robot('" + name + "')"
. exec(execstr,indict)
.class robot(object):
. def __init__(self,name):
. self.name = name
. def sayhi(self):
. print "Hi! I
This is a summary of traffic on the `python-dev mailing list`_ from December
01, 2004 through December 15, 2004. It is intended to inform the wider Python
community of on-going developments on the list. To comment on anything
mentioned here, just post to `comp.lang.python`_ (or email
python-l
On Sat, Jan 22, 2005 at 01:54:17AM +0100, Uwe Mayer wrote:
> Any suggestions how I handle uninstallation? This was provided by automake
> rather mechanically. I didn't find a section on that in the distutils
> documentation... :(
I've been using distutils for a couple of projects I've written for
Hi !
Very more simplistic, but easy for to code :
def pi(nb):
cpi=0
for i in xrange(1,nb,4):
cpi=cpi+4./i-4./(i+2.)
return(cpi)
print pi(99)
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I am trying to sort how to best programmatically run the debugger on a
program, and another way that I am trying to explore is by using the
bdb module. There isn't any documentation for this and I have tried
reading through the source, which includes an example/test at the end
of bdb.py on
Orlando Vazquez wrote:
Tim Daneliuk wrote:
For some reason, I am having the hardest time doing something that should
be obvious. (Note time of posting ;)
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile
Patch / Bug Summary
___
Patches : 273 open ( +1) / 2746 closed ( +9) / 3019 total (+10)
Bugs: 797 open ( +4) / 4789 closed (+12) / 5586 total (+16)
RFE : 166 open ( +1) / 141 closed ( +0) / 307 total ( +1)
New / Reopened Patches
__
fix distu
Bengt Richter wrote:
On Sat, 22 Jan 2005 16:22:33 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
Steven Bethard wrote:
I wrote:
> If you really want locals that don't contribute to arguments, I'd be
> much happier with something like a decorator, e.g.[1]:
>
> @with_consts(i=1, deftime=time.ctime()
Hello,
to train my Python skills I am looking for some project I can contribute
to. I learned Python about one year ago, and had already some
programming background behind (I contributed to SharpDevelop for
instance), so I'm not the complete newbie.
About myself: I'm a 20 year old German with str
> On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
> >
> > Is there a reason that Google Groups isn't mirroring python-list
> > exactly like it used to, or is it simply a conspiracy I'm not in on?
>
> You should not ask this kind of question in a public forum,
and *you* should kno
Nick Coghlan wrote:
Steven Bethard wrote:
I wrote:
> If you really want locals that don't contribute to arguments, I'd be
> much happier with something like a decorator, e.g.[1]:
>
> @with_consts(i=1, deftime=time.ctime())
> def foo(x, y=123, *args, **kw):
>return x*y, kw.get('which_time'
Daniel Bickett wrote:
John Lenton wrote:
On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
Is there a reason that Google Groups isn't mirroring python-list
exactly like it used to, or is it simply a conspiracy I'm not in on?
You should not ask this kind of question in a public forum,
Ali Polatel wrote:
> write the code type str(pi(5)) and see what I mean
it helps if you post the code you want help with in your first post,
so people don't have to guess.
the pi function doesn't return anything, it prints the value to stdout
(that's what the stdout.write things are doing).
if
[Alan Kennedy]
>>So, I'm hoping that the learned folks here might be able to give me
>>some pointers to a markup language that has the following
>>characteristics
[Paul Rubin]
> I'm a bit biased but I've been using Texinfo for a long time and have
> been happy with it. It's reasonably lightweight
[Alan Kennedy]
>> From what I've seen, pretty much every textual markup targetted
>> for web content, e.g. wiki markup, seems to have grown/evolved
>> organically, meaning that it is either underpowered or overpowered,
>> full of special cases, doesn't have a meaningful object model, etc.
[Fredrik
I'm not sure if it's just me (or, indeed, just google groups), but my
"python-list" folder (label, that is) in my gmail account looks less
and less similar to Google Groups' comp.lang.python with each day.
Not only that, c.l.py has been acting rather strange. Example that
happened just now: Ali Po
write the code type str(pi(5)) and see what I mean__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
that's just little near to pi... pi is so far away ;)__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
Ali Polatel wrote:
> I found a code which calculates pi with an interesting algorithm the
> programme code is below:
> [code snipped]
> This code gives the number in an unusual format like "3.1415'None'" it has
> a number part and a string part.
are you sure?
$ python pi.py
How many d
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.pi
3.1415926535897931
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
Frans Englich wrote:
> I find this a nice solution. The most practical would be if it was possible to
> do this with print, of course. But print won't budge.
you can disable print, though:
class dev_null:
def write(self, text):
pass
sys.stdout = dev_null()
or pipe al
dear friends ,
I found a code which calculates pi with an interesting algorithm the programme code is below:
from sys import stdout
def f((q,r,t,k)): n = (3*q+r) / t if (4*q+r) / t == n: return (10*q,10*(r-n*t),t,k,n) else: return (q*k, q*(4*k+2)+r*(2*k+1),t*(2*k+1),k+1)
# C
On Sunday 23 January 2005 18:04, Michael Hoffman wrote:
> Frans Englich wrote:
[...]
> if command_line_debug_option:
> debug = _debug_true
> else
> debug = _debug_false
I find this a nice solution. The most practical would be if it was possible to
do this with print, of course. But prin
>> The reason I thinks about this is I need to implement a debug print for my
>> program; very simple, a function/print statement that conditionally prints
>> its message whether a bool is true. Not overly complex.
>>
>> I tried this by overshadowing the print keyword, but that obviously didn't
>>
Frans Englich wrote:
Nah, I don't think it's a function, but rather a builtin "statement". But it's
possible to invoke it as an function; print( "test" ) works fine.
That is not invoking it as a function. The parentheses are only for
ordering the expression on the right
You can do this too:
>>>
Frans Englich wrote:
> Nah, I don't think it's a function, but rather a builtin "statement". But it's
> possible to invoke it as an function; print( "test" ) works fine.
>
> So I wonder, what _is_ exactly the print statement? The untraditional way of
> invoking it(without paranteses) makes me wond
Nah, I don't think it's a function, but rather a builtin "statement". But it's
possible to invoke it as an function; print( "test" ) works fine.
So I wonder, what _is_ exactly the print statement? The untraditional way of
invoking it(without paranteses) makes me wonder.
The reason I thinks abo
Fredrik Lundh wrote:
Daniel Bickett wrote:
I believe Sam was talking about "frozen" python scripts using tools
such as py2exe:
oh, you mean that "python compiler" didn't mean "the python compiler".
I wouldn't assume a novice uses terms the same way you would. It was
quite clear from his message
Xah Lee wrote:
the first paragraph of 9.1 "A Word About Terminology" is epitome of
masturbation. The entire 9.1 is not necessary.
Large part of 9.2 "Python Scopes and Name Spaces" is again
masturbatory.
So I can just take a copy of the tutorial to the bathroom next time.
Thanks for the tip, man!
Daniel Bickett wrote:
> I believe Sam was talking about "frozen" python scripts using tools
> such as py2exe:
oh, you mean that "python compiler" didn't mean "the python compiler".
here are links to some more tools, btw:
http://effbot.org/zone/python-compile.htm
--
http://mail.python
what about something like this?
>>> import re
>>> m = re.match(r"""(?Padd|mult) (?P\d+)
(?P\d+)""", 'add 3 5')
>>> from operator import add, mul
>>> op = {'add': add, 'mult: mul}
>>> op[m.groupdict()['operator']](int(m.groupdict()['int_1']),
int(m.groupdict()['int_2']))
8
--
http://mail.python.or
QOTW: "XML with elementtree is what makes me never have [to] think about
XML again." -- Istvan Albert
"'Plays well with others' was a strong motivator for Python's design, and
that often means playing by others' rules." -- Tim Peters
Type mutability, and why some types are immutable. T
On Sat, 22 Jan 2005 10:03:27 -0800, aurora <[EMAIL PROTECTED]> wrote:
I am think more in the line of string.ljust(). So if we have a
list.ljust(length, filler), we can do something like
name, value = s.split('=',1).ljust(2,'')
I can always break it down into multiple lines. The good thing abo
rm wrote:
Paul Rubin wrote:
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes:
For those of you who don't know what YAML is: visit http://yaml.org/!
You will be amazed, and never think of XML again. Well, almost.
Oh please no, not another one of these. We really really don't need it.
well, I did lo
1 - 100 of 139 matches
Mail list logo