[Tutor] Unittest traceback

2008-04-04 Thread Oleg Oltar
Hi! I am trying to use unittest in python first time. But have a strange traceback each time I run my sample tests. Can you please explain why I have it. No info about it in the doc. e.g. the code is import unittest import squaren class TestCases(unittest.TestCase): def setUp(self): p

Re: [Tutor] Unittest traceback

2008-04-04 Thread Kent Johnson
Oleg Oltar wrote: > Hi! > > I am trying to use unittest in python first time. But have a strange > traceback each time I run my sample tests. How are you running the test? My guess is that you are running it in an IDE or something that shows the normal system exit exception. Calling sys.exit(

[Tutor] Fwd: Unittest traceback

2008-04-04 Thread Oleg Oltar
-- Forwarded message -- From: Oleg Oltar <[EMAIL PROTECTED]> Date: Fri, Apr 4, 2008 at 2:49 PM Subject: Re: [Tutor] Unittest traceback To: Kent Johnson <[EMAIL PROTECTED]> Yes! Tried in command line. works fine there. Not sure howto customize my IDE correctly. I use Emacs. Thanks

[Tutor] Don't miss "Python-by-example - new online guide to Python Standard Library"

2008-04-04 Thread Dick Moores
A new one-man project, just getting started. < http://www.lightbird.net/py-by-example/> This guide aims to show examples of use of all Python Library Reference functions, methods and classes. At this point, only the more widely used modules were added and only functions use examples are given. P

[Tutor] Interactive physics simulation over web

2008-04-04 Thread Brain Stormer
I am working on a physics simulation and would like to publish it on the web. The simulation requires input fields, mouse action (picking points in a display pane) and movie like feature with play, pause, skip forward and skip backward. I was wondering if this can be done using Python and a Pytho

Re: [Tutor] Don't miss "Python-by-example - new online guide to Python Standard Library"

2008-04-04 Thread linuxian iandsd
well, good to see something like this comming ... i used to browse for hours to find nothing but long long documentation & not a single real life example... but i guess its because i m used to the old 'howto' way of ducumentation ... On Fri, Apr 4, 2008 at 2:12 PM, Dick Moores <[EMAIL PROTECTED

Re: [Tutor] Interactive physics simulation over web

2008-04-04 Thread Adam Bark
On 04/04/2008, Brain Stormer <[EMAIL PROTECTED]> wrote: > > I am working on a physics simulation and would like to publish it on the > web. The simulation requires input fields, mouse action (picking points in > a display pane) and movie like feature with play, pause, skip forward and > skip backw

Re: [Tutor] Don't miss "Python-by-example - new online guide to Python Standard Library"

2008-04-04 Thread Tim Golden
linuxian iandsd wrote: > well, good to see something like this comming ... i used to browse for hours > to find nothing but long long documentation & not a single real life > example... but i guess its because i m used to the old 'howto' way of > ducumentation ... It's one of those things; peopl

Re: [Tutor] Interactive physics simulation over web

2008-04-04 Thread Kent Johnson
Brain Stormer wrote: > I am working on a physics simulation and would like to publish it on the > web. The simulation requires input fields, mouse action (picking points > in a display pane) and movie like feature with play, pause, skip forward > and skip backward. I was wondering if this can

Re: [Tutor] Interactive physics simulation over web

2008-04-04 Thread Kent Johnson
Adam Bark wrote: > I think you can use Jython in a Java applet, that might be what you're > looking for. Yes, but it does increase the size of the download considerably since jython.jar is needed by the browser. Kent ___ Tutor maillist - Tutor@pyth

Re: [Tutor] Don't miss "Python-by-example - new online guide to

2008-04-04 Thread Julia
TECTED]> > Content-Type: text/plain; charset="us-ascii" > > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/tutor/attachments/20080404/8e49a5e0/attachment-0001.htm I really appreciate guides that cut to the core directly. Great work Moores

[Tutor] Python Newbie: Lost in Loop

2008-04-04 Thread yogi
Hi all, I ´m a Python Newbie. Just 48 hrs into Python. I am trying to parse a file which is tab spaced. head -5 of the file in question. 1 rs3094315 0 792429 1 rs6672353 0 817376 1 rs4040617 0 819185 1 rs2980300 0 8

Re: [Tutor] Python Newbie: Lost in Loop

2008-04-04 Thread Kent Johnson
yogi wrote: > Hi all, > I ´m a Python Newbie. Just 48 hrs into Python. > I am trying to parse a file which is tab spaced. You're close... > My Python code > #/bin/python > import sys, csv, re > > # This programme finds the SNPs from the range passed from > the select option > ## But f

Re: [Tutor] Don't miss "Python-by-example - new online guide to

2008-04-04 Thread Tony Cappellini
Date: Fri, 04 Apr 2008 07:12:11 -0700 From: Dick Moores <[EMAIL PROTECTED]> Subject: [Tutor] Don't miss "Python-by-example - new online guide to Python Standard Library" To: Python Tutor List Message-ID: <[EMAIL PROTECTED]> Dick- there was no url with your message. Also See Python Module

Re: [Tutor] Python Newbie: Lost in Loop

2008-04-04 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > Aside to the list: > Did anyone else know that you can assign to a list element > as the target of a for statement? Nope, and in fact I was just trying it out at the >>> prompt when your message came in! On a general point for the OP, I doubt if you n

Re: [Tutor] Python Newbie: Lost in Loop

2008-04-04 Thread Eric Walstad
Hi Yogi, welcome to Python! yogi wrote: ... > if (str(gen) == str(row[0])): > print 'Match for 16 found Is the conversion to string really necessary? Even if it is, do it once for gen, when you define it: gen = '16' so you don't have to convert on every iteration of the

Re: [Tutor] Which Python Script Editor of Choice?

2008-04-04 Thread Jeff Younker
Jeffrey Dates wrote: > So as I'm starting to get into writing some scripts, I'm looking for > recommendations for a nifty script editor. Ideally a freeware/ > shareware solution until I can justify a purchase of something more > beefy. > > Currently I'm using PSPad, however it's pretty dumb a

Re: [Tutor] Don't miss "Python-by-example - new online guide to

2008-04-04 Thread Dick Moores
At 11:26 AM 4/4/2008, Tony Cappellini wrote: Date: Fri, 04 Apr 2008 07:12:11 -0700 From: Dick Moores <[EMAIL PROTECTED]> Subject: [Tutor] Don't miss "Python-by-example - new online guide to    Python Standard Library" To: Python Tutor List Message-ID: < [EMAIL PROTECTED]> D

[Tutor] Question about global variables on modules

2008-04-04 Thread Tiago Katcipis
I know its not such a pretty thing to have global variables but its only for an exercise my teacher told to do. Its a function to calculate the results of a matrix using jacob. I want to inside the module (inside a function on the module )assign a value to a global variable, but the only way i foun

Re: [Tutor] Python Newbie: Lost in Loop

2008-04-04 Thread yogi
Hi all , Thanks for the input. I must add Kent's solution was the fastest. The actual file to parse is 12MB. Though Eric's solution was more readable ( atleast for me). Now that I have the logic and code right I have to work on the real problem. Thanks in advance, yogesh

[Tutor] Diff for Python

2008-04-04 Thread Wayne Watson
Is there a Linux diff-like command for Python code? I'd like to see the difference between two py files. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W,

Re: [Tutor] Question about global variables on modules

2008-04-04 Thread Anthony Baldwin
Tiago Katcipis wrote: > I know its not such a pretty thing to have global variables but its only > for an exercise my teacher told to do. Its a function to calculate the > results of a matrix using jacob. I want to inside the module (inside a > function on the module )assign a value to a global var

[Tutor] Code optmisation

2008-04-04 Thread yogi
Hi , Here is my first usable Python code. The code works. Here is what I'm trying to do. I have two huge text files. After some processing, One is 12M (file A) and the other 1M (file B) . The files have columns which are of interest to me. I 'm trying to match entries of column [0] on fi

Re: [Tutor] Diff for Python

2008-04-04 Thread Terry Carroll
On Fri, 4 Apr 2008, Wayne Watson wrote: > Is there a Linux diff-like command for Python code? I'd like to see the > difference between two py files. You could just use diff. Python itself also has difflib: http://python.org/doc/2.5/lib/module-difflib.html _