not exactly for the homework, but as my starting point of learning
thank you so much.
--
http://mail.python.org/mailman/listinfo/python-list
> From: denismfmcma...@gmail.com
[...]
>> Dear all who involved with responding to my question - Thank you so much
>> for your nice code which really helped me.
>
> Hold on a sec? Someone posted code that gave the correct answer to a
> homework question?
>
>
On Thu, 23 May 2013 07:17:58 -0700, Keira Wilson wrote:
> Dear all who involved with responding to my question - Thank you so much
> for your nice code which really helped me.
Hold on a sec? Someone posted code that gave the correct answer to a
homework question?
--
Denis McMahon, denismfmcma.
Dear all who involved with responding to my question - Thank you so much for
your nice code which really helped me.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 23, 2013 at 10:37 AM, Carlos Nepomuceno
wrote:
>
>> From: oscar.j.benja...@gmail.com
>> Date: Thu, 23 May 2013 01:34:37 +0100
>> Subject: Re: file I/O and arithmetic calculation
>> To: carlosnepomuc...@outlook.com
&g
On 23 May 2013 04:15, Carlos Nepomuceno wrote:
> The last line of my noob piece can be improved. So this is it:
Most of it can be improved.
> filenames = ['1.txt', '2.txt', '3.txt', '4.txt', '5.txt']
> contents = [[[int(z) for z in y.split(',')] for y in open(x).read().split()]
> for x in file
The last line of my noob piece can be improved. So this is it:
### 1strow_average.py ###
#Assuming you have CSV (comma separated values) files such as:
#1.txt = '0,1,2,3,4,5,6,7,8,9\n' \
# '10,11,12,13,14,15,16,17,18,19\n' \
# '20,21,22,23,24,25,26,27,28,29\n' ...
#
# Usage: contents
> From: oscar.j.benja...@gmail.com
> Date: Thu, 23 May 2013 01:34:37 +0100
> Subject: Re: file I/O and arithmetic calculation
> To: carlosnepomuc...@outlook.com
> CC: python-list@python.org
>
> On 23 May 2013 00:49, Carlos Nepomuceno
On 23 May 2013 00:49, Carlos Nepomuceno wrote:
>
> The code is pretty obvious to me, I mean there's no obfuscation at all.
I honestly can't tell if you're joking.
--
http://mail.python.org/mailman/listinfo/python-list
> From: denismfmcma...@gmail.com
[...]
>
> import re
> def v(s):
> l=len(s)
> t=0.
> for i in range(l):
> t=t+(abs(ord(s[i]))*1.)
> return t/(l*1.)
> for n in range(5):
> m="c:/test/"+str(n+1)+".txt"
> f=open(m,"r")
> d=[]
> t=0.
> for l in range(10):
> d=d+
On Thu, 23 May 2013 01:13:19 +0900, Keira Wilson wrote:
> I would appreciate if someone could write a simple python code for the
> purpose below:
Didn't have your data, so couldn't verify it completely, but try this:
import re
def v(s):
l=len(s)
t=0.
for i in range(l):
t=t+(abs(ord(s[i]))*1
># contents[3][4][5] : 6th column of 5th row of file '4.txt'
BTW, it should read
# contents[3][4][5] : 6th value of 5th row of file '4.txt'
--
http://mail.python.org/mailman/listinfo/python-list
> From: oscar.j.benja...@gmail.com
[...]
>
> Do you find this code easy to read? I wouldn't write something like
> this and I certainly wouldn't use it when explaining something to a
> beginner.
>
> Rather than repeated list comprehensions you should conside
On 22 May 2013 22:05, Carlos Nepomuceno wrote:
>
> filenames = ['1.txt', '2.txt', '3.txt', '4.txt', '5.txt']
> contents = [[[int(z) for z in y.split(',')] for y in open(x).read().split()]
> for x in filenames]
> s1c = [sum([r[0] for r in f]) for f in contents]
> a1r = [sum(f[0])/float(len(f[0]
ormat(n,a1r[i]) if s1c[i]==50 else '' for i,n in enumerate(filenames)]
if x])
> From: wilke...@gmail.com
> Date: Thu, 23 May 2013 01:13:19 +0900
> Subject: file I/O and arithmetic calculation
> To: python-list@python.org
>
>
> D
On 22/05/2013 17:13, Keira Wilson wrote:
Dear all,
I would appreciate if someone could write a simple python code for the
purpose below:
I have five text files each of 10 columns by 10 rows as follows:
|file_one= 'C:/test/1.txt'
file_two= 'C:/test/2.txt'
. . .
file_five= 'C:/test/5.txt'|
Dear all,
I would appreciate if someone could write a simple python code for the
purpose below:
I have five text files each of 10 columns by 10 rows as follows:
file_one = 'C:/test/1.txt'
file_two = 'C:/test/2.txt' . . .
file_five = 'C:/test/5.txt'
I want to calculate the mean of first row (10
That did the trick! Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
"jam1991" wrote in message
news:c0c76bc4-8923-4a46-9c36-6e1a0375f...@l11g2000yqb.googlegroups.com...
[snip]
> they sign into the program with; however, this information doesn't
> appear in the file until after the program has closed. This poses a
> problem for retrieving the up-to-date statistic
I'm not familiar with linecache.clearcache(), but did you flush the data to
the filesystem with file_.flush() ?
On Wed, Mar 23, 2011 at 9:53 PM, jam1991 wrote:
> I'm trying to build a feature on to a text-based game that I've been
> working on that would allow users to view their stats. Informat
I'm trying to build a feature on to a text-based game that I've been
working on that would allow users to view their stats. Information is
stored in a flat text database file that is given the same name that
they sign into the program with; however, this information doesn't
appear in the file until
Lawrence D'Oliveiro schrieb:
In message , Steve
Holden wrote:
Yes, but not to MySQL, please. Particularly since there is a sword of
Damocles hanging over its head while the Oracle takeover of Sun is
pending.
Ah, I see the FUDsters are crawling out of the woodwork here, as well. I’ve
got new
Lawrence D'Oliveiro wrote:
> In message , Steve
> Holden wrote:
>
>> Yes, but not to MySQL, please. Particularly since there is a sword of
>> Damocles hanging over its head while the Oracle takeover of Sun is
>> pending.
>
> Ah, I see the FUDsters are crawling out of the woodwork here, as well.
In message , Steve
Holden wrote:
> Yes, but not to MySQL, please. Particularly since there is a sword of
> Damocles hanging over its head while the Oracle takeover of Sun is
> pending.
Ah, I see the FUDsters are crawling out of the woodwork here, as well. I’ve
got news for you: MySQL is an open
John Nagle wrote:
> pyt...@bdurham.com wrote:
>> I'm looking for the best practice way for a multi-threaded python web
>> server application to read/write to a shared file or a SQLite database.
>>
>> What do I need to do (if anything) to make sure my writes to a regular
>> file on disk or to a SQLi
pyt...@bdurham.com wrote:
I'm looking for the best practice way for a multi-threaded python web
server application to read/write to a shared file or a SQLite database.
What do I need to do (if anything) to make sure my writes to a regular
file on disk or to a SQLite database are atomic in nature
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Diez B. Roggisch wrote:
> AFAIK, sqlite ensures process-serialization via locking, and threads
> synchronize themselves as well.
SQLite versions prior to 3.5 did not support using the same connection or
cursors in different threads. (You needed to al
pyt...@bdurham.com schrieb:
I'm looking for the best practice way for a multi-threaded python web
server application to read/write to a shared file or a SQLite database.
What do I need to do (if anything) to make sure my writes to a regular
file on disk or to a SQLite database are atomic in natu
I'm looking for the best practice way for a multi-threaded python web
server application to read/write to a shared file or a SQLite database.
What do I need to do (if anything) to make sure my writes to a regular
file on disk or to a SQLite database are atomic in nature when multiple
clients post
On Wed, 27 May 2009 19:39:21 -0500
Eric Pruitt wrote:
> I am creating a file-like interface for Popen. Do I need to return True or
> False for "isatty()"? I am thinking True but I am not familiar with the
> semantics of what defines a tty.
>>> import os
>>> x = os.popen("ls")
>>> type(x)
Hello,
I am creating a file-like interface for Popen. Do I need to return True or
False for "isatty()"? I am thinking True but I am not familiar with the
semantics of what defines a tty.
Thanks,
Eric
--
http://mail.python.org/mailman/listinfo/python-list
Hi Paul & All,
On May 24, 4:16 pm, Paul Boddie wrote:
> On 24 Mai, 16:13, Infinity77 wrote:
>
>
>
> > No, the processing of the data is fast enough, as it is very simple.
> > What I was asking is if anyone could share an example of using
> > multiprocessing to read a file, along the lines I desc
On 24 Mai, 16:13, Infinity77 wrote:
>
> No, the processing of the data is fast enough, as it is very simple.
> What I was asking is if anyone could share an example of using
> multiprocessing to read a file, along the lines I described above.
Take a look at this section in an article about multi-
Hi Igor,
On May 24, 1:10 pm, Igor Katson wrote:
> Infinity77 wrote:
> > Hi All,
>
> > I am trying to speed up some code which reads a bunch of data from
> > a disk file. Just for the fun of it, I thought to try and use parallel
> > I/O to split the reading of the file between multiple process
Infinity77 wrote:
Hi All,
I am trying to speed up some code which reads a bunch of data from
a disk file. Just for the fun of it, I thought to try and use parallel
I/O to split the reading of the file between multiple processes.
Although I have been warned that concurrent access by multiple
Hi All,
I am trying to speed up some code which reads a bunch of data from
a disk file. Just for the fun of it, I thought to try and use parallel
I/O to split the reading of the file between multiple processes.
Although I have been warned that concurrent access by multiple
processes to the sam
On Mon, 04 Feb 2008 21:58:46 +, Steven D'Aprano wrote:
> On Mon, 04 Feb 2008 17:08:02 +, Marc 'BlackJack' Rintsch wrote:
>
>>> Surprisingly, Method 2 is a smidgen faster, by about half a second over
>>> 500,000 open-write-close cycles. It's not much faster, but it's
>>> consistent, over m
On Mon, 04 Feb 2008 17:08:02 +, Marc 'BlackJack' Rintsch wrote:
>> Surprisingly, Method 2 is a smidgen faster, by about half a second over
>> 500,000 open-write-close cycles. It's not much faster, but it's
>> consistent, over many tests, changing many of the parameters (e.g. the
>> number of f
On Mon, 04 Feb 2008 10:48:32 -0800, rdahlstrom wrote:
> It doesn't matter how many doors opening and closing there are, it
> matters the order in which the opening, walking through, and closing
> are done. That's my point. In the second example, all of the disk
> operations are done at the same
It doesn't matter how many doors opening and closing there are, it
matters the order in which the opening, walking through, and closing
are done. That's my point. In the second example, all of the disk
operations are done at the same time. That's what I meant by people
going through the doors.
On Mon, 04 Feb 2008 10:18:39 -0800, rdahlstrom wrote:
> On Feb 4, 1:12 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>> On Feb 4, 12:53 pm, rdahlstrom <[EMAIL PROTECTED]> wrote:
>> > You have 500,000 people to fit through a door. Here are your options:
>>
>> > 1. For each person, open the door, walk
On Feb 4, 1:12 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Feb 4, 12:53 pm, rdahlstrom <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED]
>
> > cybersource.com.au> wrote:
> > > After reading an earlier thread about opening and closing lots of files,
> > >
On Feb 4, 12:53 pm, rdahlstrom <[EMAIL PROTECTED]> wrote:
> On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED]
>
>
>
> cybersource.com.au> wrote:
> > After reading an earlier thread about opening and closing lots of files,
> > I thought I'd do a little experiment.
>
> > Suppose you have a whole
En Mon, 04 Feb 2008 15:53:11 -0200, rdahlstrom <[EMAIL PROTECTED]>
escribi�:
> On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED]
> cybersource.com.au> wrote:
>>
>> Suppose you have a whole lot of files, and you need to open each one,
>> append a string, then close them. There's two obvious
On Feb 4, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> After reading an earlier thread about opening and closing lots of files,
> I thought I'd do a little experiment.
>
> Suppose you have a whole lot of files, and you need to open each one,
> append a string, then clos
On Mon, 04 Feb 2008 15:17:18 +, Steven D'Aprano wrote:
> # Method one: grouped by file.
> for each file:
> open the file, append the string, then close it
>
>
> # Method two: grouped by procedure.
> for each file:
> open the file
> for each open file:
> append the string
> for ea
Steven D'Aprano wrote:
> So, what's going on? Can anyone explain why the code which does more work
> takes less time?
Short answer: CPU and RAM are much faster than hard disks.
The three loops and the creation of a list costs only a few CPU cycles
compared to flushing the new data to disk.
Chri
After reading an earlier thread about opening and closing lots of files,
I thought I'd do a little experiment.
Suppose you have a whole lot of files, and you need to open each one,
append a string, then close them. There's two obvious ways to do it:
group your code by file, or group your code b
On May 9, 2:43 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
> > [lst.append(list(line.split())) for line in file]
>
> Thanks, this is the direction I wanted to go, BUT I must use v2.2 so
> the line above gives me the error:
>
> AttributeError: __getitem__
>
> But the write format will be helpful.
(
> [lst.append(list(line.split())) for line in file]
Thanks, this is the direction I wanted to go, BUT I must use v2.2 so
the line above gives me the error:
AttributeError: __getitem__
But the write format will be helpful.
Thanks again,
jh
--
http://mail.python.org/mailman/listinfo/python-l
On May 9, 2:13 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
> If one has a list of lists such as
>
> lst = [['a','1'],['b','2']]
>
> is there a standard python idiom for writing and reading the pairs to/
> from a file?
>
> Thanks,
>
> jh
These work. Assuming you can choose the format. Or you coul
Hi,
As far as I know, Python doesn't have a specific thing to handle this.
You could write a tiny function that would interpre element type of
list's elements. It checks type, if it is a list then get that pair
manually...
If list is going like that 'a' - '1', 'b' - '2', you should use dictiona
If one has a list of lists such as
lst = [['a','1'],['b','2']]
is there a standard python idiom for writing and reading the pairs to/
from a file?
Thanks,
jh
--
http://mail.python.org/mailman/listinfo/python-list
Thanks a lot for the help guys, I'm at work right now and I will go
over your suggestions one by one this weekend. Being more alert now,
taking a look at the examples you posted, I now see how to approach
this problem. The thing with python that I'm starting to realize is
that there are a million
Thanks a lot for the help guys, I'm at work right now and I will go
over your suggestions one by one this weekend. Being more alert now,
taking a look at the examples you posted, I now see how to approach
this problem. The thing with python that I'm starting to realize is
that there are a million
On Mar 16, 9:38 am, "7stud" <[EMAIL PROTECTED]> wrote:
> -
> import os
>
> filepath = "./change_files"
>
> li = os.listdir(filepath)
> for name in li:
> fullpath = filepath + "/" + name
> if os.path.isfile(fullpath):
> infile = open(fullpath, 'r')
>
>
The general idiom for altering lines in a file is to open the original
file and write the alterations to a temp file. After you are done
writing to the temp file, delete the original file, and change the
temp file name to the original file name.
If instead you were to read the whole file into a va
On Mar 16, 7:09 am, Laurent Rahuel <[EMAIL PROTECTED]> wrote:
> Maybe the walk method in os module is what you
> needhttp://docs.python.org/lib/os-file-dir.html
>
> Regards
>
> Jon Clements wrote:
> > On 16 Mar, 09:02, "Jon Clements" <[EMAIL PROTECTED]> wrote:
> >> On 16 Mar, 03:56, "hiro" <[EMAIL
Maybe the walk method in os module is what you need
http://docs.python.org/lib/os-file-dir.html
Regards
Jon Clements wrote:
> On 16 Mar, 09:02, "Jon Clements" <[EMAIL PROTECTED]> wrote:
>> On 16 Mar, 03:56, "hiro" <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>
>>
>> > Hi there,
>>
>> > I'm very new to p
On 16 Mar, 09:02, "Jon Clements" <[EMAIL PROTECTED]> wrote:
> On 16 Mar, 03:56, "hiro" <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi there,
>
> > I'm very new to python, the problem I need to solve is whats the "best/
> > simplest/cleanest" way to read in multiple files (ascii), do stuff to
> > them,
On 16 Mar, 03:56, "hiro" <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I'm very new to python, the problem I need to solve is whats the "best/
> simplest/cleanest" way to read in multiple files (ascii), do stuff to
> them, and write them out(ascii).
>
> --
> import os
>
> filePath = ('O:/spam/eggs/')
Hi there,
I'm very new to python, the problem I need to solve is whats the "best/
simplest/cleanest" way to read in multiple files (ascii), do stuff to
them, and write them out(ascii).
--
import os
filePath = ('O:/spam/eggs/')
for file in os.listdir(filePath): #straight from docs
# iterate
Ant wrote:
> Kirt wrote:
> ...
> > i dont wanna parse the xml file..
> >
> > Just open the file as:
> >
> > f=open('test.xml','a')
> >
> > and append a line "abc" before tag
>
> The other guys are right - you should look at something like
> ElementTree which makes this sort of thing pretty easy,
Kirt wrote:
...
> i dont wanna parse the xml file..
>
> Just open the file as:
>
> f=open('test.xml','a')
>
> and append a line "abc" before tag
The other guys are right - you should look at something like
ElementTree which makes this sort of thing pretty easy, and is robust.
But if you are sur
Diez B. Roggisch wrote:
> Good to know that you can get drunk under any circumstances.
+(++)1 heh!
> I have seen a bazillion bad xml/html parsing-hacks using regexes and the
> like, which stopped working after somehow the xml came all in one line, or
> some other implicit assumption about its lay
jimburton wrote:
>
> Diez B. Roggisch wrote:
>> Kirt wrote:
>>
>> >
>> > jimburton wrote:
>> >> Kirt wrote:
>> >> > Hi! I need some help in file I/O
>> >> >
>> >> > I have an xml file..
>> >
Diez B. Roggisch wrote:
> Kirt wrote:
>
> >
> > jimburton wrote:
> >> Kirt wrote:
> >> > Hi! I need some help in file I/O
> >> >
> >> > I have an xml file..
> >> [snip]
> >> See http://diveintopython.org/xml_pro
Kirt wrote:
>
> jimburton wrote:
>> Kirt wrote:
>> > Hi! I need some help in file I/O
>> >
>> > I have an xml file..
>> [snip]
>> See http://diveintopython.org/xml_processing/
>
> i dont wanna parse the xml file..
If you play soccer, d
Kirt wrote:
> i dont wanna parse the xml file..
>
> Just open the file as:
>
> f=open('test.xml','a')
>
> and append a line "abc" before tag
Use a regex to split the contents and insert new stuff, eg
import re
prog = prog = re.compile('^(.*)()', re.DOTALL)
m = prog.search(f.read())
then m.gro
jimburton wrote:
> Kirt wrote:
> > Hi! I need some help in file I/O
> >
> > I have an xml file..
> [snip]
> See http://diveintopython.org/xml_processing/
i dont wanna parse the xml file..
Just open the file as:
f=open('test.xml','a')
jimburton wrote:
> Kirt wrote:
> > Hi! I need some help in file I/O
> >
> > I have an xml file..
> [snip]
> See http://diveintopython.org/xml_processing/
i dont wanna parse the xml file..
Just open the file as:
f=open('test.xml','a')
and write
Kirt wrote:
> Hi! I need some help in file I/O
>
> I have an xml file..
[snip]
See http://diveintopython.org/xml_processing/
--
http://mail.python.org/mailman/listinfo/python-list
Hi! I need some help in file I/O
I have an xml file..
xyz
I want to open these file in append mode and add the line
abd
Such that i have:
xyz
xyz
can anyone show me the way to achieve this??
thanx
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, crystalattice
wrote:
> One other question though (hope it doesn't sound silly/stupid). Your
> suggestion to "pickle a party" using a list has me thinking: can a
> list store class instances?
Yes of course you can store class instances in lists.
> For example, if I wante
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, crystalattice
> wrote:
>
> >> What are the problems you fear when using `shelve` by the way?
> >>
> > The ideas I got about shelve are mostly due to this thread:
> > http://tinyurl.com/lueok. There weren't any other threads
> > contradictin
In <[EMAIL PROTECTED]>, crystalattice
wrote:
>> What are the problems you fear when using `shelve` by the way?
>>
> The ideas I got about shelve are mostly due to this thread:
> http://tinyurl.com/lueok. There weren't any other threads
> contradicting the information so I figured it has merit.
M
Simon Hibbs wrote:
> I've recently gone through a similar evaluation of my options for
> persisting data. Object serialization to pickles or XML is a very easy,
> quick way of persisting data but it does have drawbacks. I'm not a
> professional developer, so if there are errors in my analysis, I'd
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, crystalattice wrote:
>
> > On Mon, 31 Jul 2006 14:35:39 -1000, Simon Forman <[EMAIL PROTECTED]>
> > wrote:
> >
> >> What kind of trouble were you having with pickle?
> >
> > It's mostly a combination of things (I hope you can follow my logi
I've recently gone through a similar evaluation of my options for
persisting data. Object serialization to pickles or XML is a very easy,
quick way of persisting data but it does have drawbacks. I'm not a
professional developer, so if there are errors in my analysis, I'd love
to be corrected.
Sup
In <[EMAIL PROTECTED]>, crystalattice wrote:
> On Mon, 31 Jul 2006 14:35:39 -1000, Simon Forman <[EMAIL PROTECTED]>
> wrote:
>
>> What kind of trouble were you having with pickle?
>
> It's mostly a combination of things (I hope you can follow my logic).
> First, to use "good programming prac
crystalattice wrote:
>
> Plus, to modify data in a class
I presume the word "instance" is missing here ...
> do I have to unpickle the whole thing
> first or is there a way to modify the data while it's pickled? Actually,
> I think I can answer that last question: a character instance, having
On Mon, 31 Jul 2006 14:35:39 -1000, Simon Forman <[EMAIL PROTECTED]>
wrote:
> crystalattice wrote:
>> I'm creating an RPG for experience and practice. I've finished a
>> character creation module and I'm trying to figure out how to get the
>> fil
crystalattice wrote:
> I'm creating an RPG for experience and practice. I've finished a
> character creation module and I'm trying to figure out how to get the
> file I/O to work.
>
> I've read through the python newsgroup and it appears that shelve
> prob
I'm creating an RPG for experience and practice. I've finished a
character creation module and I'm trying to figure out how to get the
file I/O to work.
I've read through the python newsgroup and it appears that shelve
probably isn't the best option for various reas
[EMAIL PROTECTED] wrote:
> I've just started to test/learn python.
> I've got Linux > mandrake9 > python & documentation.
> What I'll initially want to be doing needs file I/O, so I
> wanted to confirm file I/O early in my tests.
>
> Following the
[EMAIL PROTECTED] wrote:
> I've just started to test/learn python.
> I've got Linux > mandrake9 > python & documentation.
> What I'll initially want to be doing needs file I/O, so I
> wanted to confirm file I/O early in my tests.
>
> Following the
On 2005-12-24, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
f.read(size)
> Traceback (most recent call last):
> File "", line 1, in ?
> NameError: name 'size' is not defined <-- ?? Obj-method unknown ??
>
>
> What's wrong ?
You haven't defined anything named "size".
Assuming you want to
[EMAIL PROTECTED] wrote:
> I've just started to test/learn python.
> I've got Linux > mandrake9 > python & documentation.
> What I'll initially want to be doing needs file I/O, so I
> wanted to confirm file I/O early in my tests.
>
> Following the
I've just started to test/learn python.
I've got Linux > mandrake9 > python & documentation.
What I'll initially want to be doing needs file I/O, so I
wanted to confirm file I/O early in my tests.
Following the examples :
>>> f=open('/tmp/workfile',
I found the problem. There was a recv that was not from an open
socket...
Sorry abt the trouble,
--j
--
http://mail.python.org/mailman/listinfo/python-list
Here is what the send and recieved number of bytes show up as:
Filesize being sent = 507450
Server sending file to client...
(total size sent , buffer size)
...
491520 4096
495616 4096
499712 4096
503808 3642
./server.py: (107, 'Transport endpoint is not connected')
On the client side, the bytes
I am sending a file on a tcp socket using the following code
while 1:
buf = os.read(fd, 4096)
if not buf: break
print total, len(buf)
conn.send(b
92 matches
Mail list logo