Rocco Moretti wrote:
Python's also dangerous. Every time you do an "import module", you put
your system at risk of crashing, having the hard-drive wiped
Have you been drinking again?
--
http://mail.python.org/mailman/listinfo/python-list
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
Xah Lee wrote:
# reading entire file as a list, of lines
# mylist = f.readlines()
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)
--
http://mail.python.org
Are these the same:
1. f_size = os.path.getsize(file_name)
2. fp1 = file(file_name, 'r')
data = fp1.readlines()
last_byte = fp1.tell()
I always get the same value when doing 1. or 2. Is there a reason I
should do both? When reading to the end of a file, won't tell() be just
as accurate as o
Hi,
I have a Python list. I can't figure out how to find an element's
numeric value (0,1,2,3...) in the list. Here's an example of what I'm doing:
for bar in bars:
if 'str_1' in bar and 'str_2' in bar:
print bar
This finds the right bar, but not its list position. The reason I need
to f
John Machin wrote:
Bob Smith wrote:
Is shutil.copyfile(src,dst) the *most* portable way to copy files
with
Python? I'm dealing with plain text files on Windows, Linux and Mac
OSX.
Thanks!
Portable what? Way of copying??
Do you want your files transferred (a) so that they look like native
Is shutil.copyfile(src,dst) the *most* portable way to copy files with
Python? I'm dealing with plain text files on Windows, Linux and Mac OSX.
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
© ok, here's the ordeal.
©
© for i in range(5):
© print i
© for i in range(2):
© print i, 'tt'
© for i in [3]:
© print i
© for i in [32]:
© print i
©
© # 1 level, 4 space
© # 2 level, 1 tab
© # 3 level, 1 tab, 4 spaces
© # 4 level
nell wrote:
Hi Steve,
First the "10x in advance" means thanks in advance.
The main importance of protecting my code is to save headache of
customers that want to be smart and change it and then complain on bugs
and problems.
10x
I'd say that's more of a policy issue than a technical issue. You have
Peter Maas wrote:
Charlton Wilbur schrieb:
"XL" == Xah Lee <[EMAIL PROTECTED]> writes:
XL> i'll cross post to comp.lang.perl.misc and comp.lang.python.
XL> If you spot mistakes, feel free to correct or discourse here.
Error #1: crossposting to those two groups.
(Error #2 is implying that
Scott Bryce wrote:
Xah Lee wrote:
frustrated constantly by its inanities and incompetences.)
I don't see what this has to do with Perl.
You're joking, right?
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
Bob Smith wrote:
Attached is the code. Run it yourself and see. You too Peter. Be
gentle with me, this was my first attempt with threads.
Thanks, Bob, and I will, but not before you answer some of my
questions.
I had good reasons to ask them, one of which is that I don't
Smitsky wrote:
Hi. I am a newbie to Python. I am running Win XP and want to know what the
best course is for installing Python on my system. Could someone kindly
direct me to some related resources? Thanks in advance, Steve
It's really easy on Windows. Just download the install package and cli
Steve Holden wrote:
Bob Smith wrote:
Does the Win32 port of Python have a memory leak? I have some code
that runs flawlessly on Linux, but bombs after a few hours on Windows.
It's threaded and uses a lot of memory.
Thanks!
Yes, that's a well-known problem. Code that runs with a few e
Does the Win32 port of Python have a memory leak? I have some code that
runs flawlessly on Linux, but bombs after a few hours on Windows. It's
threaded and uses a lot of memory.
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
15 matches
Mail list logo