V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
xiayibu
V2EX  ›  Python

哪位朋友知道如何用 Python 控制 centos ADSL 拨号换 IP

  •  
  •   xiayibu · 2017-06-15 18:28:03 +08:00 · 2761 次点击
    这是一个创建于 2513 天前的主题,其中的信息可能已经有所发展或是发生改变。
    7 条回复    2017-06-16 08:11:33 +08:00
    laoyur
        1
    laoyur  
       2017-06-15 18:49:39 +08:00
    目测楼主在做拨号 vps 方案
    os.system 调一下 shell 进行重拨不行?
    xiayibu
        2
    xiayibu  
    OP
       2017-06-15 19:12:37 +08:00
    @laoyur 可以提供具体代码吗
    laoyur
        3
    laoyur  
       2017-06-15 19:18:06 +08:00   ❤️ 1
    代码不是很直白嘛

    事先配置好 pppoe 参数
    ```
    os.system('ifdown ppp0')
    os.system('ifup ppp0')
    # 此时就已经拨号成功了呗
    ```
    onion83
        4
    onion83  
       2017-06-15 19:44:10 +08:00   ❤️ 1
    xiayibu
        5
    xiayibu  
    OP
       2017-06-15 19:53:38 +08:00
    @onion83 谢谢
    yanzixuan
        6
    yanzixuan  
       2017-06-15 23:32:00 +08:00
    一看就知道是搞爬虫哦的。
    bestkayle
        7
    bestkayle  
       2017-06-16 08:11:33 +08:00 via Android
    @yanzixuan 搞爬虫为啥不用代理 ip,也不贵
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2208 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 03:50 · PVG 11:50 · LAX 20:50 · JFK 23:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.