python爬取服务器目录
Sometimes I'm working with a test HTML file and some JavaScript but need to work off of a served space. In that case, I sometimes need to swap out folders within MAMP Stack which leads to a maintenance nightmare. Bleh.
有时我正在使用测试HTML文件和一些JavaScript,但需要在服务空间之外工作。 在这种情况下,有时我需要换出MAMP Stack中的文件夹,这将导致维护的噩梦。 eh
I recently found out that you can serve up a directory using one Python command line directive:
我最近发现,您可以使用一个Python命令行指令为目录提供服务:
# Serves the current directory at: http://0.0.0.0:8000/
python -m SimpleHTTPServer
Excellent. No more directory and MAMP Stack juggling. Even better is that the command is easy to memorize so no need to constantly look it up. Keep this in mind when you want to work on something without a big server install!
优秀的。 不再需要目录和MAMP Stack。 更好的是该命令易于记忆,因此无需经常查找。 当您想在不安装大型服务器的情况下进行某些工作时,请记住这一点!
python爬取服务器目录