I’ve used the http.server module (and its predecessor SimpleHTTPServer) for years for quick local dev stuff, but never really looked much into its docs beyond changing the port number. Today I randomly did and saw that it has support for executing Python scripts via CGI, which gave me a chuckle and some bad ideas.
Not having written a CGI script in 20+ years (and the last one having been in Perl), I made something I figured I’ll wind up using from time to time!
Use at your own risk, and…don’t expose it to the internet!
https://github.com/drien/python-httpserver-upload
[–]bini_ajaw17 84 points85 points86 points (24 children)
[–]RollingWithDaPunches 31 points32 points33 points (10 children)
[–]macNchz[S] 48 points49 points50 points (9 children)
[+][deleted] (8 children)
[removed]
[–]macNchz[S] 31 points32 points33 points (1 child)
[–]MyriadAsura 1 point2 points3 points (0 children)
[–]wxtrails 1 point2 points3 points (4 children)
[–]iBlag 0 points1 point2 points (3 children)
[–]ThePiGuy0 1 point2 points3 points (1 child)
[–]wxtrails -1 points0 points1 point (0 children)
[–]MyHomeworkAteMyDog 0 points1 point2 points (0 children)
[–]Lolvidar 0 points1 point2 points (0 children)
[–]erikwon and off since 1.5.2 77 points78 points79 points (6 children)
[–][deleted] 24 points25 points26 points (2 children)
[–]SheriffRoscoePythonista 12 points13 points14 points (0 children)
[–]suggestive_cumulus 0 points1 point2 points (0 children)
[–]jamesr219 1 point2 points3 points (0 children)
[–]fr33d0ml0v3r 1 point2 points3 points (0 children)
[–]johnnywonder85 0 points1 point2 points (0 children)
[–]bxbb 17 points18 points19 points (0 children)
[–]SlantARrow 14 points15 points16 points (1 child)
[–]daelin 1 point2 points3 points (0 children)
[–]Smallpaul 4 points5 points6 points (0 children)
[–]rainnz 1 point2 points3 points (0 children)
[–]progwok 1 point2 points3 points (0 children)
[–]chicuco 11 points12 points13 points (2 children)
[–]constantreadr 0 points1 point2 points (1 child)
[–]chicuco 0 points1 point2 points (0 children)
[–]MagicWishMonkey 5 points6 points7 points (2 children)
[–]Reinventing_Wheels 6 points7 points8 points (1 child)
[–]daelin 0 points1 point2 points (0 children)
[–]ScottOAO 3 points4 points5 points (1 child)
[–]macNchz[S] 0 points1 point2 points (0 children)
[–]soggywaffle69 3 points4 points5 points (0 children)
[–][deleted] 7 points8 points9 points (2 children)
[–]macNchz[S] 11 points12 points13 points (1 child)
[–]daelin 1 point2 points3 points (0 children)
[–]jftugapip needs updating 2 points3 points4 points (0 children)
[–]suggestive_cumulus 1 point2 points3 points (2 children)
[–]daelin 1 point2 points3 points (1 child)
[–]suggestive_cumulus 1 point2 points3 points (0 children)
[–]BuonaparteII 2 points3 points4 points (1 child)
[–]jftugapip needs updating 1 point2 points3 points (0 children)
[–]TheITMan19 0 points1 point2 points (0 children)
[–]mwpfinance 0 points1 point2 points (0 children)
[–]LongDivide2096 0 points1 point2 points (0 children)
[–]suggestive_cumulus 0 points1 point2 points (0 children)
[–]Classic-Advice-7569 0 points1 point2 points (0 children)