Python Forum
writing and running code in vscode without saving it
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
writing and running code in vscode without saving it
#1
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
Reply
#2
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.
akbarza likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in running a code akbarza 7 662 Feb-14-2024, 02:57 PM
Last Post: snippsat
  the order of running code in a decorator function akbarza 2 535 Nov-10-2023, 08:09 AM
Last Post: akbarza
  Code Assistance needed in saving the file MithunT 0 821 Oct-09-2022, 03:50 PM
Last Post: MithunT
  I use VsCode with Python and it currently won't let me run any code NordicMonkey 2 1,526 Sep-18-2022, 08:42 PM
Last Post: Larz60+
  Code running many times nad not just one? korenron 4 1,376 Jul-24-2022, 08:12 AM
Last Post: korenron
  Error while running code on VSC maiya 4 3,776 Jul-01-2022, 02:51 PM
Last Post: maiya
  code running for more than an hour now, yet didn't get any result, what should I do? aiden 2 1,514 Apr-06-2022, 03:41 PM
Last Post: Gribouillis
  Why is this Python code running twice? mcva 5 5,296 Feb-02-2022, 10:21 AM
Last Post: mcva
  Python keeps running the old version of the code quest 2 3,789 Jan-20-2022, 07:34 AM
Last Post: ThiefOfTime
  My python code is running very slow on millions of records shantanu97 7 2,588 Dec-28-2021, 11:02 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020