[Tutor] Help

2019-03-20 Thread Eric Oh Yeah Yeah
How do I make Python 3 pick a random variable out of a set of variables I give it? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] easygui

2017-08-28 Thread eric
and the box would disappear. I wonder if you are running this in a text only environment and that is why the box is not showing up. I am still a newbie when it comes to programming but I am willing to help if I can. Good luck George, Eric ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Hello!

2016-09-09 Thread Eric Gardner
I don't know if i'm sending the email to the right address but here it goes!. Would Python be a suitable language for first time learners like me? -- Eric G ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opti

[Tutor] Python OOP question

2016-04-02 Thread Eric Enoch
This is my first non-MATLAB programming language so I am having some trouble with object-oriented programming. Specifically, I am working on a program that simulates a blackjack game. It was functioning but I have tried adding some new functionality in allowing players to make bets To surmise, BJ

[Tutor] How to extract variables from GUI objects

2015-08-19 Thread Eric Kelly
re the appropriate user data values, but of course none worked. I'm using Glade 3, Gtk+ 3, and Python 34. Thanks in advance for any help and suggestions (I'm sure there are other mistakes here too). Eric The Python code is here: --

[Tutor] FTP GET from Variables Stored in File

2015-06-03 Thread Eric Grey
le I want to request the FTP GET on. So something like: seedfile.txt contents = apple.com, blue.com. car.txt Open FTP CD Read "seedfile.txt" For each line in "seedfile.txt" use the line as the variable and issue FTP GET on that variable

Re: [Tutor] Getting a directory listing with Python to MySQL

2014-07-22 Thread Eric Dannewitz
That's close. I have been playing from glob and os.walk but I'm at a loss how to get the size, creation and modified date while running it. - Original Message - From: "Danny Yoo" To: "Eric Dannewitz" Cc: "Python Tutor Mailing List" Sent: Tu

[Tutor] Getting a directory listing with Python to MySQL

2014-07-22 Thread Eric Dannewitz
Hello list, I'm new. I've done a few things in Python, but this one is posing problems. What I want to do is be able to parse a directory, say /Volumes/Stuff/Files/, and all the directories that might be in there, and be able to pick out file name, size, date modified, etc, and send that to a

[Tutor] preferred httprequest library

2014-05-08 Thread Palmer, Eric
proof. What would be a good http request library to use for this work? Thanks in advance Eric Palmer ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] i need help with the following question

2013-08-26 Thread isaac Eric
describe different ways of displaying output using python! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 92, Issue 118

2011-10-28 Thread Eric Schles
Here is my original problem: Eric Schles wrote: > Hello, > > This is my first time using this service so I am unsure what proper > formatting should be. In any case here is my question. > > I just downloaded EasyInstall here: > http://peak.telecommunity.com/DevCenter/E

[Tutor] more trouble

2011-10-28 Thread Eric Schles
So far, I have tried a few things. Listed below was my original problem and my original help. Eric Schles wrote: > Hello, > > This is my first time using this service so I am unsure what proper > formatting should be. In any case here is my question. > > I just downloade

[Tutor] easy_install question

2011-10-28 Thread Eric Schles
QLObject SyntaxError: invalid syntax I'm not sure what I am doing wrong since I copy/pasted the code from the tutorial. Any advice towards being able to use this module would be greatly appreciated. Sincerely, Eric ___ Tutor maillist - Tutor@python.org

[Tutor] wxPython parent classes

2011-04-19 Thread Eric Stevens
I've been noticing that in all the example codes I have seen, when someone creates container, x, inside of a frame or other container class, y, they always seem to create an instance of wx.Panel first and then use that instance as the parent class of container x. I have been just placing 'self' in

[Tutor] wxPython issues

2011-04-18 Thread Eric Stevens
I am trying to create an addressbook program and am currently working on prototype pages. Right now, I am trying to create a wx.ScrolledWindow class with a wx.ListCtrl to display the names of all contacts. I keep running into an error with my current configuration that is stating I have not specif

[Tutor] List sorting issues

