Tomasz Zielonka [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
Having to give functions a name places no ceiling on expressiveness,
any more than, say, having to give _macros_ a name.
And what about having to give numbers a name?
Excellent style, in most cases; I believe most sensible
Tomasz Zielonka [EMAIL PROTECTED] wrote:
...
higher level languages. There are useful programming techniques, like
monadic programming, that are infeasible without anonymous functions.
Anonymous functions really add some power to the language.
Can you give me one example that would be
Alex Martelli wrote:
Tomasz Zielonka [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
Having to give functions a name places no ceiling on expressiveness,
any more than, say, having to give _macros_ a name.
And what about having to give numbers a name?
Excellent style, in most cases; I
Ken Tilton wrote:
It is vastly more disappointing that an alleged tech genius would sniff
at the chance to take undeserved credit for PyCells, something probably
better than a similar project on which Adobe (your superiors at
software, right?) has bet the ranch. This is the Grail, dude,
Serge Orlov [EMAIL PROTECTED] writes:
Ken Tilton wrote:
It is vastly more disappointing that an alleged tech genius would sniff
at the chance to take undeserved credit for PyCells, something probably
better than a similar project on which Adobe (your superiors at
software, right?) has bet
Hey i have a stupid question.
How do i get python to print the result in only three decimal place...
Example round (2.9954254, 3)
2.9951
but i want to get rid of all trailing 0's..how would i do that?
_
Express
Tomasz Zielonka wrote:
On the other hand, what do you get by allowing ( as an indentifier?
Significant whitespace is a good thing, but the way it is designed in
Python it has some costs. Can't you simply acknowledge that?
One can admit this but what is it worth or how should those costs be
chun ping wang wrote:
Hey i have a stupid question.
How do i get python to print the result in only three decimal place...
Example round (2.9954254, 3)
2.9951
but i want to get rid of all trailing 0's..how would i do that?
Floating point arithmetic is inherently
Bill Atkins wrote:
Does Python have any support for closures? If so, ignore this point.
But if not, what about examples like this:
(defun make-window (window observer)
;; initialization code here
(add-handler window 'close
(lambda (event)
Bill Atkins wrote:
Serge Orlov [EMAIL PROTECTED] writes:
Ken Tilton wrote:
It is vastly more disappointing that an alleged tech genius would sniff
at the chance to take undeserved credit for PyCells, something probably
better than a similar project on which Adobe (your superiors at
I just thought it would be nice to have a standardized place to put the
accompanying documentation for Python site packages, and something like
a hook to register documentation so that all installed site packages can
install links to their documentation in the Python Documentation Index.
Are
Bill Atkins wrote:
Buh? The project doesn't have to be late for Brooks's law to hold;
adding programmers, so goes Brooks reasoning, will always increase the
time required to complete the project because of various communication
issues.
1. This is not what Brooks says. Brooks was talking
Thank you for your reply!
I finally managed to do what I wanted. Maybe a little side-remark here.
In the article you have said that all changes to the init-method are
lost once you regenerate the file. I have tried it, and indeed all my
changes were lost (which I had backed up before). So I've
On Sat, 06 May 2006 23:05:59 -0700, Alex Martelli wrote:
Tomasz Zielonka [EMAIL PROTECTED] wrote:
...
higher level languages. There are useful programming techniques, like
monadic programming, that are infeasible without anonymous functions.
Anonymous functions really add some power to the
Serge Orlov [EMAIL PROTECTED] writes:
Bill Atkins wrote:
Serge Orlov [EMAIL PROTECTED] writes:
Ken Tilton wrote:
It is vastly more disappointing that an alleged tech genius would sniff
at the chance to take undeserved credit for PyCells, something probably
better than a similar project
Alex Martelli wrote:
I cannot conceive of one. Wherever within a statement I could write the
expression
lambda args: body
I can *ALWAYS* obtain the identical effect by picking an otherwise
locally unused identifier X, writing the statement
def X(args): body
and using, as the
[EMAIL PROTECTED] writes:
Bill Atkins wrote:
Buh? The project doesn't have to be late for Brooks's law to hold;
adding programmers, so goes Brooks reasoning, will always increase the
time required to complete the project because of various communication
issues.
1. This is not what Brooks
Paul Rubin schreef:
a cryptographic PRNG seeded with good entropy is supposed to be
computationally indistinguishable from physical randomness
Doesn't your good entropy include physical randomness?
--
Affijn, Ruud
Gewoon is een tijger.
--
Bill Atkins wrote:
But why should I have to worry about any of this? Why can't I do:
(with-indentation (pdf (+ (indentation pdf) 4))
(out-header)
(out-facts))
and then within, say out-facts:
(with-indentation (pdf (+ (indentation pdf) 4))
(write pdf some text))
More
Bill Atkins wrote:
[snip]
Unfortunately, it's *nothing* like a full PyCell implementation. I
explained what Cells is above. It is not merely a spreadsheet - it is
an extension that allows the programmer to specify how the value of
some slot (Lisp lingo for member variable) can be computed.
[EMAIL PROTECTED] (Alex Martelli) writes:
In my opinion (and that of several others), the best way for Python to
grow in this regard would be to _lose_ lambda altogether, since named
functions are preferable
Why? I find the ability to create unnamed functions on the fly
to be a
Bill Atkins wrote:
[EMAIL PROTECTED] writes:
Bill Atkins wrote:
Buh? The project doesn't have to be late for Brooks's law to hold;
adding programmers, so goes Brooks reasoning, will always increase the
time required to complete the project because of various communication
issues.
1. This
Hi
I noticed that the md5 computed with md5 module from python is
different then the md5 sum computed with md5sum utility (on slackware
and gentoo).
i.e.
$echo marius|md5sum
0f0f60ac801a9eec2163083a22307deb -
test = md5.new(marius)
print test.hexdigest()
242aa1a97769109065e3b4df359bcfc9
Any
Patrick May wrote:
[EMAIL PROTECTED] (Alex Martelli) writes:
In my opinion (and that of several others), the best way for Python to
grow in this regard would be to _lose_ lambda altogether, since named
functions are preferable
Why? I find the ability to create unnamed functions on the
i've long time been interested in algorithmic mathematical art. That
is, mathematical or algorithmic visual art works that are generated by
computer such that the program's source code reflects the algorithmic
essence of the visual quality in the art work. (for detail, see
Algorithmic Mathematical
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I noticed that the md5 computed with md5 module from python is
different then the md5 sum computed with md5sum utility (on slackware
and gentoo).
i.e.
$echo marius|md5sum
0f0f60ac801a9eec2163083a22307deb -
test
[EMAIL PROTECTED] said the following on 07.05.2006 12:07:
Hi
I noticed that the md5 computed with md5 module from python is
different then the md5 sum computed with md5sum utility (on slackware
and gentoo).
i.e.
$echo marius|md5sum
0f0f60ac801a9eec2163083a22307deb -
test =
Chris Uppal [EMAIL PROTECTED] writes:
Bill Atkins wrote:
But why should I have to worry about any of this? Why can't I do:
(with-indentation (pdf (+ (indentation pdf) 4))
(out-header)
(out-facts))
and then within, say out-facts:
(with-indentation (pdf (+ (indentation
[EMAIL PROTECTED] writes:
Bill Atkins wrote:
[EMAIL PROTECTED] writes:
Bill Atkins wrote:
Buh? The project doesn't have to be late for Brooks's law to hold;
adding programmers, so goes Brooks reasoning, will always increase the
time required to complete the project because of various
Bill Atkins [EMAIL PROTECTED] writes:
There are still more! _On Lisp_ has a lot of interesting ones, like
an embedded Prolog interpreter and compiler:
(-- (father billsr billjr))
(?- (father billsr ?))
? = billjr
Actually, these might not be implemented as macros.
--
This is a
echo adds a newline:
import md5
test = md5.new(marius\n)
print test.hexdigest()
0f0f60ac801a9eec2163083a22307deb
Just
Thanks, that was it ;)
--
http://mail.python.org/mailman/listinfo/python-list
Ken Tilton [EMAIL PROTECTED] writes:
As for:
At a syntax-sugar
level, for example, Lisp's choice to use parentheses as delimiter means
it's undesirable, even unfeasible, to use the single character '(' as an
ordinary identifier in a future release of the language.
(defun |(|
[EMAIL PROTECTED] wrote:
As it is now,
one is pretty much left to rummage around on project web sites trying to get
a gut feel for what is going on. Asking the higher-ups at work to reach
technology management decisions based on my gut feel is an uphill climb.
So what you need is a document
Xah Lee wrote:
The one most prominent mention of it is in chapter 2 of the book
Structure and Interpretation of Computer Programs by Hal Abelson et al.
Thanks for the interesting book tip, it is available online:
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-15.html#%_sec_2.2.4
Petr Jakes wrote:
I think you can get the answer on
http://www.die-offenbachs.de/detlev/eric3-mailinglist.html
rather then here.
HTH
Petr Jakes
Thanks Petr, I've got help there.
To those interested, the problem was PyKDE was missing.
Best regards,
--
jagm
--
Jan Danielsson wrote:
I'm trying to use pygresql to insert binary data (type: bytea) into a
column (using postgresql, obviously).
...
Does _anyone_ have a working example? A simple insertion, and a
simple select is all I'm looking for.
You should better ask such questions on the
On May 7, 2006, at 4:24 AM, Aengys wrote:
Thank you for your reply!
I finally managed to do what I wanted. Maybe a little side-remark
here.
In the article you have said that all changes to the init-method are
lost once you regenerate the file. I have tried it, and indeed all my
changes
Erik Max Francis wrote:
chun ping wang wrote:
Hey i have a stupid question.
How do i get python to print the result in only three decimal place...
Example round (2.9954254, 3)
2.9951
but i want to get rid of all trailing 0's..how would i do that?
Floating
On Fri, May 05, 2006 at 05:02:57PM -0400, Eirikur Hallgrimsson wrote:
Okay, I've banged my head against this for about three days on and off.
The client's IP is passed to my handler in the non-threaded case.
It's not in the threaded case, which is actually rather different with a
couple of
On Fri, May 05, 2006 at 10:33:48PM +, Leo Breebaart wrote:
Trigger doctest.testmod() via a --test command-line option, is
what I'm thinking. But is that really the best way?
That is what I would have suggested.
-Chris
--
http://mail.python.org/mailman/listinfo/python-list
Serge Orlov wrote:
Ken Tilton wrote:
It is vastly more disappointing that an alleged tech genius would sniff
at the chance to take undeserved credit for PyCells, something probably
better than a similar project on which Adobe (your superiors at
software, right?) has bet the ranch. This is the
Hi !I need to get filelists from many HDD-s with more props. of files.I used FindFilesW to get these informations.But I have a problems with it.When I used Find_Data tuple, and it's atime,ctime,mtime props, I get wrong result.
I have hungarian Windows (XP), so little time diff. I have.These method
* Butternut squash (2006-05-06 16:55 +)
Rony Steelandt wrote:
We have a vacancy for a python programmer for a 6 months assignement.
If interested, please visit www.bucodi.com
And don't worry we speak english :)
seriously, a job opportunity in France?? I heard that the unemployment
On May 5, 2006, at 10:33 PM, Leo Breebaart wrote:
I have a simple question (I hope), but one I'd love to get some
feedback on in case I am missing something obvious:
If I have a Python script that is executable, and therefore
already uses '''if __name__ == __main__''' to call a function
of
Serge Orlov wrote:
Bill Atkins wrote:
Serge Orlov [EMAIL PROTECTED] writes:
Ken Tilton wrote:
It is vastly more disappointing that an alleged tech genius would sniff
at the chance to take undeserved credit for PyCells, something probably
better than a similar project on which Adobe (your
Andrew Robert wrote:
Hi everyone,
Hello,
Has anyone developed a pymqi module based file transfer method for use
with WebSphere MQSeries v5.3?
If so, would it be possible to point me towards examples of how this
was done?
I'm not sure I understand your question. Webshpere MQ expects
When used in a function call (as opposed to a function definition), *
is the unpacking operator. Basically, it flattens an iterable into
arguments. The docs mention it...
Cool, looks like I didn't read carefully enough.
Thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis [EMAIL PROTECTED] writes:
chun ping wang wrote:
Hey i have a stupid question.
How do i get python to print the result in only three decimal
place...
Example round (2.9954254, 3)
2.9951
but i want to get rid of all trailing 0's..how would i do
Thomas F. Burdick wrote:
Ken Tilton [EMAIL PROTECTED] writes:
As for:
At a syntax-sugar
level, for example, Lisp's choice to use parentheses as delimiter means
it's undesirable, even unfeasible, to use the single character '(' as an
ordinary identifier in a future release of the
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
because if I use this code
for i in alist:
print i
the result would be like this
1
2
5
10
15
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Gary Wessle wrote:
Hi
not sure if this would be the right place to ask this question!
using the shell prompt
:~$ python
Python 2.3.5 (#2, Mar 6 2006, 10:12:24)
[GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
Type help, copyright, credits or license for more information.
compboy wrote:
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
because if I use this code
for i in alist:
print i
the result would be like this
1
2
5
10
15
Thanks.
Well, first, if you just print alist you'll get
compboy wrote:
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
print ', '.join(alist)
1, 2, 5, 10, 15
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
compboy wrote:
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
because if I use this code
for i in alist:
print i
the result would be like this
1
2
5
10
15
Thanks.
There are a number of ways to
Ken Tilton wrote:
Serge Orlov wrote:
Ken Tilton wrote:
It is vastly more disappointing that an alleged tech genius would sniff
at the chance to take undeserved credit for PyCells, something probably
better than a similar project on which Adobe (your superiors at
software, right?)
On 7 May 2006 09:15:10 -0700, compboy [EMAIL PROTECTED] wrote:
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
because if I use this code
for i in alist:
print i
the result would be like this
1
2
5
10
15
[trimmed groups]
Ken Tilton [EMAIL PROTECTED] writes:
yes, but do not feel bad, everyone gets confused by the /analogy/ to
spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief
period I swore off the analogy because it was so invariably misunderstood.
Even Graham
Hi
is the Numerical Python tutorial maintained?
http://www.pfdubois.com/numpy/html2/numpy.html
seams to have some errors and no email to mail them to when found.
if interested, read about the errors below
(1)
I have another question where I am not so much looking for a
solution but rather hoping to get some feedback on *which*
solutions people here consider good Pythonic ways to approach a
issue.
The situation is this: I am writing fairly large console scripts
in Python. They have quite a few
Marius Ursache [EMAIL PROTECTED] writes:
import md5
test = md5.new(marius\n)
print test.hexdigest()
0f0f60ac801a9eec2163083a22307deb
Thanks, that was it ;)
Also, the -n option suppresses the newline from echo:
$ echo -n marius | md5sum
242aa1a97769109065e3b4df359bcfc9
On 2006-05-07 12:31:47 +0100, Frank Buss [EMAIL PROTECTED] said:
anyway, today i ran into this page by Frank Buß
http://www.frank-buss.de/lisp/functional.html
which used the idea in the book to render a traditional Escher's tiling
piece.
I should note that I've used the original paper from
[EMAIL PROTECTED] wrote:
Hi
I noticed that the md5 computed with md5 module from python is
different then the md5 sum computed with md5sum utility (on slackware
and gentoo).
i.e.
$echo marius|md5sum
0f0f60ac801a9eec2163083a22307deb -
test = md5.new(marius)
print test.hexdigest()
Hello!
this is the main error:
http://img406.imageshack.us/img406/5218/screenshotxchmerror1ae.png
navigation link images broken here:
http://img406.imageshack.us/img406/2822/screenshotxchmv12python24docum.png
when I first open up the docs, the main page and Global Module Index
links in the tree
Alexander Schmolck [EMAIL PROTECTED] writes:
[trimmed groups]
Ken Tilton [EMAIL PROTECTED] writes:
yes, but do not feel bad, everyone gets confused by the /analogy/ to
spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief
period I swore off the analogy because it was so
Bill Atkins [EMAIL PROTECTED] writes:
Alexander Schmolck [EMAIL PROTECTED] writes:
[trimmed groups]
Ken Tilton [EMAIL PROTECTED] writes:
yes, but do not feel bad, everyone gets confused by the /analogy/ to
spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief
period I
Xah Lee wrote:
i've long time been interested in algorithmic mathematical art. That
is, mathematical or algorithmic visual art works that are generated by
computer such that the program's source code reflects the algorithmic
essence of the visual quality in the art work. (for detail, see
John Salerno [EMAIL PROTECTED] writes:
Just a quick md5-related follow-up question: I was experimenting with
it and making md5 sums for strings, but how do you use the md5 module
to create a sum for an actual file, such as an .exe file?
m = md5.new()
f = file('foo.exe', 'b') # open in binary
[EMAIL PROTECTED] wrote:
...
Being able to keep pass around state with functions is useful.
I agree and Python supports this. What is interesting is how
counter-intuitive many programmers find this. For example, one of my
Funny: I have taught/mentored large number of people in Python,
[EMAIL PROTECTED] wrote:
...
2. There has to be a mechanism where an organization can add
developers - even if it is only for new projects. Python advocates
Obviously.
It's good that you agree. I think that the ability to add new
productive developers to a
Carl Friedrich Bolz [EMAIL PROTECTED] wrote:
...
an extension that allows the programmer to specify how the value of
some slot (Lisp lingo for member variable) can be computed. It
frees the programmer from having to recompute slot values since Cells
...
I have not looked at Cells at
Tomasz Zielonka [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
Tomasz Zielonka [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
Having to give functions a name places no ceiling on expressiveness,
any more than, say, having to give _macros_ a name.
And what about having to give
I V [EMAIL PROTECTED] wrote:
...
higher level languages. There are useful programming techniques, like
monadic programming, that are infeasible without anonymous functions.
Anonymous functions really add some power to the language.
Can you give me one example that would be feasible
Frank Buss [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
I cannot conceive of one. Wherever within a statement I could write the
expression
lambda args: body
I can *ALWAYS* obtain the identical effect by picking an otherwise
locally unused identifier X, writing the statement
[EMAIL PROTECTED] wrote:
Patrick May wrote:
[EMAIL PROTECTED] (Alex Martelli) writes:
In my opinion (and that of several others), the best way for Python to
grow in this regard would be to _lose_ lambda altogether, since named
functions are preferable
Why? I find the ability to
Xah Lee wrote:
i've long time been interested in algorithmic mathematical art. That
is, mathematical or algorithmic visual art works that are generated by
computer such that the program's source code reflects the algorithmic
essence of the visual quality in the art work. (for detail, see
[EMAIL PROTECTED] (Alex Martelli) writes:
I do hate it that
[ x for x in container if predicate(x) ]
is an exact synonym of the more legible
list( x for x in container if predicate(x) )
Heh, I hate it that it's NOT an exact synonym (the listcomp leaves 'x'
polluting the namespace and
Bill Atkins wrote:
[snip]
Here's how one of the cells examples might look in corrupted Python
(this is definitely not executable):
class FallingRock:
def __init__(self, pos):
define_slot( 'velocity', lambda: self.accel * self.elapsed )
define_slot( 'pos', lambda: self.accel *
Alex Martelli wrote:
Sorry, but I just don't see what lambda is buying you here. Taking just
one simple example from the first page you quote, you have:
(defun blank ()
a blank picture
(lambda (a b c)
(declare (ignore a b c))
'()))
You are right, for this example it is not
Paul Rubin http://[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Alex Martelli) writes:
I do hate it that
[ x for x in container if predicate(x) ]
is an exact synonym of the more legible
list( x for x in container if predicate(x) )
Heh, I hate it that it's NOT an exact synonym
Frank Buss [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
Sorry, but I just don't see what lambda is buying you here. Taking just
one simple example from the first page you quote, you have:
(defun blank ()
a blank picture
(lambda (a b c)
(declare (ignore a b c))
Alex Martelli wrote:
Steve R. Hastings [EMAIL PROTECTED] wrote:
...
But the key in the whole thread is simply that indentation will not
scale. Nor will Python.
This is a curious statement, given that Python is famous for scaling well.
I think ridiculous is a better
Alex Martelli wrote:
Not sure what the key means here, but omitting that
def black_white(function, limit):
def result(x,y):
if function(x, y) limit: return 1.0
else: return 0.0
return result
key is something like keyword arguments in Python. And looks like you
[EMAIL PROTECTED] (Alex Martelli) writes:
In my opinion (and that of several others), the best way for
Python to grow in this regard would be to _lose_ lambda
altogether, since named functions are preferable
Why? I find the ability to create unnamed functions on the
fly to be a
[EMAIL PROTECTED] writes:
Alex Martelli wrote:
Steve R. Hastings [EMAIL PROTECTED] wrote:
...
But the key in the whole thread is simply that indentation will not
scale. Nor will Python.
This is a curious statement, given that Python is famous for scaling well.
I think ridiculous
Gary Wessle wrote:
Hi
is the Numerical Python tutorial maintained?
http://www.pfdubois.com/numpy/html2/numpy.html
seams to have some errors and no email to mail them to when found.
No, it is not since Numeric itself is no longer maintained. The successor to
Numeric is numpy and is being
Bill Atkins [EMAIL PROTECTED] writes:
Here's how one of the cells examples might look in corrupted Python
(this is definitely not executable):
class FallingRock:
def __init__(self, pos):
define_slot( 'velocity', lambda: self.accel * self.elapsed )
define_slot( 'pos',
There are *NO* semantic advantages for named vs unnamed functions in Python.
I feel that this conversation has glanced off the point. Let me try a
new approach:
There is the Pythonic way (whatever that is), and then The Lisp Way. I
don't know what the former is, but it has something to do with
When I have done this, I've used the last option -- creating a config
module which can be imported wherever the configuration info is needed.
(This module also handles any config files and/or Windows registry
keys needed.) Using a Borg is a nice idea... but that ConfigBorg is
probably going to
[Followup-To: header set to comp.lang.functional.]
On 2006-05-07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
- it fits most programmers brains i.e. it is similar enough to
languages that most programmers have experience with and the
differences are usually perceived to
O/S: Windows XP Home
Vsn of Python: 2.4
Copy/paste of interactive window is immediately below; the
text/questions toward the bottom of this post will refer to the content
of the copy/paste
from elementtree import ElementTree
beforeRoot = ElementTree.Element('beforeRoot')
beforeCtag =
Leo Breebaart wrote:
I have another question where I am not so much looking for a
solution but rather hoping to get some feedback on *which*
solutions people here consider good Pythonic ways to approach a
issue.
The situation is this: I am writing fairly large console scripts
in Python.
Remote Python Call (RPyC) - transparent and symmetrical python RPC and
distributed computing library
download and info: http://rpyc.wikispaces.com
full changelog: http://rpyc.wikispaces.com/changelog
release notes: http://rpyc.wikispaces.com/release+notes
major changes:
* added isinstance and
[EMAIL PROTECTED] wrote:
Question 1: assuming the following:
a) beforeCtag.text gets assigned a value of 'I\x92m confused'
b) afterRoot is built using the XML() method where the input to the
XML() method is the results of a tostring() method from beforeRoot
Are there any settings/arguments
Tim Chase wrote:
compboy wrote:
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
print ', '.join(alist)
1, 2, 5, 10, 15
???
Python 2.4.2 (#1, Jan 23 2006, 21:24:54)
[GCC 3.3.4] on linux2
Type help, copyright,
[EMAIL PROTECTED] wrote:
O/S: Windows XP Home
Vsn of Python: 2.4
[snip fighting with unicode character U+2019 (RIGHT SINGLE QUOTATION
MARK) ]
I don't know what console you use but if it is IDLE you'll get confused
even more because it is buggy and improperly handles that character:
print
I don't know what I'm doing wrong, but the result is that _import_ only
works from a python shell, but not when I call a python script.
$ cat test.py
mod = __import__(/home/me/tests/test_imp)
Called from a script it does not work:
$ python /home/me/test.py
Traceback (most recent call last):
On Sun, 07 May 2006 18:16:22 -0400,
Mel Wilson [EMAIL PROTECTED] wrote:
Tim Chase wrote:
compboy wrote:
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
print ', '.join(alist)
1, 2, 5, 10, 15
???
Python
On 5/4/06, Tim Williams [EMAIL PROTECTED] wrote:
(and why do you
seem to think that this matters, btw ?)
I actually think it is complete twaddle, for the same reasons as you.
I think this article has something to do with this article:
http://www.paulgraham.com/submarine.html Maybe or
Paul Rubin wrote:
John Salerno [EMAIL PROTECTED] writes:
Just a quick md5-related follow-up question: I was experimenting with
it and making md5 sums for strings, but how do you use the md5 module
to create a sum for an actual file, such as an .exe file?
m = md5.new()
f = file('foo.exe',
John Salerno [EMAIL PROTECTED] writes:
Any reason you can't just read the whole file at once and update m?
Yes, you could say
print md5.new(file('foo.exe').read()).hexdigest()
but that means reading the whole file into memory at once. If the
file is very large, that could thrash or fail.
1 - 100 of 145 matches
Mail list logo