Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to make a python idle using tkinter ,I am almost done but I am facing this issue:

I am using subprocess module to run the code which user has written but i am trying to use the input statement the program is crashing and I do not know why

This is the code which is running the program:-
Python
def run():
    if file_path=="":
        save_prompt=Toplevel()
        text=Label(save_prompt,text='Please save your code!!',height=10,width=20)
        save_prompt.iconphoto(False, photo)

        text.pack()  
        return
    command=f"python {file_path}"
    process=subprocess.Popen(command,stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True)
    output,error=process.communicate()
    
    code_output.delete("1.0",END)

    code_output.insert('1.0',output)
    


    code_output.insert("1.0",error)


What I have tried:

I have tried visiting many sites and also tried changing my code but nothing is working. Please help
Posted
Comments
Richard MacCutchan 31-Aug-21 4:04am    
The first thing you need to do is to establish where the program crashes. Use the debugger and step through the above code until it fails, and that should give some clues as to why.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900