2011-03-28 Thread Eric Stevens
k)' which gives me a list but not alphabetized. The dictionary keys I am using are 'Eric', 'Kyle', and 'dfd' and they always appear in that order when i use the sorted() feature (obviously not alphabetized). Could you please let me know what I am doing wrong or

[Tutor] zipfile error message

2011-02-07 Thread Eric Stevens
a string argument of length 46. Would anyone be able to help me figure out what is wrong? I am currently running Python 2.7 on Windows (not sure if that matters). Thank you. Eric ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscr

[Tutor] System of ODEs Question

2011-02-02 Thread Eric Lofgren
le, it had a second argument, so I put one in, and magically, it worked. But it can be x, it can be t, it can be anything. Which raises the question: What is it *doing*? Honestly, I'm baffled - can anyone point me in the right direction? Thanks, Eric ___

Re: [Tutor] Idea for a 'Weekly Python Tips' mailing list

2010-08-06 Thread Eric Hamiter
Your ideas are intriguing to me, and I wish to subscribe to your newsletter. Eric On Fri, Aug 6, 2010 at 11:19 AM, Ian Ozsvald wrote: > Hi all. I'm a long time Pythonista and co-founder of > http://ShowMeDo.com/ (and author of 140 of the Python tutorials > there), I'

Re: [Tutor] Formatting date/time

2010-08-04 Thread Eric Hamiter
There are a few solutions here: http://stackoverflow.com/questions/904928/python-strftime-date-decimal-remove-0 Eric On Wed, Aug 4, 2010 at 1:30 PM, Eduardo Vieira wrote: > I'm trying this example from python docs: > from time import gmtime, strftime > strftime("%a, %d %

Re: [Tutor] web-based python?

2010-08-01 Thread Eric Hamiter
ing is > through > Python. To just refer someone to Django when they don't know the first > thing about > web apps is, I think, off-putting. > > Che > > Che, my sentinments exactly. I'm looking for something similar. Eric ___

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

2010-07-31 Thread Eric Hamiter
here a way I could put something there? > > A hosted server, so it's not on my local machine. Afraid I can't hand you any access directly to it, I have too much personal stuff on there at the moment. I would be more than happy to look

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

2010-07-31 Thread Eric Hamiter
hing fundamental here, but that's kind of obvious since I posted I don't know what I'm doing in the first place! :) Thanks, Eric ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

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

2010-07-31 Thread Eric Hamiter
> > 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 simple Hello, World! ...but if I make it do anything mo

[Tutor] Writing scripts and apps for Internet consumption

2010-07-31 Thread Eric Hamiter
t would be more my speed, but support is lacking and doesn't seem too compatible with my host. I use Dreamhost, and they are very adaptable and configurable, but so far I can't find an easy way to accomplish what I want. Thanks for reading this far if you did! I welcome any suggestions

Re: [Tutor] Python Book recomandation!

2010-07-15 Thread Eric Hamiter
e off to a great start by asking this list; I've found the people here are very friendly and extremely knowledgeable. Thanks, Eric On Thu, Jul 15, 2010 at 4:07 PM, Daniel wrote: > Hello, I recently browsed the BeginnersGuide/NonProgrammers section of the > Python website, but I have a q

Re: [Tutor] Searching a text file's contents and comparing them toalist

2010-07-14 Thread Eric Hamiter
on aisle 1: bread magazines Located on aisle 2 [etc...] I tried putting "\n" into it but it just prints the literal string. I'm sure it has to do with the list format of holding multiple items, but so far haven't found a way to break them apart. Thanks, Eric ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Searching a text file's contents and comparing them toa list

2010-07-14 Thread Eric Hamiter
ms will print, but not in the order I wish. The ultimate goal of the program will be to sort the items based on aisle locations. Is there an efficient way to do this? I think I want some kind of incremental counter going on in the loop to prevent them from overwriting themselves, or

Re: [Tutor] Searching a text file's contents and comparing them toa list

2010-07-14 Thread Eric Hamiter
On Wed, Jul 14, 2010 at 12:26 PM, Alan Gauld wrote: > > If you never need a stripped version of line again, or if you > are planning on writing it out to another file then this is fine. > If you are going to use it again its probably better to strip() > and asign to itelf: > > line = line.strip()

