[Tutor] Saving command line keyed input?

2005-10-19 Thread CPIM Ronin
I know that one should use IDLE or a choosen editor for any substantial 
Python coding! However, if one  happens to have written some interesting 
doodlings on the regular command line interface (under Windows XP in my 
case), is there an easy way to save ALL input to date into a selected file?

For example:
>>>class work_center:
 def __init__(self,x_name):
self.name = x_name

>>>x = work_center("machine press")
>>>

  ---  What do I do to save the above work into a file named "mywork.py"

Thanks.

RC

_
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help(!) with OOP/Composition from "Learning Python"

2005-10-24 Thread CPIM Ronin

I've been reading about composition vs inheritance, and went back to
"Learning Python" to look at something I found very confusing a year
ago.  Turns out I still find it very confusing :)


Try this example ecology simulation by Kirby Urner:

http://mail.python.org/pipermail/edu-sig/2000-April/000306.html

It does have a bug or two in it, but I was able to find and fix them by 
myself. But the bugs are discussed here if you get stuck:


http://mail.python.org/pipermail/edu-sig/2003-March/002742.html

and here:

http://mail.python.org/pipermail/edu-sig/2003-March/002744.html

Still, simple as it is, it gave me a much more profound grasp of Python 
based OOP than any of Learning Python's examples. I suspect the following 
book might be superb for leaning OOP:


Game Programming With Python (Game Development Series) (Paperback) by Sean 
Riley


In short, study actual simulations (of which games are a major subset)!

RC

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] IDLE error msgs and line continuations?

2005-10-27 Thread CPIM Ronin
When using IDLE, after hitting F5 to save and run, if an error occurs, it 
merely flashes at the code location of the error. While I usually figure out 
what is wrong, why don't I get the detailed text error messages that the 
command line gives?

Also, I'm getting most error messages when I try line continuation for 
clarity:

 if (condition 123 and
 condition 456):

I distinctly remember Python allowing the above.

Thanks.

RC

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] simple report writing?

2005-11-07 Thread CPIM Ronin
Can someone suggest a specific tutorial strictly on report writing?

I'm able to write reports fairly easily in Python. I know the stuff like 
str(round(x,2)) where x = 3.145678 will yield 3.14. What I'm looking for is 
to be able to control left and right justification, column by column while 
using string and numeric data of variable lengths so that my reports look 
much neater.

Possibly a generalized def print_line(*x)?

Thanks.

RC

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] simple report writing?

2005-11-07 Thread CPIM Ronin
I have a list (x_list) of class data. How do I sort that list by a selected 
variable common to all members of the list?


x_list.sort(key=x_list.v_name) # doesn't work becuase x_list can't see the 
individual items.


RC

_
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] simple report writing?

2005-11-07 Thread CPIM Ronin
I neglected to mention that the list x_list was created by x_list = [] and 
then a series of x_list.append(y), where y are class instances with a 
variety of variables, one of which I want to use as a sort key.

>I have a list (x_list) of class data. How do I sort that list by a selected 
>variable common to all members >of the list?
>
>x_list.sort(key=x_list.v_name) # doesn't work becuase x_list can't see the 
>individual items.
>
>RC

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] simple report writing? -- Thanks!

2005-11-11 Thread CPIM Ronin
Yes Johan, I did! Both the report and sort suggestions worked!

Thanks to everyone who replied!

FP


>From: Johan Geldenhuys <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CPIM Ronin <[EMAIL PROTECTED]>
>CC: tutor@python.org
>Subject: Re: [Tutor]  simple report writing?
>Date: Fri, 11 Nov 2005 08:31:53 +0200
>
>Did you manage to get something that worked for you?
>Johan
>
>CPIM Ronin wrote:
>
>>Can someone suggest a specific tutorial strictly on report writing?
>>
>>I'm able to write reports fairly easily in Python. I know the stuff like 
>>str(round(x,2)) where x = 3.145678 will yield 3.14. What I'm looking for 
>>is to be able to control left and right justification, column by column 
>>while using string and numeric data of variable lengths so that my reports 
>>look much neater.
>>
>>Possibly a generalized def print_line(*x)?
>>
>>Thanks.
>>
>>RC
>>
>>_
>>Express yourself instantly with MSN Messenger! Download today - it's FREE! 
>>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>>
>>___
>>Tutor maillist  -  Tutor@python.org
>>http://mail.python.org/mailman/listinfo/tutor
>>
>>
>>

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Windows IDLE error msgs?

2005-11-12 Thread CPIM Ronin
I can get the standard Python error messages IF I execute a Python script 
via the command line OR the script I'm running from IDLE passes the initial 
syntax check and generates an execution error. However, if I have a syntax 
error that's caught in the initial syntax checking phase, IDLE merely goes 
to the particular line and highlights the line where the error was detected. 
How do I get IDLE to say specifically what's wrong?


I'm running the latest version: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) 
under XP.


Thanks.

RC

_
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] [tutor] Python magazines?

2005-12-16 Thread CPIM Ronin
Is there a monthly Python hardcopy magazine? Otherwise what general 
programming mags carry the most python articles?

Thx!

RC

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Linux Python install?

2006-01-23 Thread CPIM Ronin
Sorry to bother the list with so simple a question but on moving to Linux 
from Windows XP,  it's not clear to me how to accomplish a Python install on 
Linux. On XP it was mostly point and click on a ".msi" file (with msi 
standing for Microsoft install). I've loaded the latest Fedora/Redhat 
release on an old AMD machine. How do I install Python such that it shows up 
as a selection under the Programming task bar with EMACS?

I assume I have to do this under root, right?

Step by step please.

Thanks.

_
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Linux Python install?

2006-01-24 Thread CPIM Ronin
Thanks for the responses gentalmen and apologies! It seems that Python IS 
included in Fedora but is not explicitly seen (as it is in Windows XP) as a 
desktop icon. It can be accessed by from the terminal by simply typing 
Python.


RC



From: Python <[EMAIL PROTECTED]>
To: CPIM Ronin <[EMAIL PROTECTED]>
CC: Tutor Python 
Subject: Re: [Tutor]  Linux Python install?
Date: Mon, 23 Jan 2006 10:06:24 -0500

On Mon, 2006-01-23 at 09:28 -0500, CPIM Ronin wrote:
> Sorry to bother the list with so simple a question but on moving to 
Linux
> from Windows XP,  it's not clear to me how to accomplish a Python 
install on

> Linux. On XP it was mostly point and click on a ".msi" file (with msi
> standing for Microsoft install). I've loaded the latest Fedora/Redhat
> release on an old AMD machine. How do I install Python such that it 
shows up

> as a selection under the Programming task bar with EMACS?

I assume you are using yum for package management.  It should have been
installed by default.  As root, you can issue the command
yum install python python-docs python-devel python-tools

The package yumex provides a GUI interface to the yum package manager.
You can think of yumex as the Windows "Add/Remove Programs" application
on steroids.
yum install yumex

The yumex install view with a filter of
python
will provide an extensive list of additional python packages.

Finally, I do not know if this includes the best python integration with
EMACS.

> I assume I have to do this under root, right?
>
> Step by step please.
>
> Thanks.
>
> _
> Dont just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
--
Lloyd Kvam
Venix Corp



_
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python media player?

2006-05-08 Thread CPIM Ronin
Is there such a thing as a Python coded media player? I'm having troble with 
my Windows Media Player playing commercial DVDs and can't fathom why it 
should be so difficult to debug. I'm hoping the logic would be much clearer 
in Python.

RC

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor