Re: [Tutor] problem with program

2017-10-13 Thread Mark Lawrence via Tutor
On 13/10/17 13:04, Chris Coleman wrote: just learning python as my first programming language. going through the book "python in easy steps" by mike mcgrath. i am going through the programs in chapter 7 and can't get them to work. here is the first one in the chapter: class Bird: '''A

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-13 Thread Mark Lawrence via Tutor
On 12/10/17 21:22, Cameron McKay wrote: Hello, I've never used python trying to plot a graph. Thus I am having difficulties trying to plot the maxwell-boltzmann distribution. right now i've defined the y-axis given the probability, but the difficult part is trying to plot x in the form of: x =

Re: [Tutor] logging to cmd.exe

2017-10-01 Thread Mark Lawrence via Tutor
On 26/09/2017 12:22, Albert-Jan Roskam wrote: PS: sorry about the missing quote (>>) markers. Hotmail can't do this. Is Gmail better? > Get a decent email client and it'll do the work for you. I use Thunderbird on Windows with hotmail, gmail and yahoo addresses and never have a problem.

Re: [Tutor] Most common words in a text file

2017-10-01 Thread Mark Lawrence via Tutor
On 30/09/2017 18:12, Sri G. wrote: I'm learning programming with Python. I’ve written the code below for finding the most common words in a text file that has about 1.1 million words. It's working fine, but I believe there is always room for improvement. When run, the function in the script

Re: [Tutor] Help with putting numbers from highest to lowest.

2017-09-27 Thread Mark Lawrence via Tutor
On 27/09/2017 20:36, Derry, James R wrote: [Top posting fixed] From: Tutor [tutor-bounces+jderry=mail.utexas@python.org] on behalf of edmundo pierre via Tutor [tutor@python.org] Sent: Wednesday, September 27, 2017 8:10 AM To: Tutor Python

Re: [Tutor] Help with putting numbers from highest to lowest.

2017-09-27 Thread Mark Lawrence via Tutor
On 27/09/2017 14:10, edmundo pierre via Tutor wrote: Hello, When I used sort() to do that, but my problem is that sort() just arrange numbers from small to big, not from big to small. That is the issue I am having now. For instance: # The user is entering those numbers:a = 2.7b = 4.7c= 5.8d =

Re: [Tutor] logging to cmd.exe

2017-09-25 Thread Mark Lawrence via Tutor
On 25/09/2017 14:20, Albert-Jan Roskam wrote: Hi, With Python 3.5 under Windows I am using the logging module to log messages to stdout (and to a file), but this occasionally causes logging errors because some characters cannot be represented in the codepage used by cmd.exe (cp850, aka OEM

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-14 Thread Mark Lawrence via Tutor
On 14/09/2017 00:51, Cameron Simpson wrote: Secondly, there's SQLAlchemy. It knows the dialects and asks you to write "native" looking python syntax for selects etc. So stuff like:  db_conn.select(t.col1 == 9 and t.col2 == 10) where "t" is a "table" object it has handed you. I believe

Re: [Tutor] intro book for python

2017-09-03 Thread Mark Lawrence via Tutor
On 01/09/17 18:51, Raghunadh wrote: Hello Derek, I would start with this book https://learnpythonthehardway.org Raghunadh I cannot recommend anything from the author of LPTHW after he had the audacity to write this https://learnpythonthehardway.org/book/nopython3.html about Python 3, in

Re: [Tutor] Understanding error in recursive function

2016-04-09 Thread Mark Lawrence via Tutor
On 08/04/2016 21:48, Tom Maher wrote: Hi, As a test I am trying to write a function that returns the sum of values attached to one key in a dictionary. I am wondering why the code that I wrote is returning: "maximum recursion depth exceeded" Here is the code: animals = { 'a': ['aardvark'],

Re: [Tutor] Declaring variables

2016-04-07 Thread Mark Lawrence via Tutor
On 07/04/2016 18:49, Dimitar Ivanov wrote: Hello everyone, I have a (hopefully) quick and easy to explain question. I'm currently using MySQLdb module to retrieve some information from a database. In my case, the result that's being yield back is a single line. As far as my understanding goes,

Re: [Tutor] Drawing simple graphics objects

2016-04-04 Thread Mark Lawrence via Tutor
On 04/04/2016 04:17, Ashley Jacobs wrote: Hi, could you help me with python 3.5 coding for graphics? Yes, if you provide some code that we can comment on. We do not write code for you. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our

Re: [Tutor] Fw: About the Round Function

2016-04-01 Thread Mark Lawrence via Tutor
On 01/04/2016 20:46, Nacir Bouali wrote: -Forwarded by Nacir Bouali/sse/stud/aui/ma on 04/01/2016 08:46PM - To: tutor@python.org From: Nacir Bouali/sse/stud/aui/ma Date: 11/14/2015 08:21PM Subject: About the Round Function Dear Python Tutor(s), My students