Re: [Tutor] Searching a text file's contents and comparing them to a list

2010-07-14 Thread Eric Hamiter
Fantastic! I have this, which now works. Is there a better place to put string.strip? aisle_one = ["chips", "bread", "pretzels", "magazines"] grocery_list = open("grocery_list.txt", "r") for line in grocery_list.readlines(): if line.strip() in aisle_one: print "success! i found %s" % l

[Tutor] Searching a text file's contents and comparing them to a list

2010-07-14 Thread Eric Hamiter
;success" else: print "no joy" grocery_list.close() I get this: no joy no joy no joy no joy no joy no joy when I'm expecting this: no joy no joy success no joy success no joy Am I close? This seems like it should work but I'm obviously missing somethi

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

2010-07-12 Thread Eric Hamiter
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 article: http://articles.techrepublic.com.com/5100-10878_11-105219

Re: [Tutor] newbie to gui programming

2010-07-06 Thread Eric Hamiter
If you decide to run with wxPython there is a pretty handy video series you could watch: http://showmedo.com/videotutorials/series?name=PythonWxPythonBeginnersSeries Eric On Tue, Jul 6, 2010 at 1:48 PM, Alan Gauld wrote: > "Payal" wrote > > gui programming? There seems to

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

[Tutor] date problems

2010-04-28 Thread Eric Meigs
t see how to read in a string and get it into a format for comparison. I can do all of the other code. Eric ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sqrt?

2010-04-25 Thread Eric Walker
'__file__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', &

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] 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] Question on "import foobar" vs "from foobar import *"

2010-01-10 Thread Eric Pavey
On Sat, Jan 9, 2010 at 9:08 PM, Lie Ryan wrote: > On 1/10/2010 11:23 AM, Eric Pavey wrote: > >> I should add (that as I understand it), when you do a 'from foo import >> blah', or 'from foo import *', this is doing a /copy/ (effectively) of >> that mo

Re: [Tutor] Question on "import foobar" vs "from foobar import *"

2010-01-09 Thread Eric Pavey
I should add (that as I understand it), when you do a 'from foo import blah', or 'from foo import *', this is doing a *copy* (effectively) of that module's attributes into the current namespace. Doing "import foo" or "import foo as goo" is keeping a *reference *to the imported module rather than a

Re: [Tutor] Python at my work

2009-12-03 Thread Eric Pavey
On Thu, Dec 3, 2009 at 10:13 AM, Steve Bricker wrote: > We have Python applications for work with testing reports printed to PDF > files. Don't know if you have that needed. > > Steve Bricker > Now blogging at srbricker.blogspot.com > > On Thu 09/12/03 11:46 , skrab...@comcast.net sent: > > My de

Re: [Tutor] Querying a packages modules?

2009-11-20 Thread Eric Pavey
On Fri, Nov 20, 2009 at 12:28 PM, Kent Johnson wrote: > On Fri, Nov 20, 2009 at 3:05 PM, Dave Angel wrote: > > Eric Pavey wrote: > > >> lol, in usual fashion, after I hack through it, while in the docs, I > find > >> the 'fancy' solution: >

Re: [Tutor] Querying a packages modules?

2009-11-20 Thread Eric Pavey
On Fri, Nov 20, 2009 at 10:58 AM, Eric Pavey wrote: > On Fri, Nov 20, 2009 at 10:40 AM, Dave Angel wrote: > >> Eric Pavey wrote: >> >>> On Fri, Nov 20, 2009 at 4:09 AM, Kent Johnson wrote: >>> >>> >>> >>>> On Thu, Nov 19, 2

Re: [Tutor] Querying a packages modules?

2009-11-20 Thread Eric Pavey
On Fri, Nov 20, 2009 at 10:40 AM, Dave Angel wrote: > Eric Pavey wrote: > >> On Fri, Nov 20, 2009 at 4:09 AM, Kent Johnson wrote: >> >> >> >>> On Thu, Nov 19, 2009 at 9:31 PM, Eric Pavey wrote: >>> >>> >>>> Say

