Git Product home page Git Product logo

changeip's Introduction

Python自动修改IP

为了避免无意义的重复输入,将一些参数写死是有必要的

这样就不需要每次运行程序都要输入一遍IP地址

所以如果你要用的话,你需要修改一下程序里面的IP

运行时需要以管理员运行

这个程序的对象是需要经常固定ip的人,比如校园网内

原来固定ip需要打开一堆窗口,自动获取IP的话又很慢

而且宿舍和教室两个地方网段不一样

使用这个程序将宿舍网段和教室网段写死在程序里面

每次只需要在最后的1~255选一个即可

不过我写成随机了,就是随机获取一个IP,然后固定

这样的话就不用输入了

classroom.py里面29行写的是

arrIPAddresses = ['10.104.111.'+str(ip_last)]

直接改成你所在的网段即可,因为教室的网段是固定的

dormitory.py里面

if isjiaban=='y' or isjiaban=='Y' :
    ip_3nd='161'
else :
    ip_3nd='160'

因为我们宿舍两个不同的地方是两个不同的网段

所以这里有个判断,然后IP的前两段是固定好的

arrIPAddresses = ['10.104.'+ip_3nd+'.'+str(ip_last)]

把IP改成你在的网段就行啦

changeip's People

Contributors

hongfeiyucode avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

changeip's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.