I would agree with the author, pyExcelerator is good at writing Excel
but xlrd is better at reading. I was recently forced to use them in
tandem because pyExcelerator had problems reading an Excel sheet and
xlrd had no problems.
greetings,
Richard Sharp
John Machin wrote:
> On 23/03/2006 9:01 AM
In article <[EMAIL PROTECTED]>,
"Carl Banks" <[EMAIL PROTECTED]> wrote:
> Ben Finney wrote:
> > "DataSmash" <[EMAIL PROTECTED]> writes:
> > > * random.py:
> > >
> > > import random
> >
> > Now that you've tripped over this ambiguity of Python's current
> > 'import' behaviour, you may be intereste
where is this code looking for the .imap file? I am on OSX and am not
sure where to put the file it is looking for.
f = open(os.path.expanduser('~/.imap'))
--
http://mail.python.org/mailman/listinfo/python-list
Donn Cave wrote:
>
> Anyway, it seems unlikely he would get that INVARG error for this
> reason. That's an error from the host operating system, not the
> interpreter, and it mostly likely refers to the file descriptor.
> Since it works for me, I guess his problem is basically this:
>
> |> (pyt
I have a code that opens an .imap file in os.path.expanduser.
Unfortunately, I am on OS X and have no idea where that directory is.
I am wondering how I can change this code to just open the .imap file in
the directory where the code is saved.
f = open(os.path.expanduser('~/.imap'))
p.s.
"EdWhyatt" <[EMAIL PROTECTED]> wrote:
>
>Ok, totally unrelated, and on that subject, I will make sure I always
>have a recipient in the To: field. - hey it works if I do that anyway!
OK, I'm a bit concerned that the answer to the original question has been
lost. The difference between the SMTP en
Kevin F wrote:
> where is this code looking for the .imap file? I am on OSX and am not
> sure where to put the file it is looking for.
>
> f = open(os.path.expanduser('~/.imap'))
Your interactive interpreter has the answer
>>> import os
>>> os.path.expanduser("~")
'/home/peter'
that will
"dongdong" <[EMAIL PROTECTED]> wrote:
>
>using web browser can get page's content formally, but when use
>urllib2.open("http://tech.163.com/2004w11/12732/2004w11_1100059465339.html";).read()
>
>the result is
>
>CONTENT="0;URL=http://tech.163.com/04/1110/12/14QUR2BR0009159H.html";>
>content="no-cach
Peter Otten wrote:
> Kevin F wrote:
>
>> where is this code looking for the .imap file? I am on OSX and am not
>> sure where to put the file it is looking for.
>>
>> f = open(os.path.expanduser('~/.imap'))
>
> Your interactive interpreter has the answer
>
import os
os.path.expandu
Michael Spencer wrote:
> Bruno Desthuilliers wrote:
>
(snip)
>
>> BTW, there may be other use case for per-instance descriptors...
>
>
> Agreed. Per-instance descriptors could be interesting (that's why the
> subject line caught my attention).
> But your solution involves a custom __getattrib
I've been trying to implement this script, it polls an IMAP inbox for
unread messages and displays the sender and subject in a scrollable
window using Tkinter. However, when I try to change the search
parameters on line 55 from 'unread' (UNSEEN) to 'read' (SEEN), the
tkinter window doesn't eve
Thank you Serge for this generous reply,
Vectorized code seems a great choice to compute the distance. If I
understand well, vectorized code can only work when you don't need to
access the values of the array, but only need to know the indices. This
works well for the distance, but I need to acces
Steven Bethard wrote:
> bruno at modulix wrote:
>
>> Hi
>>
>> I'm currently playing with some (possibly weird...) code, and I'd have a
>> use for per-instance descriptors,
(snip)
>>
>> class MyClass2(MyClass1):
>> def __getattribute__(self, key):
>> v = MyClass1.__getattribute__(self
David Isaac wrote:
> 1. "Without a __dict__ variable,
> instances cannot be assigned new variables not listed in the __slots__
> definition."
>
> So this seemed an interesting restriction to impose in some instances,
> but I've noticed that this behavior is being called by some a side effect
> the
Hi all,
sorry if it isn't the right group (and sorry for the cross post, but
it's a cross- question :P ), but i'm not sure where to post. I have a
python library and i want to be able to call it from smalltalk (the
squeak implementation in particular..). I was just wondering if there
is a standar
I got a piece of python script to upload file and it can upload it to
different folders on server depend on the type of file is image or not.
but I also want to restrict the size and dimensions of file if it is a
image file.Could anyone help me out?
Parameter List:id, file, title='',folder
REQUE
Hi,
I think I have discovered a problem in context of
metaclasses and multiple inheritance in python 2.4,
which I could finally reduce to a simple example:
Look at following code:
class M_A (type) :
def __new__ (meta, name, bases, dict) :
print "M.__new__", meta, name, bases
[EMAIL PROTECTED] wrote:
> I got a piece of python script to upload file and it can upload it to
> different folders on server depend on the type of file is image or not.
> but I also want to restrict the size and dimensions of file if it is a
> image file.Could anyone help me out?
Use PIL, the
Hello,
The solution that would have the most utility would be one where the
elements are generated one-by-one, loop-like, so that they can be used
in the body of a loop, and to avoid the fact that even with exclusion
the cardinality of the target set EX^n could be in the millions even
with a full
Although I think it's worth reading, it only covers the fundamental
structure (what arrays are, what ufuncs are..) of NumPy. Neither of the
functions dicussed in this thread (polyfit/linear_least_squares) is
mentioned in the file.
--
http://mail.python.org/mailman/listinfo/python-list
Dirk Thierbach wrote:
> If more time during preprocessing is allowed, another idea is to
> treat the wildcard expressions as regular expressions, convert
> each into a finite state machine, construct the "intersection" of
> all these state machines, minimize it and then swap final and non-final
> s
dongdong wrote:
> using web browser can get page's content formally, but when use
>
urllib2.open("http://tech.163.com/2004w11/12732/2004w11_1100059465339.html";).read()
>
> the result is
>
> CONTENT="0;URL=http://tech.163.com/04/1110/12/14QUR2BR0009159H.html";>
> content="no-cache">?y?ú'ò?aò3?
Thank you for your reply. I have been learning python only 2 weeks.
According what u said. I tried to import Image but there 's an error
on the server.
here is the message
Error Type: ImportError
Error Value: import of "Image" is unauthorized
--
http://mail.python.org/mailman/listinfo/python-lis
Dennis Lee Bieber:
>Raymond Hettinger:
>> Because of the GIL, thread pools are not as useful in Python as you
>> might expect -- they execute one at a time and do not take advantage of
>> hyper-threading or multiple processors. If that kind of efficiency is
>
> If the task is I/O bound (some
ChengGong wrote:
> Thank you for your reply. I have been learning python only 2 weeks.
> According what u said. I tried to import Image but there 's an error
> on the server.
> here is the message
> Error Type: ImportError
> Error Value: import of "Image" is unauthorized
Are you by chance runnin
Sorry to have caused all that confusion. The quote from RFC822 I gave
is really confusing and is indeed not relevant to the original
question. As Tim pointed out, the "to_addrs" parameter in
smtplib.py::sendmail is translated to the SMTP RCPT TO and thus must
contain all the intended recipients whe
oh~~~! offer my thanks to Tim Roberts and all persons above!
I see now, it's the different url causes!
contents can only be got from the later (real ) url.
I made a mistick not to look at the different urls taking effect.
--
http://mail.python.org/mailman/listinfo/python-list
The traditional right way (tm) to do this is to call getsockname() on
the (a?) socket that's connected to the guy you want to tell your
address to. This picks the right address in case you have several. If
you don't have a socket handy, you can make a connectionless UDP
socket and connect() it to a
Diez,
I asked the administrator that they won't allow me to import Image and
PIL in Zope.
I am wondering that how can I get the height and width and the size of
the image in this situation?
Can I just use to get Image's addtributs?
Cheng
--
http://mail.python.org/mailman/listinfo/python-list
is there any lib to help to clear the absolute url in a html file? for
example, 'http://www.sina.com/' should be clear ,but "/image/asd.gif"
should be reserved.
--
http://mail.python.org/mailman/listinfo/python-list
On behalf of the Python development team and the Python
community, I'm happy to announce the release of Python 2.4.3
(release candidate 1).
Python 2.4.3 is a bug-fix release. See the release notes at
the website (also available as Misc/NEWS in the source
distribution) for details of the more t
ChengGong wrote:
> Diez,
>
> I asked the administrator that they won't allow me to import Image and
> PIL in Zope.
> I am wondering that how can I get the height and width and the size of
> the image in this situation?
> Can I just use to get Image's addtributs?
No. At least not easily. You'd ha
dongdong wrote:
> is there any lib to help to clear the absolute url in a html file? for
> example, 'http://www.sina.com/' should be clear ,but "/image/asd.gif"
> should be reserved.
Built-in string-manipulation is your friend:
"abcdef/ghi".replace("abcdef", "")
Diez
--
http://mail.python.org
That man is a genius:
>>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>>> s.connect(("gmail.com",80))
>>> print s.getsockname()
('192.168.0.174', 2768)
>>> s.close()
Should work on Windows as well.
--
http://mail.python.org/mailman/listinfo/python-list
I wrote a jython class bus I can not use it in another jython script
:-(
Example:
-- X.py--
class X:
def hello():
print "Hello"
-- Y.py--
import X
x = X()
x.hello()
I get TypeError: call of non function (module 'X
to Diez B. Roggisch :
no, I won't to use this way, its efficiency is very low as I need to
replace all the 'http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I wrote a jython class bus I can not use it in another jython script
> :-(
> Example:
> -- X.py--
> class X:
> def hello():
> print "Hello"
>
>
> -- Y.py--
> import X
> x = X()
> x.hello()
Hi!
Is there something I can do in PIL to restrict a line to a certain size and
have it to break/wrap into a newline automatically? (Or by using some code, of
course...)
I'm trying to add information to barcodes and since the label space is fixed
I'd like to use all the horizontal space I can
Alle 22:14, mercoledì 22 marzo 2006, Sybren Stuvel ha scritto:
> different partitions might have, though. Then again, it all depends on
> the filesystems in use.
Then I should make some extra programming to catch these info, according to
which OS will run it :-(
Regarding the names, CDROMs DVD ha
On Mar 20, 2006, at 9:51 PM, Alex Martelli wrote:
> While what *I* want, ideally, is pair programming -- somebody sitting
> right at my side, alternating with me in controlling keyboard and
> mouse,
> and in verbalizing what he or she is coding -- that's part of the huge
> productivity boost I o
Hi All,
I am creating a python package that contains a whole pile of functions
that build lookup tables. Since these lookup tables will not be
changing, I would like to have setup.py create a lut_static.py fie from
the lookup table code (lut.py). What is the best way to do this so
that when I in
[EMAIL PROTECTED] schreef:
> The solution that would have the most utility would be one where the
> elements are generated one-by-one, loop-like, so that they can be used
> in the body of a loop, and to avoid the fact that even with exclusion
> the cardinality of the target set EX^n could be in th
[EMAIL PROTECTED] wrote:
>I wrote a jython class bus I can not use it in another jython script
> :-(
> Example:
> -- X.py--
> class X:
> def hello():
> print "Hello"
>
>
> -- Y.py--
> import X
> x = X()
> x.hello()
>
>
Martin P. Hellwig <[EMAIL PROTECTED]> wrote:
>std_out, std_in = popen2.popen2("F:\coding\pwSync\popen_test\testia.py")
^^
Your problem is, I suspect, nothing to do with popen2(), which is
supported by the fact that the only thing other th
Thanks Frank. It works :_)
--
http://mail.python.org/mailman/listinfo/python-list
>>What went wrong...
Operator Error. My appologies. If typed in correctly the example works
perfectly. I was using the PythonWin shell and when I started to type
in it suggested CDispatch and I typed that in. I will be looking to
pick up a copy of the book if I continue to use Python. I still do no
Jorge Godoy wrote:
> Is there something I can do in PIL to restrict a line to a certain size and
> have it to break/wrap into a newline automatically? (Or by using some
> code, of course...)
there's no standard function for this purpose, no.
here's a somewhat rough implementation, based on a WCK
<[EMAIL PROTECTED]> wrote:
>Diez> Sion Arrowsmith wrote:
>>> I've got an established client-server application here where there
>>> is now a need to shovel huge amounts of data (structured as lists of
>>> lists) between the two, and the performance bottleneck has become
>>> the
Sion Arrowsmith wrote:
"F:\coding\pwSync\popen_test\testia.py"
> 'F:\\coding\\pwSync\\popen_test\testia.py'
this might make it more obvious that something's not quite right with that
string literal:
>>> print "F:\coding\pwSync\popen_test\testia.py"
F:\coding\pwSync\popen_test es
[EMAIL PROTECTED] wrote:
> Why not
>
> dt = datetime.datetime(*time.strptime(s, "%Y-%m-%dT%H:%M:%S")[0:6])
>
> ?
Maybe due to neglection of the 7th commandment?
Most of the other commandments can be ignored while
coding Python, but the 7th certainly applies here.
http://www.lysator.liu.se/c
dongdong wrote:
> to Diez B. Roggisch :
> no, I won't to use this way, its efficiency is very low as I need to
> replace all the 'http://mail.python.org/mailman/listinfo/python-list
"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> Jorge Godoy wrote:
>> Is there something I can do in PIL to restrict a line to a certain size and
>> have it to break/wrap into a newline automatically? (Or by using some
>> code, of course...)
>
> there's no standard function for this purpose, no.
>
Jorge Godoy <[EMAIL PROTECTED]> writes:
> Then I'd have to have some means to determine the width of the char (I'm using
> a TrueType font due to my need of using Unicode text) to calculate how many
> words I can put on a single line...
Hmmm... It looks like your code does that! Thanks! I'll
Hi all,
Background:
I need some help. I am trying to streamline a process for one of our
technical writers. He is using Perforce (version control system), and
is constantly changing his word documents, and then converts them to
both .pdf and "Web page" format (to publish to the web). He has a
l
Hi Diez,
They do not allow me to do what u said above.
so I do not have any idea what is supposed to do.
however i am think that if I can get the id of the image, i have chance
to modify it.
This is what i programed but it is an empty page, I but it in images
folder
File Library
File
Hi Lev,
Sounds interesting. As I am quite new to Python an example program
would be most welcome. My email address is contained in the message.
Best,
rod
--
http://mail.python.org/mailman/listinfo/python-list
Is that because I can not import PIL ? then i can not use codes above
to show all image id?
--
http://mail.python.org/mailman/listinfo/python-list
Christian Eder wrote:
> Hi,
>
> I think I have discovered a problem in context of
> metaclasses and multiple inheritance in python 2.4,
> which I could finally reduce to a simple example:
I don't know if this is a bug; but I will try to expain
what is happening; here is an example similar to yours
Sybren Stuvel <[EMAIL PROTECTED]> wrote:
>Paraic Gallagher enlightened us with:
>> While I agree in principal to your opinion, the idea is that an
>> absolute moron would be able to configure a testcell with smallest
>> amount of effort possible.
>Then explain to me why learning how to use your pr
<[EMAIL PROTECTED]> wrote:
>Steve> I suppose there *was* a good reason for using XML-RPC in the
>Steve> first place?
>I don't know about the OP, but in my case it was a drop-dead simple
>cross-language RPC protocol.
I am the OP and *I* don't know if there was a good reason for using
XML-R
Hi Dennis,
Thanks for your effort. I really appreciate it. It works for me
now.
Ouyang
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Im using py2exe to convert my python scripts to .exe. Im trying to get
my scripts and .exes to only run (utilize full CPU) when my PC is idle
(kinda like [EMAIL PROTECTED]).
Do i only need to modify GIL parameters or is there more to acomplishing
this?
Thanks
--
http://mail.python.org/mail
what is the definition of sub-functions in the hotshot profiler? and just
as important what is not sub-functions
from the output I can see that functions I made and functions in
/usr/lib/python2.4/textwrap.py is considered sub-functions, but I call a
lot of other functions in the python library an
Ziga Seilnacht wrote:
> - Since D does not have a __metaclass__ attribute,
>its type is determined from its bases.
> - Since A is the first base, its type (M_A) is called;
>unfortunately this is not the way metaclasses are
>supposed to work; the most derived metaclass should
>be s
Robert Kern wrote:
> Tommy Grav wrote:
>
>>This might not be the venue to ask this but I do not know where else to
>>turn.
>>I am trying to install a package that is swig'ed from some C code.
>>Unfortunately the readme file isn't to informative. Does anyone
>>know which libraries to link to to
I made some mistake in my codes, so there was a window with a text field
appeared. But before I could read the message in the text field, the
window disappeared. So I can't figure out what's the problem with my codes.
What should I do to make the message window last a little longer?
Thank you.
--
On 2006-03-23, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> is it possible to remove a file by it's inode and not it's filename
> using Python?
What do you mean "remove a file"?
--
Grant Edwards grante Yow! Life is a POPULARITY
I wrote a script which uses OpenOffice. It can
convert and read a lot of formats.
#!/usr/bin/env python
#Old: !/optlocal/OpenOffice.org/program/python
# (c) 2003-2006 Thomas Guettler http://www.tbz-pariv.de/
# OpenOffice1.1 comes with its own python interpreter.
# This Script needs to be run with
Hi,
is there any way to specify the path to modules within import statement
(like in Java)?
For instance: "import my.path.module" would load module from
./my/path/module.py?
Thx,
A.
--
http://mail.python.org/mailman/listinfo/python-list
Christian Eder wrote:
> Hi,
>
> I think I have discovered a problem in context of
> metaclasses and multiple inheritance in python 2.4,
> which I could finally reduce to a simple example:
>
> Look at following code:
>
> class M_A (type) :
>
> def __new__ (meta, name, bases, dict) :
> p
hi i'am making a program for formatting string,
or
i've added :
#!/usr/bin/python
# -*- coding: utf-8 -*-
in the begining of my script but
str = str.replace('Ç', 'C')
str = str.replace('é', 'E')
str = str.replace('É', 'E')
str = str.replace('è', 'E')
str = str.rep
Ziga Seilnacht wrote:
> I hope that above explanation helps.
>
Thanks for your support.
I now understand what happens here,
but I'm not really happy with the situation.
Your solution is a nice workaround, but in a quite
huge and complex class framework with a lot a custom
metaclasses you don't
kbperry wrote:
> Hi all,
>
> Background:
> I need some help. I am trying to streamline a process for one of our
> technical writers. He is using Perforce (version control system), and
> is constantly changing his word documents, and then converts them to
> both .pdf and "Web page" format (to pu
Sion Arrowsmith enlightened us with:
> You're assuming that the tester is already familiar with a text
> editor.
Indeed. Someone working on a test suite sounded like someone who knows
how to work with a text editor.
> And then they would have to learn the syntax of the configuration
> file, and t
>For instance: "import my.path.module" would load module from
>./my/path/module.py?
Yeah, just do that. I don't understand the question, it works just like
this today.
--
http://mail.python.org/mailman/listinfo/python-list
Kenneth Xie wrote:
> I made some mistake in my codes, so there was a window with a text field
> appeared. But before I could read the message in the text field, the
> window disappeared. So I can't figure out what's the problem with my codes.
> What should I do to make the message window last a lit
Hi there i am hoping some one could help me out with a small problem
i am in the process of learning python. I am trying
to write an interactive programme,
This is a short example.
if s = raw_input
("hello what’s your name? ")
if s=='carmel':
print "Ahh the boss’s
wife"
What i would lik
As an example, let's say you have a main module at /usr/code/Main.py
and you have a module you'd like to import at /usr/code/util/Util.py,
you can do this:
import util.Util
If you are using PyDev and Eclipse to develop your Python code, you can
set the base directory to reference module imports f
Maybe he means: sys.path.append('/my/path')
--
http://mail.python.org/mailman/listinfo/python-list
Python has a new logo!
See http://python.org/
And it is a fantastic logo.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Em Qui, 2006-03-23 às 07:43 -0800, Xah Lee escreveu:
> Python has a new logo!
Really? :)
> See http://python.org/
>
> And it is a fantastic logo.
LOL, sorry for the trolling, but we already had loads of (good)
discussions about it some time ago...
--
Felipe.
--
http://mail.python.org/mailma
Good answer. :) I seriously doubt it is possible except for the
trivial solution:
def remove_a_file(inode):
os.system ("find / -inum %d | xargs rm -f" % (inode))
PS. Don't blame me if this function destroys your hard disk. I wrote it
off the top of my head.
--
http://mail.python.org/mailm
Thanks for the replys!
I need to stick with Word (not my choice, but I would rather keep
everything like he has it).
Duncan,
I was just trying the printing thing. When installing Adobe Acrobat,
it installs a printer called "Adobe PDF," and I have been trying to
print to there, but the "Save" win
bussiere bussiere wrote:
> hi i'am making a program for formatting string,
> i've added :
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
> in the begining of my script but
>
> str = str.replace('Ç', 'C')
> ...
> doesn't work it put me " and , instead of remplacing é by E
Are your sure your scr
Dinko Tenev <[EMAIL PROTECTED]> wrote:
> Dirk Thierbach wrote:
>> If more time during preprocessing is allowed, another idea is to
>> treat the wildcard expressions as regular expressions, convert
>> each into a finite state machine, construct the "intersection" of
>> all these state machines, mini
Perhaps this is what he means:
re.sub("http://[^/]*/","/","http://palle.fi/wing/walla.htm";)
'/wing/walla.htm'
--
http://mail.python.org/mailman/listinfo/python-list
is there larger versions of the logo?
and, any usage restrictions?
i also like to find out the the artist name. Any pointer is
appreciated. Thanks.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Felipe Almeida Lessa wrote:
> Em Qui, 2006-03-23 às 07:43 -0800, Xah Lee escreveu:
> > Python has
Seems to work fine for me.
>>> x="éÇ"
>>> x=x.replace('é','E')
'E\xc7'
>>> x=x.replace('Ç','C')
>>> x
'E\xc7'
>>> x=x.replace('Ç','C')
>>> x
'EC'
You should also be able to use .upper() method to
uppercase everything in the string in a single statement:
tstr=ligneA.upper()
Note: you should neve
kbperry wrote:
> Thanks for the replys!
>
> I need to stick with Word (not my choice, but I would rather keep
> everything like he has it).
That shouldn't be a problem: you can use stick with Word for editing the
documents and just use OpenOffice to do the conversion.
>
> Duncan,
> I was just
Yawn. Go start indenting, and stop using Perl. If Python has such a
nice logo, why waste any more time with Perl?
--
http://mail.python.org/mailman/listinfo/python-list
nikie wrote:
> Although I think it's worth reading, it only covers the fundamental
> structure (what arrays are, what ufuncs are..) of NumPy. Neither of the
> functions dicussed in this thread (polyfit/linear_least_squares) is
> mentioned in the file.
Both functions are described in the full book.
On 23/03/06, cm012b5105 <[EMAIL PROTECTED]> wrote:
Hi there i am hoping some one could help me out with a small problem
i am in the process of learning python. I am trying
to write an interactive programme,
This is a short example.
if s = raw_input
("hello what's your name? ")
if
Anand wrote:
>>> Wouldn't it be nice to say
>>> id, *tokens = line.split(',')
>>
>> id, tokens_str = line.split(',', 1)
>
> But then you have to split tokens_str again.
>
> id, tokens_str = line.split(',', 1)
> tokens = tokens_str.split(',')
Sorry, it wasn't clear that you needed the tokens from
bruno at modulix wrote:
> Steven Bethard wrote:
>> Could you explain again why you don't want baaz to be a class-level
>> attribute?
>
> Because the class is a decorator for many controller functions, and each
> controller function will need it's own set of descriptors, so I don't
> want to mess w
Hi there i am hoping some one could help me out with a small problem
i am in the process of learning python. I am trying
to write an interactive programme,
This is a short
example.
if s = raw_input
("hello what's your name? ")
if s=='carmel ':
print "Ahh the boss's
wife"
I'm confused. Why is it that when I say "while len(list) < 5:", I get
5 items in my list.
If I say "while len(list) < 6:", I get 6 items in the list and so on.
I would think if I said "less than 5", I would get 4 items.
Can anyone explain this?
Thanks.
R.D.
# Start an empty list
list = []
while
Em Qui, 2006-03-23 às 08:31 -0800, DataSmash escreveu:
> I'm confused. Why is it that when I say "while len(list) < 5:", I get
> 5 items in my list.
"while len(list) < 5:" implies that the loop will stop only when
len(list) >= 5.
HTH,
--
Felipe.
--
http://mail.python.org/mailman/listinfo/pyt
On 2006-03-23, Arne Ludwig <[EMAIL PROTECTED]> wrote:
> Good answer. :) I seriously doubt it is possible except for the
> trivial solution: [...]
I don't know if there is a Linux equivalent, but under SunOS
there was a way to delete a file given it's i-node. And that's
all it did was delete th
DataSmash wrote:
> I'm confused. Why is it that when I say "while len(list) < 5:", I get
> 5 items in my list.
> If I say "while len(list) < 6:", I get 6 items in the list and so on.
> I would think if I said "less than 5", I would get 4 items.
> Can anyone explain this?
Yes - you loop until the
DataSmash:
>I'm confused. Why is it that when I say "while len(list) < 5:", I get
>5 items in my list.
Because the last time when len(list) was < 5, the block of code following
the while executed and did something to the list to give it a length >= 5
(otherwise the block of code would be executed
1 - 100 of 224 matches
Mail list logo