Re: [Tutor] Querying a packages modules?

2009-11-20 Thread Eric Pavey
On Fri, Nov 20, 2009 at 4:09 AM, Kent Johnson wrote: > On Thu, Nov 19, 2009 at 9:31 PM, Eric Pavey wrote: > > Say I have this package layout > > > > \myPackage > > > > __init__.py > > moduleA.py > > moduleB.py > > > > Is there a way

[Tutor] Querying a packages modules?

2009-11-19 Thread Eric Pavey
Say I have this package layout - \myPackage - __init__.py - moduleA.py - moduleB.py Is there a way (and I'm sure there is...) to query, for a given package level, which modules live under it? I thought I could do it like so: import myPackage goodQualityInfo = dir(myPackage) Th

Re: [Tutor] Querying a module's package path?

2009-11-11 Thread Eric Pavey
> > Eric Pavey wrote: >> >>> Presume I have a package 'a' like this: >>> >>>* /pystuff (added to sys.path) >>> o /a (start of my package) >>> >>>+ __init__.py >>>+ /b

Re: [Tutor] Querying a module's package path?

2009-11-11 Thread Eric Pavey
On Tue, Nov 10, 2009 at 11:15 PM, Lie Ryan wrote: > Eric Pavey wrote: > >> Presume I have a package 'a' like this: >> >>* /pystuff (added to sys.path) >> o /a (start of my package) >> >>+ __init__.py >>

[Tutor] Querying a module's package path?

2009-11-10 Thread Eric Pavey
Presume I have a package 'a' like this: - /pystuff (added to sys.path) - /a (start of my package) - __init__.py - /b - __init__.py - module.py to import module.py: import *a.b.module* What I'm trying to find is a way to query exactly what I typed ab

Re: [Tutor] parsing XML

2009-11-09 Thread Eric Pavey
On Mon, Nov 9, 2009 at 7:48 PM, Christopher Spears wrote: > Hi! > > I need to parse several XML documents into a Python dictionary. Is there a > module that would be particularly good for this? I heard beginners should > start with ElementTree. However, SAX seems to make a little more sense to

Re: [Tutor] i can't for the life of me get "#! /usr/bin/env python" or "#!/usr/bin/python" to work

2009-10-22 Thread Eric L. Howard
If you're using bash for your shell - it looks like you need to re-source your .bashrc. You can do this from the command line source ~/.bashrc or log out and log back in. ~elh On Wed, Oct 21, 2009 at 5:56 PM, Jason Willis wrote: > so i changed the .bashrc and added at the end : > PATH="/home/

Re: [Tutor] i can't for the life of me get "#! /usr/bin/env python" or "#!/usr/bin/python" to work

2009-10-21 Thread Eric L. Howard
The directory you are sitting in doesn't appear to be in your path... [ehow...@preacher ~/bin]$ ls macosver macosver* [ehow...@preacher ~/bin]$ macosver 10.5.8 [ehow...@preacher ~/bin]$ echo $PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:~/bin:/opt/local/bin:/opt/local/sbin ~elh On Wed, Oct

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
On Tue, Oct 13, 2009 at 5:17 PM, Kent Johnson wrote: > On Tue, Oct 13, 2009 at 4:38 PM, David Eric wrote: > > > as far as print zip_command, i would add that to the program however, > doesnt > > just declaring it actually trigger it..thus it would executed and the >

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
On Tue, Oct 13, 2009 at 4:02 PM, Kent Johnson wrote: > On Tue, Oct 13, 2009 at 2:58 PM, David Eric wrote: > > printing the command line, > > would it be > > print('gzip {0} {1}'.format(target, ' '.join(source))? > > Yes, or just > print zip

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
On Tue, Oct 13, 2009 at 4:14 PM, Dave Angel wrote: > (You top-posted, instead of adding your part to the end. That's frowned > upon in a mailing list, at least in this one.) > (You replied privately, and forgot to CC the tutor list. I'm forwarding it > there with my resp

[Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
doing a python tutorial and one of the assignments says to develop a program that backsup files to zip files into a backup directory im using Darwin 10.0.0 unix version: this is what i came up with thus far, i did copy the sample program given but made changes for my unix OS: #!/usr/bin/env pyth

[Tutor] Confusion with $PATH

2009-09-25 Thread David Eric
Very new to python..getting accustomed to files, directories etc I installed a few versions of python and ended up with a very long PATH variable, do i need this or can i change it to something shorter? Doing an online tutorial one exercise was to move a simple program, helloworld into the PATH so

Re: [Tutor] Challenge

2009-09-22 Thread Eric Walker
Ali, I am new at this but here is my interpretation. 1) flip coin 100 times, and print out the number of heads and number of tails. from random import Random score = [0,0]# first position will be heads and second position will be tails count=0#counter to find out how many times we have flipped. a

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

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] help

2009-07-15 Thread Eric Walker
> >From: jonathan wallis >To: tutor@python.org >Sent: Wednesday, July 15, 2009 12:54:16 PM >Subject: [Tutor] help > >>i have a duel loop that looks like thiswhile y > 0 and x > 0: >i cant figure out if there is a way to make so if one loop ends it says >something different than if th

[Tutor] why PyObject_VAR_HEAD?

2009-06-25 Thread Eric Zhao
quot; count explicity? Is there any difference? Thanks. Eric ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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

[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] 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] 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] 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...@

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

