Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2015-01-04 Thread Simon Evans
Dear Michael Torrie, Thanks for pointing that out to me re: it not being a syntax problem. The thing is there is a file called 'EcologicalPyramid.html'. I put it in a folder called 'Soup' as the text advised on page 28. For what its worth I also shifted the Windows Command Prompt to that folder

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2015-01-04 Thread Mark Lawrence
On 04/01/2015 12:49, Simon Evans wrote: Dear Michael Torrie, Thanks for pointing that out to me re: it not being a syntax problem. The thing is there is a file called 'EcologicalPyramid.html'. I put it in a folder called 'Soup' as the text advised on page 28. For what its worth I also shifted

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2015-01-04 Thread Dave Angel
On 01/04/2015 07:49 AM, Simon Evans wrote: Dear Michael Torrie, Thanks for pointing that out to me re: it not being a syntax problem. The thing is there is a file called 'EcologicalPyramid.html'. I put it in a folder called 'Soup' as the text advised on page 28. For what its worth I also

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-18 Thread Simon Evans
@Steven D'Aprano, I input the following to Python 2.7, which got the following:- from bs4 import BeautifulSoup with open(ecologicalpyramid.html,r) as ecological_pyramid: ... soup= next(ecological_pyramid,lxml) ...

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-18 Thread Michael Torrie
On 12/18/2014 09:19 AM, Simon Evans wrote: @Steven D'Aprano, I input the following to Python 2.7, which got the following:- from bs4 import BeautifulSoup with open(ecologicalpyramid.html,r) as ecological_pyramid:

Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Simon Evans
Dear Python programmers, Having input the line of code in text: cd Soup to the Windows console, and having put the file 'EcologicalPyramid.html' into the Directory 'Soup', on the C drive, in accordance with instructions I input the following code to the Python console, as given on page 30 of

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Ned Batchelder
On 12/14/14 11:15 AM, Simon Evans wrote: Dear Python programmers, Having input the line of code in text: cd Soup to the Windows console, and having put the file 'EcologicalPyramid.html' into the Directory 'Soup', on the C drive, in accordance with instructions I input the following code to the

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Simon Evans
I had another attempt at inputting the code perhaps with the right indentation, I still get an error return, but not one that indicates that the code has not been read, as you suggested. re:- Python 2.7.6 (default,

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Jussi Piitulainen
Simon Evans writes: I had another attempt at inputting the code perhaps with the right indentation, I still get an error return, but not one that indicates that the code has not been read, as you suggested. re:- -- Python

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Billy Earney
It looks like the last line (producer_entries...) is not indented at the same extent as the previous line. Maybe this is causing the issue? On Sun, Dec 14, 2014 at 10:15 AM, Simon Evans musicalhack...@yahoo.co.uk wrote: Dear Python programmers, Having input the line of code in text: cd Soup

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Simon Evans
Dear Jussi, and Billy I have changed the input in accordance with your advice, re: -- Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright, credits or license for more

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Steven D'Aprano
Simon Evans wrote: Dear Jussi, and Billy I have changed the input in accordance with your advice, re: -- Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright,

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Chris Roy-Smith
On 15/12/14 10:21, Simon Evans wrote: Dear Jussi, and Billy I have changed the input in accordance with your advice, re: -- Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win here the user

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Chris Angelico
On Mon, Dec 15, 2014 at 1:32 PM, Chris Roy-Smith chris_roysm...@internode.on.net wrote: and here he uses a python 3.x print syntax which triggers the following error message On the contrary; parens around a single argument will work just fine in Py2 (they're simply redundant parentheses, in the

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Mark Lawrence
On 15/12/2014 02:32, Chris Roy-Smith wrote: On 15/12/14 10:21, Simon Evans wrote: Dear Jussi, and Billy I have changed the input in accordance with your advice, re: -- Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Michael Torrie
On 12/14/2014 07:47 PM, Mark Lawrence wrote: I didn't realise that Python was so smart. It can indicate a syntax error at the final 't' in print before it gets to the opening bracket that is required for the print function in Python 3 (and Python 2 if you're using from __future__ import

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Chris Angelico
On Mon, Dec 15, 2014 at 4:27 PM, Michael Torrie torr...@gmail.com wrote: On 12/14/2014 07:47 PM, Mark Lawrence wrote: I didn't realise that Python was so smart. It can indicate a syntax error at the final 't' in print before it gets to the opening bracket that is required for the print

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Michael Torrie
On 12/14/2014 10:32 PM, Chris Angelico wrote: Did you actually test that? Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license() for more information. print(hello) hello Since print is a keyword when not imported from

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Zachary Ware
On Sun, Dec 14, 2014 at 11:38 PM, Michael Torrie torr...@gmail.com wrote: Guess the future import is only to make not having parens and error. Python 2.7.8+ (default, Nov 2 2014, 00:32:19) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information.

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Chris Angelico
On Mon, Dec 15, 2014 at 4:38 PM, Michael Torrie torr...@gmail.com wrote: Thought I had indirectly, since I've been using this print technique for the last few days. Good to know it works either way, though. Guess the future import is only to make not having parens and error. Yeah. I usually