[Tutor] The magic parentheses

2010-01-23 Thread David Hutto
Hi, This is my first post to the list, so tell me if I'm posting incorrectly. I'm creating a script, http://python.codepad.org/mHyqbJ2z that gives the area of two circles, based on their radius, and displays the difference between the two results. My problem is when the results are printed, I

Re: [Tutor] The magic parentheses

2010-01-24 Thread David Hutto
Thanks for the solutions and the quick responses. I just removed the variable and used print, I thought they would be considered the same whether as  a variable, or as a direct line, guess not. Thanks again, David ___ Tutor maillist - Tutor@py

Re: [Tutor] The magic parentheses

2010-01-24 Thread David Hutto
Re: [Tutor] The magic parentheses Sunday, January 24, 2010 9:28 PM From: "David Hutto" Add sender to Contacts To: "Alan Gauld" --- On Sun, 1/24/10, Alan Gauld wrote: > From: Alan Gauld > Subject: Re: [Tutor] The magic parentheses > To: tutor@python.org > Date

Re: [Tutor] kudos to alan

2010-01-31 Thread David Hutto
--- On Sun, 1/31/10, Woodwerks wrote: From: Woodwerks Subject: [Tutor] kudos to alan To: tutor@python.org Date: Sunday, January 31, 2010, 2:33 PM Message: 4 Date: Sun, 31 Jan 2010 11:01:19 -0500 From: "R. Alan Monroe" To:tutor@python.org Subject: Re: [Tutor] can any one help Message-ID:<46810

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Григор wrote: From: Григор Subject: [Tutor] Question about importing To: "Python Tutor" Date: Tuesday, February 2, 2010, 12:07 PM Hi all. How can I import a module which is located in the upper directory. I think the following might be what you're looking for: http://d

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Grigor Kolev wrote: From: Grigor Kolev Subject: Re: [Tutor] Question about importing To: "David Hutto" Cc: "Python Tutor" Date: Tuesday, February 2, 2010, 2:28 PM В 10:33 -0800 на 02.02.2010 (вт), David Hutto написа: > > > ---

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Grigor Kolev wrote: From: Grigor Kolev Subject: Re: [Tutor] Question about importing To: "David Hutto" Cc: "Python Tutor" Date: Tuesday, February 2, 2010, 2:54 PM В 11:47 -0800 на 02.02.2010 (вт), David Hutto написа: > > > ---

Re: [Tutor] python function to know the path of the program in execution

