Re: [Tutor] reading binary files

2009-02-02 Thread jadrifter
On Mon, 2009-02-02 at 11:31 +, etrade.griffi...@dsl.pipex.com wrote: > Hi > > I am trying to read data from a file that has format > > item_name num_items item_type items > > eg > > TIME 1 0.0 > DISTANCE 10 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 > TIME 1 1.0 > DISTANCE

Re: [Tutor] Volunteer opportunities

2009-01-21 Thread jadrifter
On Wed, 2009-01-21 at 23:31 -0500, bob gailer wrote: > Depends on your knowledge of Python and (if any) CMS Pipelines. > > Testing > Design critique (devil's advocate) > Cleaning up and fine-tuning the parser > Coding built-in stages > Documentation > Financial support > > Let me know what spark

Re: [Tutor] The better Python approach

2009-01-21 Thread jadrifter
>>>a = '1234 5678 1 233 476' >>>a.split() ['1234', '5678', '1', '233', '476'] Where the '>>>' are the command prompt from python. Don't type those. A space is the default split delimiter. If you wish to use a '-' or new line feed them as strings to the split method. John On Wed, 2009-01-21 at

Re: [Tutor] calculator will not multiply

2009-01-18 Thread jadrifter
On Sun, 2009-01-18 at 10:37 -0500, David wrote: > Everything else works + - / but not * > why? > thanks > -david > > > #!/usr/bin/python > from __future__ import division > import sys > > > def add(x, y): > return x + y > def sub(x, y): > return x - y > def dev(x, y): > return x

Re: [Tutor] eval and floating point

2009-01-14 Thread jadrifter
On Thu, 2009-01-15 at 12:19 +1000, Mr Gerard Kelly wrote: > Thanks very much > > I've noticed that the eval() function gives an integer, so eval("3/2") > gives back 1. float(eval("3/2")) doesn't seem to work, any way to get a > floating point number back with eval()? > > I know you can just do ("

Re: [Tutor] strings and int()

2009-01-14 Thread jadrifter
Try eval("2*3") On Thu, 2009-01-15 at 10:14 +1000, Mr Gerard Kelly wrote: > If you have a string "6", and you do int("6"), you get the number 6. > > But if you have a string "2*3" and you do int("2*3") you get a name error. > > How do you take an expression in a string, and evaluate the expressi

Re: [Tutor] help

2009-01-11 Thread jadrifter
On Sun, 2009-01-11 at 14:01 -0800, rev pacce wrote: > I have no expierence using python. I was following a tutorial and i > kept getting a syntax error. it was >>> print "hello world!" hello > world was not coming up underneath it.. i tried to run the module but > that didnt work either. > > __

Re: [Tutor] Python debugger

2009-01-10 Thread jadrifter
Despite the name I believe Winpdb is platform independent I haven't used it myself but I looked into it while following this thread. http://winpdb.org/ John Purser On Sat, 2009-01-10 at 12:56 +0100, Michael Bernhard Arp Sørensen wrote: > It might and I'll keep it in mind. > > However, I'm not

Re: [Tutor] simple array access

2009-01-07 Thread jadrifter
On Wed, 2009-01-07 at 18:12 -0800, Artie Ziff wrote: > Hello, > > I used python list comprehension to create a grid (list of lists) of > Objects (instances of MyItem class). Can anyone make recommendations to > achieve a simple access to the elements. My attempt at array access > (like this: array

Re: [Tutor] Usage of for loop

2009-01-05 Thread jadrifter
On Mon, 2009-01-05 at 18:49 +0530, vanam wrote: > Hi all, > i am beginner to this python language and slowing learning the > language by referring docs.I am trying to understand the for loop > i.e., usage of for loop in python,unlike c where i can give condition > in python it is simple iterating o

Re: [Tutor] Top posters to tutor list for 2008

2009-01-01 Thread jadrifter
On Thu, 2009-01-01 at 09:34 -0500, Kent Johnson wrote: > For several years I have been using a simple script to find the top 20 > posters to the tutor list by web-scraping the archive pages. I thought > others might be interested so here is the list for 2008 and the script > that generates it. The

Re: [Tutor] Distinction between tuples and lists

2009-01-01 Thread jadrifter
On Thu, 2009-01-01 at 15:07 +0100, Christopher Mutel wrote: > Hello all- > > I stumbled across some discussion of why the fundamental difference > between lists and tuples is not mutability, but hetero- versus > homogeneous data, e.g. > > http://jtauber.com/blog/2006/04/15/python_tuples_are_not_j