How Can I Get The RUN Button In Visual Studio Code To Turn GREEN ...
Có thể bạn quan tâm
- Insights Blog -- Browse All Articles -- Physics Articles Math Articles Education Articles Bio/Chem/Tech Articles
- Forums Chemistry Biology and Medical Earth Sciences Computer Science Computing and Technology DIY Projects
- Trending
- Chemistry
- Biology and Medical
- Earth Sciences
- Computer Science
- Computing and Technology
- DIY Projects
- Forums
- Other Sciences
- Computing and Technology
- Thread starter Thread starter SamRoss
- Start date Start date Nov 30, 2021
- Tags Tags Code Green Latex Python Visual
Attachments
-
white triangle.PNG 20.3 KB · Views: 389 -
green triangle.PNG 16.5 KB · Views: 414
- How symmetry can come to the aid of machine learning
- The future of AI could be great—or catastrophic
- Researchers harness large language models to accelerate materials discovery
anorlunda said: The obvious first question to ask, "Have you tried rebooting?"I have, yes. pbuk Science Advisor Homework Helper Gold Member Messages 4,970 Reaction score 3,222 The Python debugger in VS Code (or for that matter any IDE) is designed for debugging, not live runs against large datasets and/or spawning multiple external processes. I won't go into the technology of how VS Code does that (unless somebody asks really nicely :D), but in essence because of the way Python works it is a bit of a kludge. So develop, test and debug your program using a couple of simple structures, and then when you are done do a test run with the full dataset from the command prompt with python master.py. SamRoss Gold Member Messages 256 Reaction score 36
pbuk said: ...do a test run with the full dataset from the command prompt with python master.py.Hello again @pbuk :) . I seem to be having the same problem even in the command prompt (except for the fact that running the master file from the command prompt did not stop other python files from working in vscode). Below are pictures of what's going on. I called my make_worksheet function to make 12 copies of the "fractions intro" worksheet and name it "attempt 34". I typed python master.py in the command prompt and then tried viewing the generated latex file in vscode (should I not have done that?). As you might be able to make out from the third picture below if you squint hard enough, I got 2 versions of the worksheet as opposed to the requested 12. Again, the latex file stopped at a \newpage (every worksheet template ends with \newpage). It did not go any further than that and it did not pull my "template - end.tex" file which is just a .tex file that has \end{document} written on it which I need to complete the created attempt file. I also noticed that in the command prompt, I am not able to enter any new commands unless I exit and open it up again.
Attachments
-
master pic.PNG 4.8 KB · Views: 250 -
command prompt.PNG 3.4 KB · Views: 233 -
worksheet pic.PNG 29.6 KB · Views: 221
pbuk Science Advisor Homework Helper Gold Member Messages 4,970 Reaction score 3,222 Also I notice that you are working on this in a Dropbox folder; that is probably not a good idea as Python will be competing with Dropbox for handles for the files. Probably best to do all development work in a folder that does not have any kind of live backup (or any backup at all - you are using git?) pbuk Science Advisor Homework Helper Gold Member Messages 4,970 Reaction score 3,222 Mark44 said: Here is something to try: At the top of your code, add this line -- import sys Add this as the last line -- sys.exit() I believe that the reason the triangle doesn't turn green is that your Python script isn't returning control back to the operating system. By importing the sys module and calling its exit() method, that should signal VS Code that your program has finished.No, you don't need sys.exit or anything else, a Python script terminates at the end of the file. SamRoss Gold Member Messages 256 Reaction score 36
pbuk said: Sounds like in attempting to create 12 output files you are spawning 12 processes which are not terminating properly. Are you running tex2pdf or similar as part of this process?No, I'm not. Should I be? Here are some pics of the make_worksheet function if it's helpful.
Attachments
-
Screenshot (1).png 32.6 KB · Views: 250 -
Screenshot (2).png 38.6 KB · Views: 216 -
Screenshot (3).png 37.8 KB · Views: 238
DaveC426913 said: Am working on a fix in Photoshop. Plz attach full-size uncompressed screenshot.Thanks for the help, @DaveC426913. What exactly do you need a screenshot of? Last edited by a moderator: Nov 30, 2021 SamRoss Gold Member Messages 256 Reaction score 36![]()
pbuk said: Also I notice that you are working on this in a Dropbox folder; that is probably not a good idea as Python will be competing with Dropbox for handles for the files. Probably best to do all development work in a folder that does not have any kind of live backup (or any backup at all - you are using git?)I'm not using git. In fact, although I've heard it mentioned over and over, I'm not really quite sure what it is. I suppose my next step should be to look into it. Dropbox is where I've been keeping all my important files for many years. Guess I'll have to make a change. pbuk Science Advisor Homework Helper Gold Member Messages 4,970 Reaction score 3,222 Dropbox (and Google Drive, MS OneDrive etc.) is fine for a typical document that you work on and save (or autosave) every few minutes. When you are developing software (not so much Python admittedly), the compiler and debugger may create many temporary files in your working directory. This confuses Dropbox.
SamRoss said: Thanks for the help, #DaveC426913. What exactly do you need a screenshot of?I think @DaveC426913 was trying to make a joke.
SamRoss said: No, I'm not [spawning external processes]. Should I be? Here are some pics of the make_worksheet function if it's helpful.No, you don't want to spawn tex2pdf processes in any big loops, that could only make things worse. You are opening and closing files a bit more than is ideal, but you do seem to be closing them properly and you are not running multiple copies of the program simultaneously so I can't see any obvious problem. Oh unless your gen_times_tables etc. functions are causing some recursion? I assume these set the global variables which you then substitute in: this is horrible, as is the hard coding of variable names for substitution (you could replace all of this with functions that return a dict with the keys as the placeholder text and the values the text to substitute), and you don't need the up_to variable, you can just use the length() of the relevant dict. SamRoss Gold Member Messages 256 Reaction score 36
pbuk said: Oh unless your gen_times_tables etc. functions are causing some recursion? I assume these set the global variables which you then substitute in: this is horrible, as is the hard coding of variable names for substitution (you could replace all of this with functions that return a dict with the keys as the placeholder text and the values the text to substitute), and you don't need the up_to variable, you can just use the length() of the relevant dict.Yes, that is what I've been doing. I do have a heck of a lot of global variables which did seem awkward to me. I'll try the dictionary strategy and let you know how it goes.
Similar threads
How do I connect a button pressed signal with code in Godot 4?- Dec 27, 2023 · Replies 1 · Dec 28, 2023
- Mar 8, 2024 · Replies 2 · Mar 9, 2024
- Mar 18, 2022 · Replies 13 · Mar 25, 2022
- Nov 20, 2019 · Replies 2 · Nov 20, 2019
- Aug 6, 2022 · Replies 5 · Aug 7, 2022
- Jan 28, 2014 · Replies 16 · Jan 31, 2014
- May 7, 2019 · Replies 3 · Oct 7, 2019
- Feb 10, 2013 · Replies 2 · Feb 10, 2013
- Apr 27, 2012 · Replies 6 · Apr 27, 2012
- May 15, 2012 · Replies 6 · Jun 21, 2013
- Forums
- Other Sciences
- Computing and Technology
Hot Threads
-
On Progress Toward AGI
- Started by gleem
- Jul 2, 2025
- Replies: 37
- Computing and Technology
-
How far will we let AI control us?
- Started by Neutrin0
- Nov 27, 2025
- Replies: 79
- Computing and Technology
- W
What Free Privacy-Focused AI Chatbots Don’t Use My Data for Training?
- Started by WWGD
- Nov 11, 2025
- Replies: 15
- Computing and Technology
-
If you think having a backup is too expensive, try not having one
- Started by nsaspook
- Oct 8, 2025
- Replies: 32
- Computing and Technology
-
Is this a good deal (laptop)?
- Started by paulb203
- Jul 3, 2025
- Replies: 12
- Computing and Technology
Recent Insights
-
Insights Thinking Outside The Box Versus Knowing What’s In The Box
- Started by Greg Bernhardt
- Oct 13, 2025
- Replies: 26
- Other Physics Topics
-
Insights Why Entangled Photon-Polarization Qubits Violate Bell’s Inequality
- Started by Greg Bernhardt
- Sep 29, 2025
- Replies: 28
- Quantum Interpretations and Foundations
-
Insights Quantum Entanglement is a Kinematic Fact, not a Dynamical Effect
- Started by Greg Bernhardt
- Sep 2, 2025
- Replies: 20
- Quantum Physics
-
Insights What Exactly is Dirac’s Delta Function? - Insight
- Started by Greg Bernhardt
- Sep 2, 2025
- Replies: 33
- General Math
-
Insights Relativator (Circular Slide-Rule): Simulated with Desmos - Insight
- Started by Greg Bernhardt
- Sep 2, 2025
- Replies: 1
- Special and General Relativity
- P
Insights Fixing Things Which Can Go Wrong With Complex Numbers
- Started by PAllen
- Jul 20, 2025
- Replies: 7
- General Math
Từ khóa » Visual Studio Code Python Run Button
-
Get Started Tutorial For Python In Visual Studio Code
-
Python In Visual Studio Code
-
The Run Button In VS Code Don't Show Up [Python] - Stack Overflow
-
R/vscode - How To Make “Run” Button To Run Python Code In ... - Reddit
-
Setup Visual Studio Code Python Run Keyboard Shortcut - YouTube
-
Where Is The 'run' Button In Visual Studio Code? - Quora
-
How Do You Show The Run Button In Visual Studio? - Quora
-
Run Button Is Missing · Issue #134656 · Microsoft/vscode - GitHub
-
Advanced Visual Studio Code For Python Developers
-
Run Django Server Using The Run Button In Visual Studio Code
-
Python In Visual Studio Code – June 2022 Release
-
How Can I Get Run Button In VS Code To Turn Green? - CodeProject
-
Top 18 No Run Button In Visual Studio Code Python En Iyi 2022
-
Running Python In VS Code - Medium