tempfile module

2008-09-10 Thread aditya shukla
Hello folks, I am using Python-2.5.2 on fedora 9 sulphur -2.6.25-14.fc9.i686.I am creating a temporary file , in which data is written by another program and then i am using that temporary file to do my computations.I am new to linux and i am facing two issues homedir = os.path.expanduser('~')

Re: problems using pythom tempfile module

2007-09-15 Thread buffi
Pretend that you have a number that is always pointing somewhere in your temporary file. It starts a 0. If you then write "lalalala" (8 characters) it will point after these at position 8, so that you can write more stuff after your previous text later by calling write. The read method reads all t

Re: problems using pythom tempfile module

2007-09-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Sep 15, 5:24 pm, buffi <[EMAIL PROTECTED]> wrote: >> On Sep 15, 11:11 pm, "[EMAIL PROTECTED]" >> >> >> >> <[EMAIL PROTECTED]> wrote: >>> Hello everyone, >>> I'm trying to test the tempfile

Re: problems using pythom tempfile module

2007-09-15 Thread [EMAIL PROTECTED]
On Sep 15, 5:24 pm, buffi <[EMAIL PROTECTED]> wrote: > On Sep 15, 11:11 pm, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > Hello everyone, > > > I'm trying to test the tempfile module with the following script, > > whi

Re: problems using pythom tempfile module

2007-09-15 Thread buffi
On Sep 15, 11:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I'm trying to test the tempfile module with the following script, > which basically creates a temporary file, fills the file with some > test data and

problems using pythom tempfile module

2007-09-15 Thread [EMAIL PROTECTED]
Hello everyone, I'm trying to test the tempfile module with the following script, which basically creates a temporary file, fills the file with some test data and prints it. import tempfile t = tempfile.TemporaryFile() t.write("lalalala") t.flush() print t.read() Unfortuna

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-10 Thread James T. Dennis
Marc Christiansen <[EMAIL PROTECTED]> wrote: > James T. Dennis <[EMAIL PROTECTED]> scribis: >> In fact I realized, after reading through tempfile.py in /usr/lib/... >> that the following also doesn't "work" like I'd expect: >># foo.py >>tst = "foo" >>def getTst(arg): > If I

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-10 Thread Marc Christiansen
James T. Dennis <[EMAIL PROTECTED]> scribis: > In fact I realized, after reading through tempfile.py in /usr/lib/... > that the following also doesn't "work" like I'd expect: > ># foo.py >tst = "foo" >def getTst(arg): If I change this line: >return "foo-%s"

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-10 Thread Marc 'BlackJack' Rintsch
ate = 'spam' > >> In [16]: tempfile.template >> Out[16]: 'spam' > > I know you can change it. But changing it in your namespace > doesn't change the results returned by the functions called > from the module. I'm not changing

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-09 Thread James T. Dennis
ot;, # low level safe interfaces >"mktemp", # deprecated unsafe interface >"TMP_MAX", "gettempprefix",# constants >"tempdir", "gettempdir" > ] > Maybe the doc should be

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-09 Thread James T. Dennis
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 09 May 2007 06:50:38 -, "James T. Dennis" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> In fact I realized, after reading through tempfile.py in /usr/lib/... >> that the following also doesn't "work" like I'd exp

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-09 Thread Marc 'BlackJack' Rintsch
"NamedTemporaryFile", "TemporaryFile", # high level safe interfaces "mkstemp", "mkdtemp", # low level safe interfaces "mktemp", # deprecated unsafe interface "TMP_MAX", "gett

Minor bug in tempfile module (possibly __doc__ error)

2007-05-08 Thread James T. Dennis
xcept to test my hypothesis about why changes to tempfile.template don't actually affect the values seen by functions in the tempfile namespace. Secondly, the author(s) of the tempfile module apparently didn't understand this either. And no one else even noticed that the __doc__