Re: [Tutor] Using Python with a Mac

2010-02-23 Thread Eric Dorsey
Not sure if this is what you're asking, but you can invoke the Python interpreter from the command line (Terminal) Open a new terminal, and at the $ prompt just type "python".. $ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "co

Re: [Tutor] What Editori?

2010-02-23 Thread Eric Dorsey
On any platform, I use (gui) vim (gvim on Win/Linux, mvim/macvim on OSX) with this plugin: http://www.vim.org/scripts/script.php?script_id=30 On Tue, Feb 23, 2010 at 5:40 PM, Benno Lang wrote: > On 24 February 2010 01:24, Giorgio wrote: > > what text-editor do you use for python? > > > __

Re: [Tutor] An interesting situation befalls me

2010-05-11 Thread Eric Dorsey
> On Sat, May 8, 2010 at 5:31 PM, Kirk Z Bailey wrote: >> >>> An instructor of mine is about to teach the FIRST EVER class in Python at >>> Saint Petersburg College; knowing I am a snakecharmer, he asked me for >>> referrals to online resources. >>> >>> Oh my. >>> >> > > Here is another resource, t

Re: [Tutor] IDLE vs PythonWin

2009-02-09 Thread Eric Dorsey
You can call a .py script from the command line, and it will run there. So, in Windows XP: Start > Run > type "CMD" Vista: Start > type "CMD" into the Start Search field. If you're in Linux, get to a Terminal. In Windows another window will open with something like...C:\FolderWithMyPyFile> Linux so

Re: [Tutor] Keeping Dictonary Entries Ordered

2009-02-11 Thread Eric Dorsey
>>> config_names = {'start_time': '18:00:00', 'gray_scale': True, 'long': 120.0} >>> config_names {'start_time': '18:00:00', 'gray_scale': True, 'long': 120.0} >>> for i, x in config_names.items(): ... print i, x ... start_time 18:00:00 gray_scale True long 120.0 >>> On Wed, Feb 11, 2009 at 7

Re: [Tutor] Keeping Dictonary Entries Ordered

2009-02-12 Thread Eric Dorsey
But you need to have an order that will work with sorted(). > Its not just the order you add items to the dict. To store an > arbitrary order I suspect you would need to maintain a > secondary list with the keys in the order of insertion. > The most reliable way to dop that would be to subclas

[Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-16 Thread Eric Dorsey
Greetings Tutor: I've managed to install Python 2.6 on my Ubuntu VM from source, however, it looks as though I missed something important along the way. My 2.6 interpreter does not have readline support (example: I cant hit up arrow to repeat the last command) Is there a way to add this functionali

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-18 Thread Eric Dorsey
2009 22:34:23 -0700, Eric Dorsey wrote: > > > Greetings Tutor: > > I've managed to install Python 2.6 on my Ubuntu VM from source, however, > > it looks as though I missed something important along the way. My 2.6 > > interpreter does not have readline support (ex

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-19 Thread Eric Dorsey
18 Feb 2009 20:19:56 -0700 > Eric Dorsey wrote: > > I did an aptitute install of ibreadline5-dev and then > > did ./configure and make again, and still don't have any > > functionality to be able to hit up-arrow and get a command repeated > > while inside the int

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-25 Thread Eric Dorsey
يز الباتلي wrote: > > > On Wed, 18 Feb 2009 20:19:56 -0700 > > Eric Dorsey wrote: > >> I did an aptitute install of ibreadline5-dev and then did ./configure > >> and make again, and still don't have any functionality to be able to > >> hit

Re: [Tutor] Add elements to list and display it [Very newbie question]

2009-02-27 Thread Eric Dorsey
Here is one possible implementation of your project. *Code:* #Dont use list as a variable name, its one of the reserved words. mylist = [] #realize any values captured here are strings x = raw_input('Enter num or text: ') mylist.append(x) x = raw_input('Enter num or text: ') mylist.append(x) #ou

Re: [Tutor] Tutor Digest, Vol 61, Issue 3

2009-03-01 Thread Eric Dorsey
Not sure if this is what you mean, but: Say you have the files efunc.py and trytry.py in the same folder. *The content of efunc.py is:* def funky(): print 'funkytown' *The content of trytry.py is:* import efunc efunc.funky() *Output would be:* n...@ububox:~$ python trytry.py funkytown n...@

[Tutor] Convert XML codes to "normal" text?

2009-03-03 Thread Eric Dorsey
*So here is my program, I'm pulling some information off of my Snipt feed .. * import feedparser d = feedparser.parse('http://snipt.net/dorseye/feed') x=0 for i in d['entries']: print d['entries'][x].title print d['entries'][x].summary print x+=1 *Output* Explode / Implode List

Re: [Tutor] Convert XML codes to "normal" text?

2009-03-04 Thread Eric Dorsey
Senthil, That worked like a charm, thank you for the help! Now my Snipt's are actually legible :) On Wed, Mar 4, 2009 at 12:01 AM, Senthil Kumaran wrote: > On Wed, Mar 4, 2009 at 11:13 AM, Eric Dorsey wrote: > > I know, for example, that the > code means >, but what I don&

[Tutor] Trouble understanding modifying parent class..

2009-04-13 Thread Eric Dorsey
Hi tutors, I am studying classes a bit, and am having trouble with this concept and would appreciate your help! class A: def __init__(self, name, value=1): self.name = name self.value = value And now I want a subclass, one that overrides the value=1 and defaults to value=2, h

Re: [Tutor] How to run a .py file or load a module?

2009-04-26 Thread Eric Dorsey
Dayo, I modified the code a little bit to make things work the way I think you meant it to work(hopefully), and I changed the name of the function so that its' not the same name as the python file itself, but hopefully this answers your questions. Here is my countdown.py def launchme(n): while

Re: [Tutor] run command

2009-09-04 Thread Eric Dorsey
Make sure you are in the same directory as your hello.py, then run the interpreter/shell Try this: >>>import hello then you can do things like: >>>dir(hello) and >>>help(hello) I'm not sure if that's what you were asking, but "import" is how you .. import. HTH. On Fri, Sep 4, 2009 at 5:31 P

Re: [Tutor] Simple Game

2009-09-06 Thread Eric Dorsey
Hi Corey, If this is going to be a command line program, two things that immediately come to mind for me are: validating user input and persistence. If you put something like "(1) to attack, (2) to run" what if the user types "yes", or "Y", or "9"? You'll want to make sure your program doesn't cra

[Tutor] Date validation?

2008-11-06 Thread Eric Dorsey
Greetings,I have a program where I ask a user to enter a date in format -MM-DD, and get a string like: '2008-10-25' Can anyone tell me how I would verify this is a real date before allowing it to be passed on to the next part of the program? -- (e) ___

Re: [Tutor] Python - Data Mining?

2009-01-04 Thread Eric Dorsey
Hi Nick, I don't know about the graphing portion of your question, but yes Python does interact very well with databases. I have been working on a workout tracking program the last two months or so, and I'm new to programming. I'd highly recommend SQLite as a built-in database solution. I know it's

[Tutor] 2 & 4 or more spaces per indentation level..

2009-01-15 Thread Eric Dorsey
Dear Pythonistas: Working in IDLE on Windows Vista, I have one program that I set to have 2 character spacing (due to the levels of if's and while's going on -- later my brother called this a bit of a code smell, ie. logic shouldn't go that deep, it should be broken out into separate functions ins

[Tutor] Volunteer Opportunities?

2009-01-21 Thread Eric Dorsey
-- eric dorsey | www.perfecteyedesign.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Volunteer opportunities

2009-01-21 Thread Eric Dorsey
on? Or possibly nonprofits or the like that need smaller-type applications worked on? Much thanks! -- eric dorsey | www.perfecteyedesign.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Print question in IDLE

2009-01-30 Thread Eric Dorsey
. > Jim > _______ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- eric dorsey | www.perfecteyedesign.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python 2.6.1 + Linux Ubuntu (Gutsy Gibbon)

2009-02-05 Thread Eric Dorsey
I am trying to teach myself Linux, and so I'm running Ubuntu (Gutsy Gibbon) as a virtual machine. I went to terminal, started up Python and realized it was version 2.5 so I thought I'd just upgrade to 2.6.1 After doing some Googling around, it seems that Ubuntu is highly reliant on Python 2.5, so u