Re: [Tutor] Dictionary

2012-06-18 Thread bob gailer
On 6/17/2012 2:26 PM, Selby Rowley-Cannon wrote: [snip] Do you have any programming (algorithm development) experience? Do you want to translate words independent of context? -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@pytho

Re: [Tutor] Simple Python Address Book (Advice welcome!)

2012-06-18 Thread Prasad, Ramit
> > def LoadAddresses(): > > """ Loads all addresses from file and places > > them in tuple in form (bool, list), where the list is each > > row from the file (a person's name | email). """ > > success, lines = (False, []) > > try: > > f = open(addressBookPath, 'r'

Re: [Tutor] Dictionaries

2012-06-18 Thread Prasad, Ramit
> This sounds a wee bit like a homework assignment and we have a policy of > not doing those for you... Just to clarify, we will help you on it but not do it for you. Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713

[Tutor] Installing NumPy

2012-06-18 Thread Ali Torkamani
Hi Every body, I'm trying to install NumPy on Python 2.7 for windows 32. But have had no success so far. I appreciate any help. Thanks, Ali ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/m

Re: [Tutor] Installing NumPy

2012-06-18 Thread Emile van Sebille
On 6/18/2012 12:50 PM Ali Torkamani said... Hi Every body, I'm trying to install NumPy on Python 2.7 for windows 32. But have had no success so far. Hmmm. I have Active State's version 2.7 installed on the machine I';m in front of today. Launched and confirmed no numpy installed. Then I

Re: [Tutor] Installing NumPy

2012-06-18 Thread Ali Torkamani
Thanks. I installed active python and then ran numpy package installer, and now it seems liek I can import numpy. Previously I had installed: http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi but there should be a problem connecting this one with numpy. Thanks any way, it's working now! Ali

[Tutor] Help with Matplotlib labels

2012-06-18 Thread Sean Carolan
I'm working on a simple python web app that generates graphs, because managers love graphs. I've got it about 90% done, but I'm having trouble getting labels onto my stacked graph. In the matplotlib documentation there is a nice example showing how to create the legend. Note how the variables p1

Re: [Tutor] Help with Matplotlib labels

2012-06-18 Thread Sean Carolan
> Unfortunately my graph is generated dynamically. How can I create my > legend when my 'bar' objects have no names to refer to? I also noticed another issue with my stacked bar graph; the total height of the bar is the size of the largest number of the dataset, and not the total of all the indivi

Re: [Tutor] Help with Matplotlib labels

2012-06-18 Thread Alan Gauld
On 19/06/12 00:13, Sean Carolan wrote: and not the total of all the individual items. Anyone matplotlib experts out there who can weigh in? Not me, but I notice there is a gmane newsfeed for matplotlib: gmane.comp.python.matplotlib.general Probably worth posting questions there. -- Alan G

Re: [Tutor] Help with Matplotlib labels

2012-06-18 Thread Sean Carolan
> Not me, but I notice there is a gmane newsfeed for matplotlib: > > gmane.comp.python.matplotlib.general > > Probably worth posting questions there. Thank you, I will inquire on the newsfeed. ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] Help with Matplotlib labels

2012-06-18 Thread Sean Carolan
> Unfortunately my graph is generated dynamically. How can I create my > legend when my 'bar' objects have no names to refer to? > >    for admin in bd: >        bar(ind, bd[admin], width, color=colordict[admin]) >    xticks(ind+width/2., datenames) >    legend() >    grid('on') >    outfile = 'tes

Re: [Tutor] Help with Matplotlib labels

2012-06-18 Thread Sean Carolan
> I also noticed another issue with my stacked bar graph; the total > height of the bar is the size of the largest number of the dataset, > and not the total of all the individual items.  Anyone matplotlib > experts out there who can weigh in? I figured out what was going on here; the bars were al

Re: [Tutor] python varying mulitple inheritance

2012-06-18 Thread kendy
Thank you Steve, for the pointing me in a smarter direction! My immediate homework is: - Practice consistent conventions for naming things -- pep-0008. - Learn composition/has-a. I thought of a better way to think of my problem. A list element would contain the things that Bob has in his pockets

Re: [Tutor] python varying mulitple inheritance

2012-06-18 Thread kendy
Hmmm. No need to write the whole thing written out. Just how not to code: class Pocket1(Wallet, Keys, Comb, Usb, CellPhone, WorkBadge): class Pocket2(Wallet, Keys, Comb, Usb, CellPhone): class Pocket3(Wallet, Keys, Comb, Usb,WorkBadge): class Pocket4(Wallet, Keys, Comb, Usb): class Poc

[Tutor] Pymongo Error

2012-06-18 Thread Ranjith Kumar
Hi all, I tried Django with Mongodb while running manage.py syncdb I endup with this error note : it works fine with sqlite and mysql db (django-1.3)ranjith@ranjith:~/ sandbox/python-box/hukkster-core-site/hukk$ ./manage.py syncdb /home/ranjith/virtualenvs/django-1.3/local/lib/python2.7/site-pack

[Tutor] Writing to Windows 64-bit event log

2012-06-18 Thread Johan Geldenhuys
Hi there, I've looked all over, but couldn't find any help as far as an API goes to log to a 64-bit Windows7 machine event log. My Python version is 2.7.1 and I am running the 32-bit Windows version on a Windows 7 laptop. Is there a way I can log entries to the Windows event log on my lapt