Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>"Does anybody know how can I open a webpage with python ? The second and most important question is: how can I return a value from a web page to my "original" python module ??"</p> <p>This is all very simple.</p> <p>However, you need to read about what the web really <em>is</em>. You need to read up on web servers, browsers and the HTTP protocol.</p> <p>Here's the golden rule: <strong>A web server responds to HTTP requests with a web page.</strong></p> <p>The second part of that rules is: <strong>A Request is a URL and a method (GET or POST).</strong> There's more to a request, but that's the important part.</p> <p>That's all that ever happens. So, you have to recast your use case into the above form.</p> <p>Person clicks a bookmark; browser makes an empty request (to a URL of "/") and gets a form. </p> <p>Person fills in the form, clicks the button; browser POST's the request (to the URL in the form) and gets one of two things.</p> <ul> <li><p>If your script worked, they get their page that says it all worked.</p></li> <li><p>If your script needed information, they get another form.</p></li> </ul> <p>Person fills in the form, clicks the button; browser POST's the request (to the URL in the form) and gets the final page that says it all worked.</p> <p>You can do all of this from a "CGI" script. Use mod_wsgi and plug your stuff into the Apache web server.</p> <p>Or, you can get a web framework. Django, TurboGears, web.py, etc. You'll be happier with a framework even though you think your operation is simple.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload