python爬取服务器目录_通过Python服务目录

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。 更好的是该命令易于记忆,因此无需经常查找。 当您想在不安装大型服务器的情况下进行某些工作时,请记住这一点!

翻译自: https://davidwalsh.name/serve-directory-python

python爬取服务器目录

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值