2010-02-05 Thread David Hutto
--- On Fri, 2/5/10, nikunj badjatya wrote: From: nikunj badjatya Subject: [Tutor] python function to know the path of the program in execution To: tutor@python.org Date: Friday, February 5, 2010, 5:08 AM Hi , Is there any python function to know the path of the python program under execution

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread David Hutto
ore the entries inserted as a result of PYTHONPATH.* > > On Fri, Feb 5, 2010 at 5:38 PM, Rohit Roger$ wrote: > >> >> sys.path[0] returns none >> >> >> >> On Fri, Feb 5, 2010 at 5:36 PM, Spoorthi wrote: >> >>> sys.path[0] should

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread David Hutto
s inserted > before the entries inserted as a result of PYTHONPATH.* > > On Fri, Feb 5, 2010 at 5:38 PM, Rohit Roger$ wrote: > >> >> sys.path[0] returns none >> >> >> >> On Fri, Feb 5, 2010 at 5:36 PM, Spoorthi wrote: >> >>> sys.path[0]

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread David Hutto
--- On Fri, 2/12/10, Hansen, Mike wrote: From: Hansen, Mike Subject: Re: [Tutor] Tutor list as pair progamming plush toy To: tutor@python.org Date: Friday, February 12, 2010, 11:55 AM > -Original Message- > From: tutor-bounces+mike.hansen=atmel@python.org > [mailto:tutor-bounc

Re: [Tutor] How to use pydoc

2010-02-26 Thread David Hutto
--- On Fri, 2/26/10, Ricardo Aráoz wrote: From: Ricardo Aráoz Subject: [Tutor] How to use pydoc To: tutor@python.org Date: Friday, February 26, 2010, 8:31 AM Checked the manuals on pydoc and wanted to try it. Must certainly be doing something wrong but I can't figure what. Here's my session :

[Tutor] Script Building

2010-03-03 Thread David Hutto
I'm new to Python, so I thought as a first project I'd create a basic script building wizard to help with my understanding of the flow, and for basic practice. The following is a outline of what I would initially like to accomplish. I've begun creating small functions, and very lightly worded

Re: [Tutor] Bowing out

2010-03-03 Thread David Hutto
--- On Wed, 3/3/10, Sander Sweers wrote: From: Sander Sweers Subject: Re: [Tutor] Bowing out To: "Kent Johnson" Cc: Tutor@python.org Date: Wednesday, March 3, 2010, 11:06 AM On 3 March 2010 14:17, Kent Johnson wrote: > After six years of tutor posts my interest and energy have waned and > I

Re: [Tutor] Understanding (Complex) Modules

2010-03-03 Thread David Hutto
--- On Wed, 3/3/10, Wayne Watson wrote: From: Wayne Watson Subject: [Tutor] Understanding (Complex) Modules To: tutor@python.org Date: Wednesday, March 3, 2010, 8:24 PM First a little preamble before my questions. Most of my work in Python has required modifying a program that uses modules

Re: [Tutor] Visual Python programming and decompilers?

2010-03-12 Thread David Hutto
--- On Fri, 3/12/10, spir wrote: > From: spir > Subject: Re: [Tutor] Visual Python programming and decompilers? > To: tutor@python.org > Date: Friday, March 12, 2010, 7:22 AM > On Fri, 12 Mar 2010 10:19:39 +0200 > Ludolph > wrote: > > > Hi Guys > > > > I posted the following message on my l

[Tutor] Command not issued until after escape from loop

2010-03-14 Thread David Hutto
In the following code, the portion I'm having a problem with is outlined in stars, but since the overall code was short, I included it, just in case something else might be hindering the process. When I execute the script, it shows my main window, then if I press the CKEY it's *supposed* to cal

Re: [Tutor] Command not issued until after escape from loop

2010-03-15 Thread David Hutto
--- On Mon, 3/15/10, David Hutto wrote: > From: David Hutto > Subject: Command not issued until after escape from loop > To: tutor@python.org > Date: Monday, March 15, 2010, 2:15 AM > In the following code, the portion > I'm having a problem with is outlined in stars,

Re: [Tutor] Command not issued until after escape from loop

2010-03-15 Thread David Hutto
On Mon, Mar 15, 2010 at 4:53 AM, Alan Gauld wrote: > > "David Hutto" wrote > > Caveat: I know zero about Blender... but... > I *thought* that since the code was in Python it might be the way I was executing it. I think now it might be how the other windows are up

[Tutor] Class Inheritance

2010-04-22 Thread David Hutto
Hello List! While experimenting with Tkinter(python2.6), when from Tkinter import* is used I came across the following error: C:\Users\ascent>c:\python26/Script3.py Traceback (most recent call last): File "C:\python26\Script3.py", line 1, in from Tkinter import * File "C:\Pyt

[Tutor] Class Inheritance, Beat it into the Ground

2010-04-23 Thread David Hutto
In previous post I asked about turtle module importing from tkinter. But what I don't understand is why does Tkinter default it's casnvas to ScrolledCanvas in turtle.py, and then as a 'metaclass' for ScrolledCanvas in turtle it calls TK.Frame, which could have been set as a default within Tkinter

[Tutor] Is there a better way to use scientific notation in an equation?

2010-05-02 Thread David Hutto
In the following code I'm trying to do basic calculations with coulumb's law #Coulombs Law ''' F = (9*(10**9)) * (Q1*Q2) / (d**2) ''' base = 10 Q1mult = raw_input('First enter multiplier of base 10 charge/coloumb(Q1):') Q1exp = raw_input('Now enter exponent of base 10(Q1):') Q1 = int(Q1mult)*(10**

Re: [Tutor] Question

2010-06-19 Thread David Hutto
On Sat, Jun 19, 2010 at 7:24 AM, ALAN GAULD wrote: > > >> belt, then go ahead and learn anything else you like. But even then, if you >> have >> to learn two new ones at the same time, I'd recommend they be very unlike. >> So you could learn Lisp or Forth at the same time as you were learning Rub

Re: [Tutor] Question

2010-06-19 Thread David Hutto
On Sat, Jun 19, 2010 at 4:56 AM, Steven D'Aprano wrote: > On Sat, 19 Jun 2010 01:55:05 pm Independent Learner wrote: > >> ~I was wondering if I should try to learn 2 programming languages at >> once, Python and C++. > > I don't know. That depends on you. > > How much time do you have to spend on l

Re: [Tutor] Running external commands from Python

2010-06-25 Thread David Hutto
On Fri, Jun 25, 2010 at 8:16 PM, Steven D'Aprano wrote: > On Sat, 26 Jun 2010 08:46:17 am Randy Kao wrote: >> Hi all, >> >> I'm a newbie to Python (switching from Perl) and had a question about >> the best way to run external commands in Python. > [...] >> through: os.popen, os.popen2, os.popen3,

Re: [Tutor] Running external commands from Python

2010-06-25 Thread David Hutto
On Fri, Jun 25, 2010 at 9:37 PM, Randy Kao wrote: > Thanks for the great and quick feedback from everyone! > That definitely clears things up. > -Randy > On Fri, Jun 25, 2010 at 5:16 PM, Steven D'Aprano > wrote: >> >> On Sat, 26 Jun 2010 08:46:17 am Randy Kao wrote: >> > Hi all, >> > >> > I'm a n

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-28 Thread David Hutto
On Mon, Jun 28, 2010 at 8:32 PM, Steven D'Aprano wrote: > On Mon, 28 Jun 2010 10:52:03 am Richard D. Moores wrote: >> On Sun, Jun 27, 2010 at 16:25, Steven D'Aprano > wrote: >> > On Mon, 28 Jun 2010 03:07:47 am Richard D. Moores wrote: >> >> A "feature" very important to me >> >> is that with Gma

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-29 Thread David Hutto
On Tue, Jun 29, 2010 at 3:48 AM, Alan Gauld wrote: > > "David Hutto" wrote > >> > fundamentally different from "downloading", and those who know > that >> > the >> > only difference is that with streaming, the browser deletes the > vi

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-29 Thread David Hutto
On Tue, Jun 29, 2010 at 11:11 AM, Alan Gauld wrote: > "David Hutto" wrote > >> > Or if the network is shared with other users or other applications >> >> So, the bandwidth supplied(better question for my own ISP) is like a >> drop cord, even with al

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-30 Thread David Hutto
On Wed, Jun 30, 2010 at 3:06 AM, ALAN GAULD wrote: > > >> > If its a typical ADSL line it will be conneced to a DSLAM at >> > the centeral office(by the telco) and  that will be shareed. >> >> > ADSL also loses bandwidth the further you are from the office > >> process has to be diversified for ea

[Tutor] Reading a file

2010-07-02 Thread David Hutto
In the code below, I'm trying to read from a file, and print out the lines. I know I've seen the exact function I'm looking for here, but it seems like the below 'should' work. The second function(rdfil) works, if just the line number is placed there, and th first(increment) works for printing a n

Re: [Tutor] Reading a file

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 11:31 AM, Steven D'Aprano wrote: > On Fri, 2 Jul 2010 11:16:02 pm David Hutto wrote: >> In the code below, I'm trying to read from a file, and print out the >> lines. > > f = open("filename.txt") > for line in f: >    print lin

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 8:56 PM, Jeff Johnson wrote: > On 07/02/2010 05:35 PM, Chris C. wrote: > > Hi Jeff, thank for your reply!  I’m aware of Dabo and was pretty much sold > on using it until the last couple of days.  I was trying to install it so I > could start connecting to my tables when I ra

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:27 PM, Jeff Johnson wrote: > On 07/02/2010 06:14 PM, David Hutto wrote: >> >> Stick to the main python libraries(python with sqllite, and for the >> standalone exe know it's somewhere, and I've seen it in the past few >> days, but d

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:31 PM, David Hutto wrote: > On Fri, Jul 2, 2010 at 9:27 PM, Jeff Johnson wrote: >> On 07/02/2010 06:14 PM, David Hutto wrote: >>> >>> Stick to the main python libraries(python with sqllite, and for the >>> standalone exe know it'

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:44 PM, Jeff Johnson wrote: > On 07/02/2010 06:32 PM, David Hutto wrote: >> >> On Fri, Jul 2, 2010 at 9:31 PM, David Hutto  wrote: >> >>> >>> Well, it was mainly that he said he was a beginner and was only using >>>

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson wrote: > On 07/02/2010 06:51 PM, David Hutto wrote: >> >> In the end, there might be so many packages, I might not be able to >> handle it all(for my own uses). But, I would think, you would agree >> that a simple account ba

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 10:01 PM, David Hutto wrote: > On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson wrote: >> On 07/02/2010 06:51 PM, David Hutto wrote: >>> >>> In the end, there might be so many packages, I might not be able to >>> handle it all(for my own

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 10:07 PM, David Hutto wrote: > On Fri, Jul 2, 2010 at 10:01 PM, David Hutto wrote: >> On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson wrote: >>> On 07/02/2010 06:51 PM, David Hutto wrote: >>>> >>>> In the end, there might b

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 10:10 PM, David Hutto wrote: > On Fri, Jul 2, 2010 at 10:07 PM, David Hutto wrote: >> On Fri, Jul 2, 2010 at 10:01 PM, David Hutto wrote: >>> On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson wrote: >>>> On 07/02/2010 06:51 PM, David Hutto wrote:

Re: [Tutor] Python Documentation Clarification

2010-07-12 Thread David Hutto
On Mon, Jul 12, 2010 at 10:49 AM, Huy Ton That wrote: > This is going to sound silly, but I realized there are some areas within the > documentation that do not make absolute sense to me. > e.g. > compile(source, filename, mode[, flags[, dont_inherit]]) > I see within this built in function, the f

Re: [Tutor] Request for help learning the right way to deal with lists in lists

2010-07-12 Thread David Hutto
On Mon, Jul 12, 2010 at 9:45 PM, Eric Hamiter wrote: > I'm fairly new to programming and Python as well, but I have a suggestion > that may be worth looking into-- are you familiar with pickling? It sounds > like something that may fit in well with what you're trying to do. > > Good reference art

Re: [Tutor] Response to responses about list of lists: a meta exercise in mailinglist recursion

2010-07-13 Thread David Hutto
On Tue, Jul 13, 2010 at 8:40 AM, Siren Saren wrote: > I'm not sure if there's a way to submit responses 'live' or whether it's > better to respond to subthreads at once or together, so I'll err on the side > of discretion and just send one response. Thanks to each of you who tried > to help me.

Re: [Tutor] Response to responses about list of lists: a meta exercise in mailinglist recursion

2010-07-13 Thread David Hutto
On Tue, Jul 13, 2010 at 1:20 PM, David Hutto wrote: > > > On Tue, Jul 13, 2010 at 8:40 AM, Siren Saren wrote: > >> I'm not sure if there's a way to submit responses 'live' or whether it's >> better to respond to subthreads at once or together,

Re: [Tutor] Python Book recomandation!

2010-07-15 Thread David Hutto
On Thu, Jul 15, 2010 at 5:22 PM, Eric Hamiter wrote: > Hi Daniel, > > As a fellow complete beginner, I have actually started a web site that > details just this. I'm learning as I go and have tried to put together > a curriculum of sorts that will helpfully guide other newbies as well, > and reinf

Re: [Tutor] [OT] Confusion [was Re: A file containing a string of 1 billion random digits.]

2010-07-19 Thread David Hutto
On Mon, Jul 19, 2010 at 8:57 PM, Steven D'Aprano wrote: > On Tue, 20 Jul 2010 01:42:51 am Richard D. Moores wrote: > >> The formatting operations described here are obsolete and may go away >> in future versions of Python. Use the new String Formatting in new >> code. >> >> I hope that use of '*'

Re: [Tutor] Difficulty Understanding Example Code for Blender Script

2010-07-22 Thread David Hutto
On Thu, Jul 22, 2010 at 2:47 AM, Marc Tompkins wrote: > On Wed, Jul 21, 2010 at 9:48 PM, Andrew Martin > wrote: >> >> This code was part of a Blender script to build a 3d bar graph, so I don't >> know if understanding Blender is a prereq for understanding this code. The >> function is for the axi

Re: [Tutor] Running .py files in shell

2010-07-28 Thread David Hutto
On Wed, Jul 28, 2010 at 2:39 AM, Kevin Rapley wrote: > >>> I am running Mac OSX v10.6.4 Snow Leopard >>> I am running Python 2.6.1 >> >> In general get the MacPython distributions of Python etc, they usually >> install easier (ie from the GUI) than the "Unix" based versions. > > Okay, thanks. I wi

[Tutor] Order Of Operations Question

2010-07-28 Thread David Hutto
From a practice exercise in Building Skills In Python page 64 I'm working on How Much Does The Atmosphere Weigh? Part 1: To check it states that the answer should be app. 10**18kg However, and I've checked to make sure that the math I've layed out matches up with the texts, I get 5.07360705863e+20

Re: [Tutor] Order Of Operations Question

2010-07-28 Thread David Hutto
On Wed, Jul 28, 2010 at 6:11 AM, Evert Rol wrote: > Sorry, forgot to reply-to-all: > > > I don't know the book nor the exercise, but see my comments interspersed in > the code, and a few general remarks at the bottom > >> From a practice exercise in Building Skills In Python page 64 I'm >> workin

Re: [Tutor] Order Of Operations Question

2010-07-28 Thread David Hutto
On Wed, Jul 28, 2010 at 6:19 AM, Hugo Arts wrote: > On Wed, Jul 28, 2010 at 11:41 AM, David Hutto wrote: >> From a practice exercise in Building Skills In Python page 64 I'm >> working on How Much Does The Atmosphere Weigh? Part 1: >> To check it states that the answ

Re: [Tutor] Order Of Operations Question

2010-07-28 Thread David Hutto
On Wed, Jul 28, 2010 at 7:35 PM, Hugo Arts wrote: > On Thu, Jul 29, 2010 at 1:10 AM, David Hutto wrote: >> I get this with yours and Evert's modification from mult to div, but >> if you're right, then the 10e18 the book states as a checker is a >> typo/error. &

Re: [Tutor] Order Of Operations Question

2010-07-28 Thread David Hutto
On Wed, Jul 28, 2010 at 8:03 PM, Dave Angel wrote: > > > David Hutto wrote: >> >> >> I'll probably ending up reading something about it later in the book, >> but as a quick question, why does: >> >> >>>>> >>>>> 5e18

[Tutor] A better way for greatest common divisor

2010-07-29 Thread David Hutto
This is basically to get feedback, on a better way to show the greatest common divisor in fraction, in order to reduce it fully, than the one I've come up with. I'm sure there are better ways, so if you have simpler method, or critique of what I've done, let me know. '''Greatest Common Divisor Fu

Re: [Tutor] A better way for greatest common divisor

2010-07-29 Thread David Hutto
On Thu, Jul 29, 2010 at 10:36 PM, James Mills wrote: > On Fri, Jul 30, 2010 at 12:22 PM, Richard D. Moores > wrote: >> On Thu, Jul 29, 2010 at 19:10, James Mills >> wrote: >>> On Fri, Jul 30, 2010 at 11:47 AM, David Hutto wrote: >>>> This is basically t

Re: [Tutor] A better way for greatest common divisor

2010-07-29 Thread David Hutto
On Thu, Jul 29, 2010 at 10:16 PM, James Mills wrote: > On Fri, Jul 30, 2010 at 12:10 PM, James Mills > wrote: >> def gcd(a, b): >>    while b != 0: >>        (a, b) = (b, a%b) >>    return a That was pretty short, and sweet. > > Here's another solution that uses a generator called factors to >

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 2:57 PM, Richard D. Moores wrote: > On Thu, Jul 29, 2010 at 18:47, David Hutto wrote: >> This is basically to get feedback, on a better way to show the >> greatest common divisor in fraction, in order to reduce it fully, than >> the one I've co

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 10:25 PM, Richard D. Moores wrote: > On Fri, Jul 30, 2010 at 17:43, David Hutto wrote: >> This is the url: >> http://python.pastebin.com/fP3jjqGj > > This is a slight revision, with my suggested changes highlighted: > <http://python.pastebin.co

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 10:42 PM, David Hutto wrote: > On Fri, Jul 30, 2010 at 10:25 PM, Richard D. Moores > wrote: >> On Fri, Jul 30, 2010 at 17:43, David Hutto wrote: >>> This is the url: >>> http://python.pastebin.com/fP3jjqGj >> >> This is a

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 10:25 PM, Richard D. Moores wrote: > On Fri, Jul 30, 2010 at 17:43, David Hutto wrote: >> This is the url: >> http://python.pastebin.com/fP3jjqGj > > This is a slight revision, with my suggested changes highlighted: > <http://python.pastebin.co

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 10:43 PM, David Hutto wrote: > On Fri, Jul 30, 2010 at 10:25 PM, Richard D. Moores > wrote: >> On Fri, Jul 30, 2010 at 17:43, David Hutto wrote: >>> This is the url: >>> http://python.pastebin.com/fP3jjqGj >> >> This is a

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 10:44 PM, David Hutto wrote: > On Fri, Jul 30, 2010 at 10:43 PM, David Hutto wrote: >> On Fri, Jul 30, 2010 at 10:25 PM, Richard D. Moores >> wrote: >>> On Fri, Jul 30, 2010 at 17:43, David Hutto wrote: >>>> This is the url: >

Re: [Tutor] Python - RPG Combat System

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 10:49 PM, Jason MacFiggen wrote: > I am have trouble figuring out how to make my program stop at 0 hit > points if I run it, it always goes into the negative hitpoints... > > So my question is how do I make this program end at exactly 0 hit points > every time instead o

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 11:51 PM, Steven D'Aprano wrote: > On Sat, 31 Jul 2010 01:03:27 pm David Hutto wrote: > >> This fixes the floating point 'bug' when numerator is greater than >> denominator: http://python.pastebin.com/bJ5UzsBE > > I don't

Re: [Tutor] A better way for greatest common divisor

2010-07-30 Thread David Hutto
On Sat, Jul 31, 2010 at 12:37 AM, David Hutto wrote: > On Fri, Jul 30, 2010 at 11:51 PM, Steven D'Aprano wrote: >> On Sat, 31 Jul 2010 01:03:27 pm David Hutto wrote: >> >>> This fixes the floating point 'bug' when numerator is greater than >>>

Re: [Tutor] A better way for greatest common divisor

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 12:43 AM, David Hutto wrote: > On Sat, Jul 31, 2010 at 12:37 AM, David Hutto wrote: >> On Fri, Jul 30, 2010 at 11:51 PM, Steven D'Aprano >> wrote: >>> On Sat, 31 Jul 2010 01:03:27 pm David Hutto wrote: >>> >>>> Thi

Re: [Tutor] A better way for greatest common divisor

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 3:39 AM, David Hutto wrote: > On Sat, Jul 31, 2010 at 12:43 AM, David Hutto wrote: >> On Sat, Jul 31, 2010 at 12:37 AM, David Hutto wrote: >>> On Fri, Jul 30, 2010 at 11:51 PM, Steven D'Aprano >>> wrote: >>>> On Sa

Re: [Tutor] Python - RPG Combat System

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 1:51 PM, bob gailer wrote: > On 7/30/2010 10:49 PM, Jason MacFiggen wrote: >> >> what can I do instead of writing print so many times? >> import random >>    my_hp = 50 >>    mo_hp = 50 >>    my_dmg = random.randrange(1, 20) >>    mo_dmg = random.randrange(1, 20) >>    whil

Re: [Tutor] Writing scripts and apps for Internet consumption

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 2:27 PM, Eric Hamiter wrote: > Not sure if this is the right place for this, since this is a tutor list, > but I think it is because it involves learning Python and the application of > knowledge. > > I've just started learning it as my initial programming language as of tw

Re: [Tutor] Writing scripts and apps for Internet consumption

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 2:34 PM, David Hutto wrote: > On Sat, Jul 31, 2010 at 2:27 PM, Eric Hamiter wrote: >> Not sure if this is the right place for this, since this is a tutor list, >> but I think it is because it involves learning Python and the application of >> knowl

Re: [Tutor] Simple Python Program

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 2:35 PM, bob gailer wrote: > On 7/31/2010 12:00 AM, Jason MacFiggen wrote: > > Can anyone tell me how to fix the errors I am getting if possible? I'm quite > new and so confused... > > > I could give lots of diagnostic advice and detail. There is so much wrong > with this p

Re: [Tutor] Writing scripts and apps for Internet consumption

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 2:45 PM, Eric Hamiter wrote: >> Get a linux hosting account, and a web address, most linux hosting >> comes with python, so practice in the 'cloud'. > > I have that-- an account with Dreamhost. This hasn't solved my problems yet > though. Like I said, I can have it write a

Re: [Tutor] Writing scripts and apps for Internet consumption

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 2:56 PM, David Hutto wrote: > On Sat, Jul 31, 2010 at 2:45 PM, Eric Hamiter wrote: >>> Get a linux hosting account, and a web address, most linux hosting >>> comes with python, so practice in the 'cloud'. >> >> I have that-- an

Re: [Tutor] Where to start with Unit Testing

2010-08-01 Thread David Hutto
On Sun, Aug 1, 2010 at 12:18 PM, Che M wrote: > > >> Do any of you have any feedback, strategies and best practices >> related to unit testing within Python. This is a relatively new topic >> for me. I was thinking of starting with reading the documentation >> associate with the unittest module. >

Re: [Tutor] web-based python?

2010-08-01 Thread David Hutto
On Sun, Aug 1, 2010 at 7:38 PM, Eric Hamiter wrote: > On Sun, Aug 1, 2010 at 1:56 PM, Che M wrote: >> >> For a long time I have hoped for a "Python web apps for absolute >> beginners" >> tutorial that doesn't assume any knowledge.  For a beginner, it is not >> even >> clear what a "web frameworks

Re: [Tutor] Where to start with Unit Testing

2010-08-01 Thread David Hutto
On Sun, Aug 1, 2010 at 9:11 PM, Che M wrote: > > >> > The idea of unit testing/test driven development has remained >> > foreign to me throughout my time trying to learn Python--by choice. >> > I want to make desktop GUI applications and I don't use MVC, so >> > the idea of writing tests strikes m

Re: [Tutor] Where to start with Unit Testing

2010-08-01 Thread David Hutto
On Sun, Aug 1, 2010 at 9:31 PM, David Hutto wrote: > On Sun, Aug 1, 2010 at 9:11 PM, Che M wrote: >> >> >>> > The idea of unit testing/test driven development has remained >>> > foreign to me throughout my time trying to learn Python--by choice. >>&g

Re: [Tutor] Where to start with Unit Testing

2010-08-01 Thread David Hutto
On Sun, Aug 1, 2010 at 9:39 PM, David Hutto wrote: > On Sun, Aug 1, 2010 at 9:31 PM, David Hutto wrote: >> On Sun, Aug 1, 2010 at 9:11 PM, Che M wrote: >>> >>> >>>> > The idea of unit testing/test driven development has remained >>>> > fo

Re: [Tutor] Menu not working properly

2010-08-02 Thread David Hutto
On Mon, Aug 2, 2010 at 8:00 AM, Evert Rol wrote: >> Hello Evert Rol, >>           Thank you for the menu help, I have completed it with great >> success... There is 1 more problem I am currently having, and when I fix it >> my program will be completed. If you are interested in helping me with t

Re: [Tutor] Menu not working properly

2010-08-02 Thread David Hutto
On Mon, Aug 2, 2010 at 10:41 AM, Luke Paireepinart wrote: > > > On Aug 2, 2010, at 8:13 AM, David Hutto wrote: > >> On Mon, Aug 2, 2010 at 8:00 AM, Evert Rol wrote: >>>> Hello Evert Rol, >>>>           Thank you for the menu help, I have completed it w

Re: [Tutor] How to get script to detect whether a file exists?

2010-08-02 Thread David Hutto
On Mon, Aug 2, 2010 at 8:53 PM, Richard D. Moores wrote: > On Mon, Aug 2, 2010 at 16:57, Steven D'Aprano wrote: >>  # File *probably* doesn't exist. Consider better error checking. > > Steve, before I dig into your detailed reply, please tell me what you > meant by " # File *probably* doesn't exi

Re: [Tutor] How to get script to detect whether a file exists?

2010-08-02 Thread David Hutto
On Tue, Aug 3, 2010 at 12:05 AM, David Hutto wrote: > On Mon, Aug 2, 2010 at 8:53 PM, Richard D. Moores wrote: >> On Mon, Aug 2, 2010 at 16:57, Steven D'Aprano wrote: >>>  # File *probably* doesn't exist. Consider better error checking. >> >> Steve, befor

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-05 Thread David Hutto
On Thu, Aug 5, 2010 at 7:33 PM, Wayne Watson wrote: > It's been awhile since I've used python, and I recall there is a way to find > the version number from the IDLE command line  prompt. dir, help, > __version.__? > > I made the most minimal change to a program, and it works for me, but not my >

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-05 Thread David Hutto
On Thu, Aug 5, 2010 at 8:53 PM, David Hutto wrote: > On Thu, Aug 5, 2010 at 7:33 PM, Wayne Watson > wrote: >> It's been awhile since I've used python, and I recall there is a way to find >> the version number from the IDLE command line  prompt. dir, help, >> _

Re: [Tutor] modify csv textfile

2010-08-07 Thread David Hutto
On Sat, Aug 7, 2010 at 7:26 AM, Alan Gauld wrote: > > "TGW" wrote >> >> What I want to output is: >> 12345|some text|some more text|example|example32423 >> 11223|more text|and more|example|example455667 >> >> So column 4 is where the change occurs, but only if the beginning >> of the string in co

Re: [Tutor] modify csv textfile

2010-08-07 Thread David Hutto
On Sat, Aug 7, 2010 at 8:26 AM, David Hutto wrote: > On Sat, Aug 7, 2010 at 7:26 AM, Alan Gauld wrote: >> >> "TGW" wrote >>> >>> What I want to output is: >>> 12345|some text|some more text|example|example32423 >>> 11223|more text|an

Re: [Tutor] Distributing Python Code for Commercial Porpoises?

2010-08-08 Thread David Hutto
On Sun, Aug 8, 2010 at 2:41 PM, Eike Welk wrote: > Hello Alan! > > On Sunday August 8 2010 10:10:20 Alan Gauld wrote: >> Yes thats a good point. Most books (including mine) focus on how to >> write code. Very few tell you how to distrubute it! And that's not >> just >> in Python, most programming

Re: [Tutor] Distributing Python Code for Commercial Porpoises?

2010-08-09 Thread David Hutto
On Sun, Aug 8, 2010 at 7:57 PM, Steven D'Aprano wrote: > On Mon, 9 Aug 2010 04:44:37 am David Hutto wrote: > >> Four words... Software is python's propaganda. > > Four more words: please trim unnecessary quoting. No problem buddy pal.

Re: [Tutor] [SPAM]Re: O'Reilly is offering Learning Python (4th ed.), eBook form for USD 9.99

2010-08-11 Thread David Hutto
I thought the open source mentality of python was it own 'perpetual bible'. A building of disciples so to speak. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Iterating through a list of replacement regex patterns

2010-09-02 Thread David Hutto
In the below function I'm trying to iterate over the lines in a textfile, and try to match with a regex pattern that iterates over the lines in a dictionary(not {}, but turns a text list of alphabetical words into a list using readlines()). def regexfiles(filename): textfile = file(filenam

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-02 Thread David Hutto
I just added +'*' to select in re.search(select+'*', str(readfile[:])), and it now shows the same in both. But if you have any input on modifications let me know. Thanks, David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
On Thu, Sep 2, 2010 at 11:05 PM, David Hutto wrote: > I just added +'*' to select in re.search(select+'*', str(readfile[:])), > and it now shows the same in both. > > But if you have any input on modifications let me know. > > Thanks, > David > Stil

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
On Fri, Sep 3, 2010 at 2:51 PM, David Hutto wrote: > On Thu, Sep 2, 2010 at 11:05 PM, David Hutto wrote: >> I just added +'*' to select in re.search(select+'*', str(readfile[:])), >> and it now shows the same in both. >> >> But if you have any i

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
First of all, I'll respond more thoroughly tomorrow, when I can review what you said more clearly, but for now I'll clarify. Here is the whole code that I'm using: http://pastebin.com/Ak8DFjrb On Fri, Sep 3, 2010 at 9:12 PM, Steven D'Aprano wrote: > On Fri, 3 Sep 2010

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
On Fri, Sep 3, 2010 at 9:57 PM, David Hutto wrote: > First of all, I'll respond more thoroughly tomorrow, when I can review > what you said more clearly, but for now I'll clarify. > > Here is the whole code that I'm using: > > http://pastebin.com/Ak8DFjrb &

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-03 Thread David Hutto
snip I'll go further with this though, just to get the response. Hypothetically, if I wanted AI(artificial imagination), then I would want random thoughts that made sense, every once in a while. So, I hypothesize that the first step in Artificial Imagination, is random thoughts, and then they have

Re: [Tutor] Iterating through a list of replacement regex patterns

2010-09-05 Thread David Hutto
On Sat, Sep 4, 2010 at 6:16 AM, Steven D'Aprano wrote: > On Sat, 4 Sep 2010 11:57:00 am David Hutto wrote: >> First of all, I'll respond more thoroughly tomorrow, when I can >> review what you said more clearly, but for now I'll clarify. >> >> Here is

Re: [Tutor] Creating custom GUI elements

2010-09-05 Thread David Hutto
I'd suggest you take a look at blender. It has a pretty easy to use game engine with actuators, sensors and controllers, with a Python scripts api. It'll take the time out of going 3-d with pygame, and you can build the custom legos within it as well. ___

Re: [Tutor] Multiple versions of python and paths problems

2010-09-06 Thread David Hutto
On Mon, Sep 6, 2010 at 1:46 PM, Dominique wrote: > Hello, > > I usually use python 2.6 and several packages. Everything's fine. > > At present, I'm trying to run a package which is only available with python > 2.5. > So, i installed 2.5 and the various dependencies needed to run this package: > P

Re: [Tutor] Multiple versions of python and paths problems

2010-09-07 Thread David Hutto
On Tue, Sep 7, 2010 at 4:03 AM, Dominique wrote: > Alan Gauld btinternet.com> writes: > > >> How do you start IDLE? Is it via a desktop or start menu shortcut? >> If so what is the startin folder specified as? > Hello, > First, thanks to you David, Alan and Dave for your help. > > Start with shor

  1   2   3   4   >