I coded a little Python programm that gets the content of files in the internet. It´s working with cURL and tkinter. The code I wrote:
from tkinter import *
import tkinter as tk
import socket
import os
root = tk.Tk()
root.title("Website Code Getter v1.8")
root.geometry("400x200")
root.resizable(False, False)
labelURL = tk.Label(root, font=("times", 15, "bold"), text="URL + /file.fileEnding [not required]").grid(row=1, column=1)
entryURL = tk.Entry(root)
entryURL.place(x=50,y=28, width=250, height=25)
def submit_url():
global url
url = entryURL.get()
writeOut = os.system(f"curl {url}")
file = open("1.txt", "w")
file.write("Code: "+ repr(writeOut))
file.close()
submitURL = tk.Button(root, text="Submit", command=submit_url).grid(row=3, column=3)
root.mainloop()
As shown above it´s very simple but when I try to write out the writeOut
function into "1.text" in writing mode, it doesn´t work. There´s no error but in the "1.txt"
there is only this:
Code: 0
In the console is the content but not in the file. I already used the function repr()