Cash disk access python source code for sale to build a public network ip address

Here is information on python to access cash tray source sells content to build public network ip address q-1152880099, there should be the use of small partners.

import urllib,random,re

ip_regex = re.compile("(([0-9]{1,3}.){3}[0-9]{1,3})")

def public_ip():
''' Returns your public IP address.
Output: The IP address in string format.
None if not internet connection available.
'''
# List of host which return the public IP address:
for i in range(3):
host = random.choice(hosts)
try:
results = ip_regex.findall(urllib.urlopen(host).read(200000))
if results: return results[0][0]
except:
pass # Let's try another host
return None
#!/usr/bin/python
import os
import re

def getFile(path):

fList = os.listdir (path) # files in the specified directory in a list format output
the os.chdir (path)
docuPath The os.getcwd = () # Get root
the fileList = []
for F in FLIST: # of the directory file traversal
if os.path.isdir (f): # determine whether the file type is a directory
getFile (f) # directory if recursive run this function, continue to traverse.
the else:
FL = os.path.join (docuPath, f) # if it is a directory, combined with the file name and path to obtain root file absolute path
fileList.append (FL)
#Print (fileList)
return fileList

changeFile DEF ():
for J in the getFile ( "/ opt"): # called here functions on the list outputted fileList
a = open (j, "r ") # open each file
B = a.read ()
IF Re .findall ( "hello", b) : # determines whether or not the file containing the contents in the "hello"
C = Open (J, "W")
( "! HELLO \ n-") # c.write if they contain, the "hello" change as "HELLO".
a.close ()

changeFile()

Guess you like

Origin www.cnblogs.com/bozisuan/p/11236349.html