import os
import sys
def otworz(filepath = "zapis.txt"):
global line
f= open(filepath, "r")
for line in f:
print("odczyt z pliku")
print(line)
def zapis(filepath = "zapis.txt"):
f = open(filepath, "w")
stream = os.popen('dig')
output = stream.read()
output
f.write(output)
f.close()
def main():
print("podaj nazwe pliku")
pobrany_napis = input()
print("create file\n"+ pobrany_napis)
zapis(pobrany_napis)
otworz(pobrany_napis)
if __name__ == "__main__":
main()
No comments:
Post a Comment