Re: [Tutor] "List" object is not callable

2016-05-01 Thread Jason N. via Tutor
Hello,
I figured out the issue. It was a silly mistake - i was not running the correct 
code; instead was running code from another program which was active on a 
second tab. Thank you. 

On Sunday, May 1, 2016 4:15 PM, Jason N. via Tutor  wrote:
 
 

 Thank you all for your responses. 
I am using Py 2.7 and this time I copied and pasted the code from here: 
http://www.opentechguides.com/how-to/article/python/57/python-ping-subnet.html 
to my system but received the same error when I ran it. 
You can see the error screenshot here: https://unsee.cc/sonezima/ Thank you. 

    On Saturday, April 30, 2016 11:12 PM, Steven D'Aprano  
wrote:
 
 

 On Sat, Apr 30, 2016 at 06:51:17PM +, Jason N. via Tutor wrote:
> Hello,
> I found this simple script online but when I execute it I get the 
> following error: "TypeError: 'list' object is not callable" Here is 
> the code sample:
>
> import subprocess
> ls_output= subprocess.check_output(['dir'])

The code snippet works fine.

Please check that the code you send is exactly the same as the code you 
are actually trying to run. Do not just retype the code from memory, 
copy and paste it.

Also, please copy and paste the full traceback that you get, not just 
the final error message. Everything from the first "Traceback" line to 
the end.

Finally, you should tell us what version of Python you are running, on 
what operating system (Linux, Mac OS, Windows XP, Windows 10, Android, 
something else), and whether you are using the standard Python 
interactive interpreter or something else (IDLE, iPython, Anaconda, 
PyCharm, etc.).


-- 
Steve
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


 
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


 
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] "List" object is not callable

2016-05-01 Thread Jason N. via Tutor
Thank you all for your responses. 
I am using Py 2.7 and this time I copied and pasted the code from here: 
http://www.opentechguides.com/how-to/article/python/57/python-ping-subnet.html 
to my system but received the same error when I ran it. 
You can see the error screenshot here: https://unsee.cc/sonezima/ Thank you. 

On Saturday, April 30, 2016 11:12 PM, Steven D'Aprano  
wrote:
 
 

 On Sat, Apr 30, 2016 at 06:51:17PM +, Jason N. via Tutor wrote:
> Hello,
> I found this simple script online but when I execute it I get the 
> following error: "TypeError: 'list' object is not callable" Here is 
> the code sample:
>
> import subprocess
> ls_output= subprocess.check_output(['dir'])

The code snippet works fine.

Please check that the code you send is exactly the same as the code you 
are actually trying to run. Do not just retype the code from memory, 
copy and paste it.

Also, please copy and paste the full traceback that you get, not just 
the final error message. Everything from the first "Traceback" line to 
the end.

Finally, you should tell us what version of Python you are running, on 
what operating system (Linux, Mac OS, Windows XP, Windows 10, Android, 
something else), and whether you are using the standard Python 
interactive interpreter or something else (IDLE, iPython, Anaconda, 
PyCharm, etc.).


-- 
Steve
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


 
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] "List" object is not callable

2016-04-30 Thread Steven D'Aprano
On Sat, Apr 30, 2016 at 06:51:17PM +, Jason N. via Tutor wrote:
> Hello,
> I found this simple script online but when I execute it I get the 
> following error: "TypeError: 'list' object is not callable" Here is 
> the code sample:
>
> import subprocess
> ls_output= subprocess.check_output(['dir'])

The code snippet works fine.

Please check that the code you send is exactly the same as the code you 
are actually trying to run. Do not just retype the code from memory, 
copy and paste it.

Also, please copy and paste the full traceback that you get, not just 
the final error message. Everything from the first "Traceback" line to 
the end.

Finally, you should tell us what version of Python you are running, on 
what operating system (Linux, Mac OS, Windows XP, Windows 10, Android, 
something else), and whether you are using the standard Python 
interactive interpreter or something else (IDLE, iPython, Anaconda, 
PyCharm, etc.).


-- 
Steve
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] "List" object is not callable

2016-04-30 Thread bob gailer

On 4/30/2016 3:27 PM, Alex Kleider wrote:



On 2016-04-30 11:51, Jason N. via Tutor wrote:

Hello,
I found this simple script online but when I execute it I get the
following error: "TypeError: 'list' object is not callable"
Here is the code sample:import subprocess

ls_output= subprocess.check_output(['dir'])

It works on my system: Ubuntu 14.04LTS

Works on my Windows 10 also.

Always post the traceback. The problem must lie in check_output as there 
is nothing in your code that could raise that exception.


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] "List" object is not callable

2016-04-30 Thread Alex Kleider



On 2016-04-30 11:51, Jason N. via Tutor wrote:

Hello,
I found this simple script online but when I execute it I get the
following error: "TypeError: 'list' object is not callable"
Here is the code sample:import subprocess

ls_output= subprocess.check_output(['dir'])

It works on my system: Ubuntu 14.04LTS

(venv)alex@X301:~$ python
Python 3.4.3 (default, Oct 14 2015, 20:33:09)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.

import subprocess
ls_output= subprocess.check_output(['dir'])
ls_output
b'Airbnb\tBookSite  CURRENT  Documents  examples.desktop\tJs\t   
nextWIFI\t OpenWRT   Py\t   Solar  ToDo\t  WARNING\nARM\tC\t  debk\t 
  double gnupg.other\tLEFTOFFnode_modules  Pathagar  Rachel  
Templates  toDoAtLoft  wishes\nAVR\tclosures  Desktop  Downloads  
GPL\t\tLibreboot  Notes\t Pictures  SaskTest   Videos\t  
WWW\nbin\tContacts  Docbook  Encrypted  HTML5\t\tMusic\t   OLPC\t\t 
Publicski\t   tmp\t  vim_rewrap\n'

exit()

(venv)alex@X301:~$ dir
Airbnb	BookSite  CURRENT  Documents  examples.desktop	Js	   nextWIFI	 
OpenWRT   Py	   Solar  ToDo	  WARNING
ARM	C	  debk	   double gnupg.other	LEFTOFFnode_modules  Pathagar 
 Rachel  Templates  toDoAtLoft  wishes
AVR	closures  Desktop  Downloads  GPL		Libreboot  Notes	 Pictures  Sask  
  Test   Videos	  WWW
bin	Contacts  Docbook  Encrypted  HTML5		Music	   OLPC		 Publicski	  
 tmp	  vim_rewrap

(venv)alex@X301:~$ man dir


Perhaps you are using a linux command on a non linux (?Windows) system.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] "List" object is not callable

2016-04-30 Thread Jason N. via Tutor
Hello,
I found this simple script online but when I execute it I get the following 
error: "TypeError: 'list' object is not callable"
Here is the code sample:import subprocess

ls_output= subprocess.check_output(['dir'])
I searched online and found a another similar code sample 
(http://www.opentechguides.com/how-to/article/python/57/python-ping-subnet.html)
 but when I run it on my system I get the same error.Any feedback is very much 
appreciated.  Thank you.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor