On Wed, 02 Mar 2005 01:17:28 -0500, Bill Kranec <[EMAIL PROTECTED]> wrote:
> [...] I wanted to be able to define
> multiple tournament objects off of the same roundlist, to avoid
> generating the list every time a new object is created. I think what I
> really want to do is have a separate Round
Hi Kent,
First off, thank you so much for the suggestions! They have helped
clarify some of the concepts I've been struggling with lately ( mostly
object - related ones ). I have been teaching myself Python in my spare
time for the last few months, and have no previous programming
experience,
* Nick Lunt <[EMAIL PROTECTED]> [2005-03-01 22:23]:
> On Tue, 2005-03-01 at 14:14 -0800, Sean Perry wrote:
>
> >
> > unless you want the output for some other reason, a more idiomatic way
> > is:
> >
> > for line in sys.stdin.readlines():
> > # handle the line
> >
> > I tend to use xreadli
Sorry. I sent this yesterday but forgot the subject.
Hope this helps point you in the right direction ...
I attempting to control xfmedia,
http://spuriousinterrupt.org/projects/xfmedia/ , via it's remote from
python and I can not get a connection.
s = socket.fromfd('/tmp/xfmedia_remote.1001.0', s
> ###
> >>> d = {}
> >>> def addTally(name):
> ... d.setdefault(name[0], []).append(name)
> ...
> >>> addTally('john')
> >>> addTally('brian')
> >>> addTally('jane')
> >>> addTally('alice')
> >>> addTally('bob')
> >>> d
> {'a': ['alice'], 'j': ['john', 'jane'], 'b': ['brian', 'bob']}
> ###
>
>
On Tue, 1 Mar 2005, James O. Sweeney wrote:
> I have an assignment that entails entering cash transactions as records.
Hi James,
Just to make it clear: we are prohibited from doing homework questions.
Since it's an assignment, we'll try to stay clear of direct solutions.
> My question is ab
While we generally don't get too specific with assignments and/or homework -
For a traditional database, you'd have to go the mySQL route. A
dictionary is good, but for only one discreet key. That said, you
could do it with objects like this -
dictOfTransactionObjects = {}
class CashTransaction
Hi Srinivas,
You want to use the csv module, it's designed for this kind of stuff.
http://docs.python.org/lib/module-csv.html
So, I think for your thing you'd want =
import csv
f1 = open('my_file.txt','r')
reader = csv.reader(f1)
reader.delimiter = '\t'
fileA = []
fileB = []
for row in read
Everypne else has answered pretty muh about this. I just want to add
that if you want to read noncanonically (less thana line ending in "\n"
you'll have to do it char by char =( AFAIK, there's no way to redefine a
separator por readlines() (other than \n..)
Hugo
Nick Lunt wrote:
Hi folks,
I've
Hello,
I have an assignment that entails entering cash transactions
as records. The significant record fields are a date/time stamp, the amount,
and whether the transaction is a deposit or withdrawal. My question is about setting
up the database file. In Python there is a dictionary functi
Hi,
On Mar 1, 2005, at 6:01 PM, Sean Perry wrote:
[EMAIL PROTECTED] wrote:
If I do:
$ ./produce.py | ./read.py
I get nothing for ten seconds, then I get the numbers 0 through 9,
one per line.
What am I missing?
From the python man page:
-u
Force stdin, stdout and stderr to be totally unbuffere
[EMAIL PROTECTED] wrote:
If I do:
$ ./produce.py | ./read.py
I get nothing for ten seconds, then I get the numbers 0 through 9, one per line.
What am I missing?
From the python man page:
-u
Force stdin, stdout and stderr to be totally unbuffered. On systems
where it matters, also put stdin, st
Quoting Max Noel <[EMAIL PROTECTED]>:
> UNIX philosophy is to have programs start acting as soon as possible
> -- in that case, as soon as the first line is available. You should be
> reading sys.stdin as an iterator (same thing you'd do for a file):
>
> import sys
> for line in sys.stdin:
On Wed, 2005-03-02 at 11:22 +1300, [EMAIL PROTECTED] wrote:
> Quoting Sean Perry <[EMAIL PROTECTED]>:
>
> > for line in sys.stdin.readlines():
> > # handle the line
> >
> > I tend to use xreadlines() which does not read the entire input at once.
>
> xreadlines() these days just does 'return sel
On Tue, 2005-03-01 at 22:20 +, Max Noel wrote:
> I don't think you are. You're using readlines(), which means your
> program won't execute until ps terminates.
> UNIX philosophy is to have programs start acting as soon as possible
> -- in that case, as soon as the first line is a
Quoting Sean Perry <[EMAIL PROTECTED]>:
> for line in sys.stdin.readlines():
> # handle the line
>
> I tend to use xreadlines() which does not read the entire input at once.
xreadlines() these days just does 'return self', I believe. File objects are
their own iterators; you can just do:
for
Hello:
I have a nasty file where I have 165 column and 140K
lines.
For every 12 columns, a new dataset is written.
0-12 - File A's data is there
13-24 - File B's data is there.
My task is to write data in each 12 columns to a file.
I have a rough idea, but when I try I am unable to
proceed
On Tue, 2005-03-01 at 14:14 -0800, Sean Perry wrote:
>
> unless you want the output for some other reason, a more idiomatic way
> is:
>
> for line in sys.stdin.readlines():
> # handle the line
>
> I tend to use xreadlines() which does not read the entire input at once.
> For stdin this
On Mar 1, 2005, at 22:08, Nick Lunt wrote:
The way I did this was to use sys.stdin.readlines() to get the output
from the pipe.
Here is the program:
[code]
import sys, glob
args = sys.stdin.readlines() # found on the net
pat = sys.argv[1]
for i in args:
if (i.find(pat) != -1):
Nick Lunt wrote:
The way I did this was to use sys.stdin.readlines() to get the output
from the pipe.
Here is the program:
[code]
import sys, glob
args = sys.stdin.readlines() # found on the net
pat = sys.argv[1]
for i in args:
if (i.find(pat) != -1):
print i,
[/code]
My que
Hi folks,
I've been pondering how to get python to read from a pipe outside of
itself, sort of.
For example I tried a simple python prog to do a grep, eg
# ps -e | myprog.py cron
would give this output
3778 ?00:00:00 crond
same as
# ps -e | grep cron
The way I did this was to use sy
> programs that help me automate updating my website:
> - to invoke a players' ranking program,
> - to convert text files to php formats,
> - ...
>
> I would like to go even further and employ Tkinter to:
If you want to put Tkinter on your web site then you probably will
be dissapointed. If you
--- Mark Kels <[EMAIL PROTECTED]> wrote:
> Can anyone give me a very simple example on thread
> programming ?
> I looked at some tutorials but they don't really
> make sense...
>
>
> Thanks in advance
> --
> 1. The day Microsoft makes something that doesn't
> suck is probably the
> day they st
Andrzej Kolinski wrote:
I would like to go even further and employ Tkinter to:
- open and run a C and/or Python code (including arguments where
necessary),
- name and save generated html/php files.
The only thing I found is the following line of code:
filemenu.add_command(label="Open...", command
On Tue, 1 Mar 2005 12:52:57 +0100
Ewald Ertl <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Perhaps this could help you:
>
> fileContent=open( "my/file/to/read", "r").readlines()
>
> for line in fileContent:
> print line.strip() # remove leading and trailing whitspace's incl. \n
>
>
> In the l
I need to check if a user is in a domain from a computer that is not in a
domain. Currently, we are running an NT domain, but will be moving to
ActiveDirectory2003 in the next few months.
I thought if I could get user information for the user I could verify that
the user account existed:
#COD
Hi
on Tue, 1 Mar 2005 15:31:10 + Adam Cripps <[EMAIL PROTECTED]> wrote :
-
Adam Cripps > >
Adam Cripps > Thanks Ewald - this is what I have so far, with a far from
perfect result:
Adam Cripps >
On Tue, 1 Mar 2005 15:31:10 +, Adam Cripps <[EMAIL PROTECTED]> wrote:
> On Tue, 1 Mar 2005 15:30:02 +, Adam Cripps <[EMAIL PROTECTED]> wrote:
> > On Tue, 1 Mar 2005 12:52:57 +0100, Ewald Ertl <[EMAIL PROTECTED]> wrote:
> > > Hi!
> > >
> > > Perhaps this could help you:
> > >
> > > fileConte
On Tue, 1 Mar 2005 15:30:02 +, Adam Cripps <[EMAIL PROTECTED]> wrote:
> On Tue, 1 Mar 2005 12:52:57 +0100, Ewald Ertl <[EMAIL PROTECTED]> wrote:
> > Hi!
> >
> > Perhaps this could help you:
> >
> > fileContent=open( "my/file/to/read", "r").readlines()
> >
> > for line in fileContent:
> >
My apologies for leaving Subject
entry unchanged :-).
_/_/ _/ _/
_/ _/ _/ _/
_/_/_/_/ _/ _/
_/ _/ _/ _/
_/ _/ _/ _/
Andrzej Kolinski
- Forwarded by Andrzej
Kolinski/NRI on 01/03/2005 10:12 AM -
Andrzej Kolinski <[EMAIL PROTECTED]>
On my way to write my own scripts from
scratch I'm still assembling bits and pieces from everywhere in the Python
universe to create little programs that help me automate updating my website:
- to invoke a players' ranking program,
- to convert text files to php formats,
- ...
I would like to go
Can anyone give me a very simple example on thread programming ?
I looked at some tutorials but they don't really make sense...
Thanks in advance
--
1. The day Microsoft makes something that doesn't suck is probably the
day they start making vacuum cleaners.
2. Unix is user friendly - it's just
Kevin schrieb:
I just started getting in to python and for taking a look at the for
loop. I want to print out a box
of O's 10o chars long by 10 lines long this is what I came up with. Is
there a better way to do
this:
j = 'O'
for i in j*10:
print i * 100
Thanks
Kevin
Hi Kevin,
I don't know,
Bill Kranec wrote:
Hello,
So I think that I've 'completed' my first real Python program, and I
would appreciate any constructive criticism you all could offer. The
program deals with a question that my Dad asked me awhile ago, which was
"If twelve people want to divide into teams of two and pla
> R. Alan Monroe wrote:
>> I started writing a program to parse the headers of truetype fonts to
>> examine their family info. But I can't manage to print out the strings
>> without the zero bytes in between each character (they display as a
>> black block labeled 'NUL' in Scite's output pane)
>>
Hi!
Perhaps this could help you:
fileContent=open( "my/file/to/read", "r").readlines()
for line in fileContent:
print line.strip() # remove leading and trailing whitspace's incl. \n
In the loop you could perhaps populate the entry-widgets.
HTH
Ewald
on Tue, 1 Mar 2005 09:22:0
R. Alan Monroe wrote:
I started writing a program to parse the headers of truetype fonts to
examine their family info. But I can't manage to print out the strings
without the zero bytes in between each character (they display as a
black block labeled 'NUL' in Scite's output pane)
I tried:
stuf
> R. Alan Monroe wrote:
>> I started writing a program to parse the headers of truetype fonts to
>> examine their family info. But I can't manage to print out the strings
>> without the zero bytes in between each character (they display as a
>> black block labeled 'NUL' in Scite's output pane)
>>
I'm writing an application which has rows of Entry fields (created in
a loop - see previous thread; and thanks guys!). All the content of
the Entry fields are accessed through self.contentlist[i].get()
Now I'm trying to save the content of those fields in a friendly
format. I've used pickle in the
39 matches
Mail list logo