[Tutor] Python Regex References

2013-01-08 Thread Devyn Collier Johnson
I am trying to convert the SED code below to Python3.3. How do I reference the value of the first and second wildcards so that I can put the variable values in the "replace" portion of the code? SED (this works): export DATA=$(echo "$DATA" | sed -r -e "s|^ $|\1(>=>)\2|gI") Python3.3 (attempte

[Tutor] (no subject)

2013-01-08 Thread Dustin Guerri
Hi there, I'm completely new to Python and to programming. I have the Python Launcher (v2.7.3) app installed on my system, and I'm running Mac OS X Mountain Lion. Does this mean I have Python itself installed ? Many thanks. ___ Tutor maillist - Tuto

[Tutor] Python Regex References

2013-01-08 Thread Devyn Collier Johnson
I am trying to convert the SED code below to Python3.3. How do I reference the value of the first and second wildcards so that I can put the variable values in the "replace" portion of the code? SED (this works): export DATA=$(echo "$DATA" | sed -r -e "s|^ $|\1(>=>)\2|gI") Python3.3 (attempte

[Tutor] help

2013-01-08 Thread Mike G
Hi Randy > I am an older newbie teaching myself Python programming. > Me too :) > My problem is I hear no system bell; the enter doesn't respond by quitting > the program; > The problem with the program code the enter key hasn't worked in earlier > programs. > > I appreciate any advice I may r

Re: [Tutor] writing effective unittests

2013-01-08 Thread Japhy Bartlett
The general idea is to write tests that use your code in realistic ways and check the results. So if you have a function that takes an input and returns a result, you write a test that passes that function an input checks the result. If some inputs should make it error, you write a test that chec

[Tutor] modifying global within function without declaring global

2013-01-08 Thread Nathaniel Huston
As far as I understood, this shouldn't be possible. this is python 2.7 weirdness is in deal() at the end import random class card:     def __init__(self, suit, rank, name):     self.suit = suit     self.rank = rank     self.name =

[Tutor] Python Question

2013-01-08 Thread Dylan Kaufman
Greetings, I take Computer Science in school and for a Python program, I have: from winsound import Beep Beep(196, 1500)#G Beep(262, 270)#C Beep(196, 200)#G Beep(165, 300)#E Beep(175, 200)#F Beep(196, 200)#G Beep(262, 550)#C Beep(196, 200)#G Beep(208, 150)#G# Beep(196, 200)#G Beep(175, 200)#F Be

[Tutor] got stuck in equation

2013-01-08 Thread usama zohad
my name is usama khan . . i am the student of civil engeering and we got assignment to make a project program on flexible pavement design using python.i know very litle about programing. still learning from tutorials. u can call me a beginner.now i need to solve this equation so that i can put

Re: [Tutor] (no subject)

2013-01-08 Thread Alan Gauld
On 16/12/12 23:09, Dustin Guerri wrote: Hi there, I'm completely new to Python and to programming. I have the Python Launcher (v2.7.3) app installed on my system, and I'm running Mac OS X Mountain Lion. Does this mean I have Python itself installed ? MacOS uses Python so you will undoubtedly

[Tutor] flushed queue

2013-01-08 Thread Alan Gauld
I just finished flushing the moderation queue. It was full of spam over the holidays but there were some genuine messages there too. You'll no doubt see the older dates. Apologies for the delayed response in dealing with these. -- Alan G Author of the Learn to Program web site http://www.alan

Re: [Tutor] modifying global within function without declaring global

2013-01-08 Thread Alan Gauld
On 05/01/13 01:27, Nathaniel Huston wrote: def deal(quantity): hand = [] for cards in range(0, quantity): hand.append(deck.pop()) return hand > #we find that the global deck has been modified within the deal() > function without including > > global deck > > #within th

Re: [Tutor] (no subject)

2013-01-08 Thread Oscar Benjamin
On 16 December 2012 23:09, Dustin Guerri wrote: > Hi there, > > I'm completely new to Python and to programming. I have the Python Launcher > (v2.7.3) app installed on my system, and I'm running Mac OS X Mountain Lion. > Does this mean I have Python itself installed ? OSX ships with a Python ins

[Tutor] Robot Radio program

2013-01-08 Thread Kirk Bailey
Simulates an old time radio station. Place program files in the numbered folders, station identifications in the ID folder, commercials in the com folder. run from the command line. directories under the program are: ID, Com, 1,2,3,4,5... ID contains station identifications. COM is commercial

Re: [Tutor] got stuck in equation

2013-01-08 Thread Oscar Benjamin
On 1 January 2013 15:47, usama zohad wrote: > my name is usama khan . . i am the student of civil engeering and we got > assignment to make a project program on flexible pavement design using > python.i know very litle about programing. still learning from tutorials. u > can call me a beginner.now

Re: [Tutor] got stuck in equation

2013-01-08 Thread Oscar Benjamin
On 9 January 2013 01:15, Oscar Benjamin wrote: > On 1 January 2013 15:47, usama zohad wrote: >> my name is usama khan . . i am the student of civil engeering and we got >> assignment to make a project program on flexible pavement design using >> python.i know very litle about programing. still le

Re: [Tutor] Python Question

2013-01-08 Thread Oscar Benjamin
On 7 January 2013 23:31, Dylan Kaufman wrote: > Greetings, > > I take Computer Science in school and for a Python program, I have: > > from winsound import Beep > [SNIP] > > When I run it at school it works great, but at home when I try to run it, it > says: > > Traceback (most recent call last):

Re: [Tutor] modifying global within function without declaring global

2013-01-08 Thread Oscar Benjamin
On 9 January 2013 01:07, Alan Gauld wrote: > On 05/01/13 01:27, Nathaniel Huston wrote: > >> def deal(quantity): >> >> hand = [] >> for cards in range(0, quantity): >> hand.append(deck.pop()) >> return hand > > >> #we find that the global deck has been modified within the d

Re: [Tutor] modifying global within function without declaring global

2013-01-08 Thread Mitya Sirenef
On Tue 08 Jan 2013 08:07:57 PM EST, Alan Gauld wrote: On 05/01/13 01:27, Nathaniel Huston wrote: def deal(quantity): hand = [] for cards in range(0, quantity): hand.append(deck.pop()) return hand > #we find that the global deck has been modified within the deal() > fu

[Tutor] using 'and ' and 'or' with integers

2013-01-08 Thread ken brockman
I was looking through some lab material from a computer course offered at UC Berkeley and came across some examples in the form of questions on a test about python. 1 and 2 and 3  answer 3 I've goggled it till i was red in the fingers, but to no avail.. Could someone be kind enuff to direct me t

Re: [Tutor] HELP- Regarding working with python

2013-01-08 Thread Gayathri S
Hi.. I would like to use Principal component analysis independent component analysis in python. Wanna know whether it will support this efficiently or not? On Wed, Jan 2, 2013 at 4:59 PM, Alan Gauld wrote: > On 02/01/13 07:20, Gayathri S wrote: > >> Hi.. >> I am using python 2.7

Re: [Tutor] using 'and ' and 'or' with integers

2013-01-08 Thread Andreas Perstinger
[Please don't send HTML to this list. Just use plain text] On 09.01.2013 07:56, ken brockman wrote: I was looking through some lab material from a computer course offered at UC Berkeley and came across some examples in the form of questions on a test about python. 1 and 2 and 3 answer 3 I've gog

Re: [Tutor] using 'and ' and 'or' with integers

2013-01-08 Thread Mitya Sirenef
On Wed 09 Jan 2013 01:56:20 AM EST, ken brockman wrote: I was looking through some lab material from a computer course offered at UC Berkeley and came across some examples in the form of questions on a test about python. 1 and 2 and 3 answer 3 I've goggled it till i was red in the fingers, but t