Jump to content


Photo

Chapter8, Coachapp.py Error


  • Please log in to reply
5 replies to this topic

#1 ahnmh

ahnmh

    New Member

  • Members
  • Pip
  • 4 posts

Posted 01 September 2013 - 03:00 AM

I upload "coachapp.py" to avd. And when i open the file, error comes out like below.

urllib2 URLError: <urlopen error [Errno 111] Connection refused>

I already read the similar questions. And follow the same step to resolve problem.

Change the IP address from 127.0,0.1 to my own IP address found by terminal.

But Still same error statement comes out even though I change the IP address.

Also when I open the website "http://10.5.5.5[for example]:8080/generate_names.py" at my emulator, the error page comes out.

But when I open it at my computer, it works.


I am practicing this steps at virtualbox, could it be a problem?

#2 ahnmh

ahnmh

    New Member

  • Members
  • Pip
  • 4 posts

Posted 01 September 2013 - 04:43 AM

Finally solved this problem.

The problem was the wrong IP address.

When typing IP address "10.0.2.2". it resolves the problem.

For more information, click here

#3 mgfacioli

mgfacioli

    New Member

  • Members
  • Pip
  • 1 posts

Posted 20 November 2013 - 10:57 AM

Finally it worked!

I followed these instructions and the application brought the list of athletes, as expected.

The variable Web_Server looked like this: Web_Server = 'http://10.0.2.2:8080'

Thank you!

#4 emozhe

emozhe

    New Member

  • Members
  • Pip
  • 6 posts

Posted 24 December 2013 - 05:38 AM

1) Windows7 PC
2) Python3.2 on PC
3) sl4a_r3.apk on AVD (Android device)
4) PythonForAndroid_r1.apk on AVD (Android device)
5) AVD = Android 4.0 (API14)

Starting simple_httpd on port: 8080
127.0.0.1 - - [24/Dec/2013 17:19:49] "GET /cgi-bin/generate_names.py HTTP/1.1" 200 -
127.0.0.1 - - [24/Dec/2013 17:19:50] command: C:\Python33\python.exe -u C:\Python33\HeadFirstPython\chapter8\webapp-chapter8\cgi-bin\generate_names.py ""
127.0.0.1 - - [24/Dec/2013 17:19:50] CGI script exited OK

#5 emozhe

emozhe

    New Member

  • Members
  • Pip
  • 6 posts

Posted 24 December 2013 - 05:40 AM

coachapp.py can't runing

#6 emozhe

emozhe

    New Member

  • Members
  • Pip
  • 6 posts

Posted 24 December 2013 - 06:32 AM

I upload "coachapp.py" to avd. And when i open the file, error comes out like below.
coachapp.py started!
coachapp.py exited!
The variable Web_Server looked like this: Web_Server = 'http://192.168.1.100:8080'




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users