Re: [Tutor] Pythonic review (descriptors)

2015-04-28 Thread Alan Gauld
On 28/04/15 10:55, Sage Hack wrote: I'm looking for somebody willing to review parts of this code https://github.com/SageHack/cloud-buster and let me know what is not Pythonic :P https://github.com/SageHack/cloud-buster/tree/master/bust/descriptor The thing that jumps out to me is your use

Re: [Tutor] How to output dictionary data to CSV file

2015-04-28 Thread Alan Gauld
On 28/04/15 09:51, Paradox wrote: to save that information to a file, CSV seemed the easiest format You could consider JSON too. JSON looks a lot like a Python dictionary of strings so is almost a perfect match to your data. The json module is in the standard library. -- Alan G Author of

[Tutor] Pythonic review (descriptors)

2015-04-28 Thread Sage Hack
I'm looking for somebody willing to review parts of this code https://github.com/SageHack/cloud-buster and let me know what is not Pythonic :P I want to improve my Python coding skills but I'm not sure exactly what to study next. Right now I'm trying to use descriptors correctly and I'd like to

Re: [Tutor] Pythonic review (descriptors)

2015-04-28 Thread Alan Gauld
On 28/04/15 10:55, Sage Hack wrote: I'm looking for somebody willing to review parts of this code https://github.com/SageHack/cloud-buster and let me know what is not Pythonic :P https://github.com/SageHack/cloud-buster/tree/master/bust/descriptor Another point re the PageTitle class:

Re: [Tutor] Fwd: circular movement in pygame

2015-04-28 Thread Dave Angel
On 04/28/2015 02:37 PM, diliup gabadamudalige wrote: I thank all those who responded to my question Here is the code that I had written. When updating is applied to a surface object the rotation works but when it is applied through a class to an object it goes wrong in about 3 rotations. As

Re: [Tutor] Naming conventions

2015-04-28 Thread Steven D'Aprano
On Tue, Apr 28, 2015 at 01:01:04PM +0530, Mitesh H. Budhabhatti wrote: Hello Friends, Can you please suggest good naming conventions/guidelines to following while writing Python code? Thanks. Most important rule of all: names should be descriptive and understandable, not too short or

[Tutor] Good Taste Question: Using SQLite3 in Python

2015-04-28 Thread Jugurtha Hadjar
Hello, all.. I have a class with methods that access a database (SQLite3). I have included an excerpt showin reading and writing and would like to know if I'm doing it right. (i.e: Is it bad code and what to improve). Here are some improvements and my rationale (check my thinking): -

Re: [Tutor] Function works one time then subsequently fails

2015-04-28 Thread Cameron Simpson
On 28Apr2015 20:58, Jim Mooney Py3winXP cybervigila...@gmail.com wrote: This is really puzzling me. I'm parsing a string to do some simple math operations and practice tossing functions around. My parser works on the first run, then it continually fails on the same input. [...] numbers = []

[Tutor] Function works one time then subsequently fails

2015-04-28 Thread Jim Mooney Py3winXP
This is really puzzling me. I'm parsing a string to do some simple math operations and practice tossing functions around. My parser works on the first run, then it continually fails on the same input. Takes the name of a binary math operation and two numbers from input, repeatedly, and displays

Re: [Tutor] Function works one time then subsequently fails

2015-04-28 Thread Jim Mooney Py3winXP
On 28 April 2015 at 21:27, Cameron Simpson c...@zip.com.au wrote: At a first glance numbers is a global. It is reset to [] at program start, but never again. So you're appending to it forever. I have not investigated further as to how that affects your program's flow. Cheers, Cameron

Re: [Tutor] How to output dictionary data to CSV file :p:

2015-04-28 Thread Thomas C. Hicks
On 04/28/2015 09:43 PM, Alan Gauld wrote: You could consider JSON too. JSON looks a lot like a Python dictionary of strings so is almost a perfect match to your data. Sounds great, I'll check it out. Thanks! thomas == Thomas C. Hicks, MD, MPH Training Manager,

Re: [Tutor] Fwd: circular movement in pygame

2015-04-28 Thread diliup gabadamudalige
I thank all those who responded to my question Here is the code that I had written. When updating is applied to a surface object the rotation works but when it is applied through a class to an object it goes wrong in about 3 rotations. As far as I can see the code is the same. What is wrong? If

[Tutor] How to output dictionary data to CSV file

2015-04-28 Thread Paradox
I have some data structured like this: {'B002':'NRP 2014','B003':'HBB 2015'} Basically account numbers and project names, each account number has a project name. I represent it in a dictionary because that seemed the best way to keep the account numbers and project names together. I want

Re: [Tutor] How to output dictionary data to CSV file

2015-04-28 Thread Paradox
How rude of me, I neglected to note I am using Python 3.4.3. On 04/28/2015 04:51 PM, Paradox wrote: I have some data structured like this: {'B002':'NRP 2014','B003':'HBB 2015'} Basically account numbers and project names, each account number has a project name. I represent it in a

[Tutor] Trouble Downloading 3.2 tutorial

2015-04-28 Thread O'Shea, Connor
Greetings. I have been experiencing difficulty getting my computer to download the 3.2 python program. My computer has Windows 8 software. What do you suggest I do to address this problem? ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Naming conventions

2015-04-28 Thread Mark Lawrence
On 28/04/2015 08:31, Mitesh H. Budhabhatti wrote: Hello Friends, Can you please suggest good naming conventions/guidelines to following while writing Python code? Thanks. PEP 8 - Style Guide for Python Code at https://www.python.org/dev/peps/pep-0008/ -- My fellow Pythonistas, ask not

[Tutor] Fwd: circular movement in pygame

2015-04-28 Thread diliup gabadamudalige
-- Forwarded message -- From: diliup gabadamudalige dili...@gmail.com Date: Tue, Apr 28, 2015 at 6:22 PM Subject: circular movement in pygame To: pygame-us...@seul.org Looking at the code on this page lines 47 48

Re: [Tutor] Fwd: circular movement in pygame

2015-04-28 Thread Alan Gauld
On 28/04/15 16:38, diliup gabadamudalige wrote: -- Forwarded message -- From: diliup gabadamudalige dili...@gmail.com Date: Tue, Apr 28, 2015 at 6:22 PM Subject: circular movement in pygame To: pygame-us...@seul.org It's good that you tried the python-game list for a pygame

Re: [Tutor] Fwd: circular movement in pygame

2015-04-28 Thread Oscar Benjamin
On 28 April 2015 at 16:38, diliup gabadamudalige dili...@gmail.com wrote: Looking at the code on this page lines 47 48 http://programarcadegames.com/python_examples/show_file.php?file=sprite_circle_movement.py is there a way to do self.rect.x +*= some value* self.rect.y += some value

Re: [Tutor] Fwd: circular movement in pygame

2015-04-28 Thread Oscar Benjamin
On 28 April 2015 at 19:37, diliup gabadamudalige dili...@gmail.com wrote: I thank all those who responded to my question Here is the code that I had written. When updating is applied to a surface object the rotation works but when it is applied through a class to an object it goes wrong in

Re: [Tutor] How to output dictionary data to CSV file :p:

2015-04-28 Thread Thomas C. Hicks
On 04/28/2015 05:30 PM, Peter Otten wrote: data = {'B002':'NRP 2014','B003':'HBB 2015'} writer = csv.writer(sys.stdout) writer.writerows(data.items()) B002,NRP 2014 B003,HBB 2015 That is exactly what I was looking for! Thanks, apparently my knowledge deficit is in understanding dictionary

Re: [Tutor] How to output dictionary data to CSV file

2015-04-28 Thread Peter Otten
Paradox wrote: I have some data structured like this: {'B002':'NRP 2014','B003':'HBB 2015'} Basically account numbers and project names, each account number has a project name. I represent it in a dictionary because that seemed the best way to keep the account numbers and project names

[Tutor] Naming conventions

2015-04-28 Thread Mitesh H. Budhabhatti
Hello Friends, Can you please suggest good naming conventions/guidelines to following while writing Python code? Thanks. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Trouble Downloading 3.2 tutorial

2015-04-28 Thread Alan Gauld
On 28/04/15 00:08, O'Shea, Connor wrote: Greetings. I have been experiencing difficulty getting my computer to download the 3.2 python program. My computer has Windows 8 software. What do you suggest I do to address this problem? You don't say what kind of trouble nor which distribution of

Re: [Tutor] pip install M2crypto

2015-04-28 Thread Alan Gauld
On 28/04/15 03:14, Juanald Reagan wrote: Good Evening, I am trying to install the M2crypto package via pip and receive an error. Python version is 2.7.4, any ideas on how to fix the SWIG error? Do you have SWIG installed? It should be in your repo. unable to execute swig: No such