too stupid. But I'm
just getting really disenchanted. Sorry.
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: 27 July 2007 13:07
To: Barton David
Cc: tutor@python.org
Subject: Re: [Tutor] Shelve del not reducing file size
Barton David wrote:
> *sigh* I'm really
27;friendliness' it once seemed to aspired to.
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: 27 July 2007 14:11
To: Barton David
Cc: tutor@python.org
Subject: Re: [Tutor] Shelve del not reducing file size
If it's any solace, there is a small minority of Pyth
Eric Brunson wrote:
> It seems like new programmers today expect to be spoonfed their
> information like they were in grammar school. They don't know what it
> is to hack a Makefile to get a package to compile or break out an RFC to
> understand a protocol. If you don't understand something a
*sigh* I'm really going off Python.
OK, thanks Andreas.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University o
Hi,
I've hit a snag with Python's shelve module. By way of example...
_
from shelve import DbfilenameShelf as StoreFile
import os
sf=StoreFile("mytest.db",writeback=False) # but same problem if
writeback=True
for i in range(1):
sf[str(i)]="TESTOBJECT"
sf.sync()
print len(sf)
sf.cl
Andreas Kostyrka wrote:
> Additionally, the language core is very very thought out, with glacial
> enhancements. "Fixing" the standard library OTOH would involve
renaming
> and removing names, which would make huge collections of programs
break.
> Not a good thing :(
Yes agreed. My comments there
Eric Brunson wrote:
> You seem like a smart guy that's having a bad day, so I'm cutting you
> slack.
Thanks Eric. Yes I did indeed have a bad day (and it got much much worse),
and this is most definitely a case of a bad workman blaming his tools. I
apologise to all concerned for voicing my frustr
Hi there,
I can easily use the subprocess module to run a separate exe from within
MyScript.py..
e.g.
import subprocess
process=subprocess.Popen("myprog.exe -i inputfile.txt -o
outputfile.txt")
..and that's just fine as far as it goes, if I don't mind creating
'inputfile.txt' first, and reading
PROTECTED] On
Behalf Of Christopher Arndt
Sent: 09 January 2007 14:26
To: Tutor@python.org
Subject: Re: [Tutor] feeding data to subprocess exes and getting results
without writing files
Barton David schrieb:
> I just can't wrap my head around stdin, stdout and the whole pipes
>
I don't suppose there's a nifty trick (exploiting the internal workings
of the re module perhaps) to generate all possible hits of a given regex
pattern?
Something like:
>>> import re
>>> mypattern=re.compile( "[AB]C{1,2}D?" )
>>> print list( all_pattern_generator( mypattern ) )
["AC","BC","ACC
Hi,
I'm really confused, and I hope somebody can explain this for me...
I've been playing with compression and archives, and have some .zip,
.tar, .gz and .tgz example files to test my code on.
I can read them using either zipfile, tarfile, gzip or zlib, and that's
fine. But just reading them in
ead() from going to the end?
Dave
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: 20 February 2007 12:53
To: Barton David
Cc: tutor@python.org
Subject: Re: [Tutor] file.read() doesn't give full contents of
compressed files
Barton David wrote:
> Hi,
> I
I see. Thanks for that.
dave
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: 20 February 2007 13:30
To: Barton David
Cc: tutor@python.org
Subject: Re: [Tutor] file.read() doesn't give full contents of
compressed files
Barton David wrote:
> Oh... of course
I like that I can access the contents of a zip archive that's stored in
memory (rather than on disk) by packing the archive contents into a
StringIO or cStringIO object and feeding that to ZipFile...
i.e.
filelike=cStringIO.StringIO(archive_as_string)
zf=zipfile.ZipFile(filelike)
content=zf.re
.getmember(archive_member_name)
>>>tf_filelike=tf.extractfile(tf_infoobject)
>>>print tf_filelike.read()
In fact I'm getting this even if I open the archive by passing the path
name (rather than using fileobj) so I guess this isn't the problem I
initially thought it wa
l in response to a tutor's direct reply) it
doesn't seem to add my message to the bottom of the existing thread. If
somebody can tell me what I'm doing wrong, I'd appreciate it.
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: 05 March 2007 12:44
16 matches
Mail list logo