Python Forum

Full Version: writing and running code in vscode without saving it
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi
I want to write some code in vs code and then run it without saving the code in any place. is it possible?
if it is possible, how can I do it?
for example, I want to run the below code without saving it on my hard drive. is it possible?
set_a={1,2,3,4}
set_b= {3,4,5,6}
result_set=set_a+set_b
print(result_set)
thanks
Depends on what you mean. If you are asiking if there is a way to write a program without creating a file, that cannot be done. I use "test.py" as my scratchpad file when writing throwaway code snippets.

There is nothing stopping you running python in a terminal in VS code and typing commands in REPL.