Exposing all methods of a class

2017-02-26 Thread Pete Dowdell
I use Python, mainly with Django, for work. I was wondering if anyone has encountered an editor that could display a class with all inherited methods included in the editor's view of the class code. I am kind of envisaging the inherited code would be displayed differently (say, grey vs black),

Re: Calculating longitudinal acceleration, lateral acceleration and normal acceleration

2016-01-24 Thread Pete Dowdell
On 24/01/16 07:27, Robert James Liguori wrote: Is there a python library to calculate longitudinal acceleration, lateral acceleration and normal acceleration? Might be rocket science... pd -- https://mail.python.org/mailman/listinfo/python-list

Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-10 Thread Pete Dowdell
On 10/11/15 08:12, Bernie Lazlo wrote: > > import json > >import urllib > >url ="http://www.wickson.net/geography_assignment.json"; > >response = urllib.urlopen(url) > >data = json.loads(response.read()) All good up to data. Now: # make a list of scores scores = [d['score'] for d in data['comme

Re: Converting a string into a float that includes the negative

2015-11-08 Thread Pete Dowdell
On 08/11/15 09:11, phamton...@gmail.com wrote: I am having issue with converting the string into a float because there is a negative, so only end up with "ValueError: invalid literal for float(): 81.4]"81.4] The error is right there in the exception: you are trying to cast '81.4]' - that's a

Re: Problem working with subprocess.check_call

2015-10-29 Thread Pete Dowdell
On 29/10/15 16:52, David Aldrich wrote: Hi I am working on Linux with Python 3.4. I want to do a bash diff on two text files and show just the first 20 lines of diff’s output. So I tried: >>> cmd = 'head -20 <(diff ' + file1 + ' ' + file2 + ')' >>> subprocess.check_call(cmd, shell=True)

Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run

2015-08-26 Thread Pete Dowdell
On 26/08/15 04:19, RAH wrote: UnicodeEncodeError: 'ascii' codec can't encode character '\\xc7' in position 15: ordinal not in range(128) (Hi all, this is my first post to the list) This can be a frustrating issue to resolve, but your issue might be solved with this environment variable: P