Personal IP checker. 01-24-2014, 03:40 AM
#1
It's basically an easy way to check your IP address without "whatismyip.com" or whatever that website is.
Import yo' shit, dawg.
We only need four imports. Pretty simple, right?
(PSST, I know I can use commas, I choose not to when importing modules)
Definitions
We will define events "loop" and "close".
This is where the OS module comes into play.
IP checker itself
This is pretty simple. All you do is load a few messages and then do an if, elif, else statement.
EVERYBODY NOW!
This is the code all together.
Hope you like what took my five minutes to code.
Somewhere down the road, I will be adding an IP hider.
Import yo' shit, dawg.
We only need four imports. Pretty simple, right?
Code:
import socket
import os
import sys
import time(PSST, I know I can use commas, I choose not to when importing modules)
Definitions
We will define events "loop" and "close".
This is where the OS module comes into play.
Code:
def loop(event):
os.startfile("ipchecker.py"),close(begin)
def close(event):
os.system('taskkill /PID %d /F' % os.getpid())IP checker itself
This is pretty simple. All you do is load a few messages and then do an if, elif, else statement.
Code:
msg = print("[IP CHECK]Loading."), time.sleep(2), print("[IP CHECK]Loaded."), time.sleep(1)
begin = print("[IP CHECK] %s " % socket.gethostbyname(socket.gethostname())), time.sleep(1)
answer = input("[IP CHECK]Reload? ")
if answer == "yes":
loop(begin), os.system("clear")
elif answer == "no":
try:
print("[IP CHECK]Process killed.")
close(begin)
except Exception as e:
print(e)
else:
print("[IP CHECK]Invalid command."), time.sleep(2), loop(begin)EVERYBODY NOW!
This is the code all together.
Code:
import socket
import os
import sys
import time
def loop(event):
os.startfile("ipchecker.py"),close(begin)
def close(event):
os.system('taskkill /PID %d /F' % os.getpid())
msg = print("[IP CHECK]Loading."), time.sleep(2), print("[IP CHECK]Loaded."), time.sleep(1)
begin = print("[IP CHECK] %s " % socket.gethostbyname(socket.gethostname())), time.sleep(1)
answer = input("[IP CHECK]Reload? ")
if answer == "yes":
loop(begin), os.system("clear")
elif answer == "no":
try:
print("[IP CHECK]Process killed.")
close(begin)
except Exception as e:
print(e)
else:
print("[IP CHECK]Invalid command."), time.sleep(2), loop(begin)Hope you like what took my five minutes to code.
Somewhere down the road, I will be adding an IP hider.
(This post was last modified: 01-24-2014, 04:01 AM by Equinox.)
![[Image: BXqGARG.png]](https://i.imgur.com/BXqGARG.png)








![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
![[Image: jWSyE88.png]](http://i.imgur.com/jWSyE88.png)