python-cgi

2017-02-07  本文已影响0人  Programming

input the following command:

wgz@wgz:/tmp/test$ python3 -m http.server --bind localhost --cgi

file cgi.html

<form action='cgi-bin/cgi_test.py' method='post'>

<p>Username</p>

<p><input type='text'></p>

<p><input type='submit'  value='Login'></p>

file cgi_test.py

#! /usr/bin/env python3

print('Content-type: text/html\n')

print('hello world')

上一篇下一篇

猜你喜欢

热点阅读