Replaced the native commands to read a file

This commit is contained in:
clamsawd 2015-10-29 18:02:23 +01:00
parent 0ef4b20d37
commit 8229d467e1
2 changed files with 6 additions and 10 deletions

View File

@ -74,15 +74,12 @@ def writeip2ecf():
os.remove("ip2e-conf.py") os.remove("ip2e-conf.py")
createip2ecf() createip2ecf()
writeip2ecf() writeip2ecf()
exec(open("ip2e-conf.py").read())
#Show the configuration #Show the configuration
ClearScreen() ClearScreen()
print ("") print ("")
print ("ip2e-config v"+version+" - Current config.file") print ("ip2e-config v"+version+" - Current config.file")
print ("") print ("")
if os.name == "posix": readfile=open('ip2e-conf.py', 'r')
os.system("cat ip2e-conf.py") print(readfile.read())
elif os.name == "nt": readfile.close()
os.system("type ip2e-conf.py")
print ("")

View File

@ -72,10 +72,9 @@ else:
if os.path.isfile("ip2e.log"): if os.path.isfile("ip2e.log"):
print ("ip2e.log exists") print ("ip2e.log exists")
ClearScreen() ClearScreen()
if os.name == "posix": readfile=open('ip2e.log', 'r')
os.system("cat ip2e.log") print(readfile.read())
elif os.name == "nt": readfile.close()
os.system("type ip2e.log")
else: else:
ClearScreen() ClearScreen()
print ("") print ("")