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 年 6 月 15 日 · 3161 次点击
    这是一个创建于 3133 天前的主题,其中的信息可能已经有所发展或是发生改变。
    7 条回复    2017-06-16 08:11:33 +08:00
    laoyur
        1
    laoyur  
       2017 年 6 月 15 日
    目测楼主在做拨号 vps 方案
    os.system 调一下 shell 进行重拨不行?
    xiayibu
        2
    xiayibu  
    OP
       2017 年 6 月 15 日
    @laoyur 可以提供具体代码吗
    laoyur
        3
    laoyur  
       2017 年 6 月 15 日   ❤️ 1
    代码不是很直白嘛

    事先配置好 pppoe 参数
    ```
    os.system('ifdown ppp0')
    os.system('ifup ppp0')
    # 此时就已经拨号成功了呗
    ```
    onion83
        4
    onion83  
       2017 年 6 月 15 日   ❤️ 1
    xiayibu
        5
    xiayibu  
    OP
       2017 年 6 月 15 日
    @onion83 谢谢
    yanzixuan
        6
    yanzixuan  
       2017 年 6 月 15 日
    一看就知道是搞爬虫哦的。
    KgM4gLtF0shViDH3
        7
    KgM4gLtF0shViDH3  
       2017 年 6 月 16 日 via Android
    @yanzixuan 搞爬虫为啥不用代理 ip,也不贵
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3081 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 309ms · UTC 13:21 · PVG 21:21 · LAX 05:21 · JFK 08:21
    ♥ Do have faith in what you're doing.