2009-02-27 Thread Eric Dorsey
27;) mylist.append(x) #output the type of objects you've entered (hint: they'll always be strings.. ;) print type(mylist[0]) print type(mylist[1]) #print the list of items for i in mylist: print i *When you run the program:* Enter num or text: 27 Enter num or text: Eric 27 Eric On

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 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-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

[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] 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

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] 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

[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

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] import confusion

2009-01-25 Thread Eric Abrahamsen
that you can import X, then from X import Y, but only if Y is another module and not an object. The import chains above work until I try to import a class definition. Can someone explain what it is about module imports that makes it work this way? And why the unhelpful error message

[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

[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] 2 & 4 or more spaces per indentation level..

2009-01-15 Thread Eric Dorsey
ple/good/smart way to get it all back to the 4 spacing default? Or if for example I wanted to convert my 2 spacing program to the conventional 4? - Eric ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python - Data Mining?

2009-01-04 Thread Eric Dorsey
MARY KEY, reps SMALLINT(1000), weight SMALLINT(1000), exer VARCHAR(30), date DATE) ''') #query the WR table, feeding it the 'srch' variable which fills in where the SQL has a ? cursor.execute( "SELECT SUM(REPS) FROM WR WHERE EXER=?", (srch,) ) -Er

[Tutor] more encoding strangeness

2008-12-22 Thread Eric Abrahamsen
ters. What's the difference between this command writing to the terminal, and writing to the file? Thanks, Eric ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Intermediate/advanced concepts

2008-11-07 Thread Eric Abrahamsen
it only started to come clear after I'd looked at a module I was writing, realized that there was something really fundamentally wrong with it, and then slowly realized that the answer was metaclasses. About eleven lines of metaclass programming, as it turned out, but those seven lines tur

[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] __iter__ loops, partitioning list among children

2008-08-28 Thread Eric Abrahamsen
7;s been a learning experience... E On Aug 27, 2008, at 2:22 AM, Kent Johnson wrote: On Tue, Aug 26, 2008 at 1:24 PM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: On Aug 26, 2008, at 7:20 PM, Kent Johnson wrote: If all you want to do with the nested Month, etc is to iterate the even

Re: [Tutor] __iter__ loops, partitioning list among children

2008-08-26 Thread Eric Abrahamsen
On Aug 26, 2008, at 7:20 PM, Kent Johnson wrote: On Tue, Aug 26, 2008 at 1:36 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: So my test case: a Month has a 'child' attribute pointing at Week, which has a 'child' attribute pointing at Day, so they all know what

Re: [Tutor] __iter__ loops, partitioning list among children

2008-08-25 Thread Eric Abrahamsen
first access, then I might as well just call list() on the QuerySet at object instantiation, and save myself some trouble. I hope that's a little clearer. My central issue is maintaining my place in the self.events loop, and only advancing it as far as the date-based while loop advanc

Re: [Tutor] __iter__ loops, partitioning list among children

2008-08-25 Thread Eric Abrahamsen
break self.sentinel += c.dt_range if not require_events or c.has_events(): # if require_events == True, omit empty children. yield c On Aug 25, 2008, at 11:49 AM, Eric Abrahamsen wrote: On Aug 24, 2008, at 7:20 PM, Kent Johnson wrote: Forward

Re: [Tutor] __iter__ loops, partitioning list among children

2008-08-24 Thread Eric Abrahamsen
On Aug 24, 2008, at 7:20 PM, Kent Johnson wrote: Forwarding to the list with my reply. Please use Reply All to reply to the list. Grr, sorry, I keep forgetting... On Sun, Aug 24, 2008 at 1:02 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: On Aug 23, 2008, at 11:22 PM, Kent J

[Tutor] __iter__ loops, partitioning list among children

2008-08-23 Thread Eric Abrahamsen
of that range. Probably I'll have to settle for just one or the other, but one can dream. Thanks for reading all this. I'm hoping that all the restrictions and conditions will make the solution more obvious, rather than less obvious, to those who know more than I... --Eric ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] requests/responses from urllib2

2008-08-13 Thread Eric Abrahamsen
Thanks to you both. I'll read up on sockets, but it seems unlikely that it works the way I thought it might... On Aug 12, 2008, at 8:45 PM, Kent Johnson wrote: On Tue, Aug 12, 2008 at 7:27 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: On Aug 11, 2008, at 6:54 PM, Kent Johnson

[Tutor] requests/responses from urllib2

2008-08-10 Thread Eric Abrahamsen
o be coming from? If my web server (lighttpd in this case) is set to listen on a particular port, is there any way that it can 'see' that traffic and interact with it, or is it purely between the python library and the outside world? Thank

[Tutor] python environment

2008-07-18 Thread Eric Abrahamsen
environment variables' and 'don't imply "import site" on initialization' – I just don't quite get it. Thanks in advance for any and all enlightenment. Eric ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] splits and pops

2008-07-12 Thread Eric Abrahamsen
list items with the two strings I want. Either the cycle goes off and splits the wrong strings, or I get nested list items, which is not what I want. Can someone please point me in the right direction here? Thanks, Eric ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] character encoding

2008-07-08 Thread Eric Abrahamsen
As for other resources, I recently came across this: http://farmdev.com/talks/unicode/ This was the first explanation that really made me understand the difference between Unicode and utf-8 (and realize that I'd been using the terms 'encode' and 'decode' backwards!). Anyway, just one more r

Re: [Tutor] TypeError: not enough arguments for format string

2008-07-01 Thread Eric Abrahamsen
On Jul 2, 2008, at 12:36 PM, Christopher Spears wrote: I'm working on problem 13-5 in Core Python Programming (2nd Edition). I am supposed to create point class. Here is what I have so far: #!/usr/bin/python class Point(object): def __init__(self, x=0.0,y=0.0): self.x = float(

Re: [Tutor] inheritance/classmethods/metaclasses

2008-06-19 Thread Eric Abrahamsen
What you have almost works. Try this: No kidding – that's what I get for wild stabs in the dark, I thought I'd tried that. I'm pleased that it really is that simple (and that, whatever metaclasses are used for, I don't need to worry about them yet). Thanks! Eri

[Tutor] inheritance/classmethods/metaclasses

2008-06-19 Thread Eric Abrahamsen
self.keyword = args[1] The desired behavior, of course, is this: File.add('somefilename','keywordforthisfile') and to be able to extend this behavior to other classes. Any pointers would be much appreciated... Eric ___ Tutor mail

Re: [Tutor] get/set attributes

2008-05-25 Thread Eric Abrahamsen
the learning exercise, but it will be *very* nice to return to a full framework package... Eric -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http:

  1   2   3   4   5   >