Hi guys, I’m trying to learn python so I downloaded the Spyder but every time I wrote a code like this:
print(3 + 5)
console show it with a message like this:
I can’t get rid of this runfile… thing. I try to search for a solutions on forums but I couldn’t find anything. I’m using Python 3.8.
I’m wondering which app do you use for python and do you know how can I rid of from this runfile… thing. Because it’s cause really big mess on console.
I’m not sure if this will work, but try to clear the console by adding this at the start of your script(s):
cls = lambda: os.system('cls') # For linux, change it to 'clear'
# Put your code after this
You can just run your scripts/programs using the console (assuming it’s on your PATH environment variable) with:
Hope it helps ,
Regards and happy coding!
Thank you for answering.
Actually I’ve already try this codes you writing but now I tried it again:
cls = lambda: os.system(‘cls’) # For linux, change it to ‘clear’
print(3 + 5)
But I got a same result:
Sorry I didn’t get this can you explain :
“assuming it’s on your PATH environment variable”
It seems that there’s no way to remove it as explained here: https://github.com/spyder-ide/spyder/issues/2254.
You could write something like this though:
print(5 + 3)
This would print the string and 4 new lines before your output.
PATH variable is a configuration that tells the OS where to find certain programs. Just to keep it DRY, you can read more about it here.
Search online on how to set it up on Windows , it’s not hard to configure.
Through this codes I’m getting the runfile message for just once. Now my console is look more clear, thank you.