I would have 2 questions:
I opened a python file with Xcode and it seems to have recognized it, but still the syntax coloring doesn't seem like python, so how to make it correspond ?
I tried to create a new Python project with Xcode following the instructions on this website: https://ericasadun.com/2016/12/04/running-python-in-xcode-step-by-step/ , but gives me "ERROR: unknown command "$(SRCROOT)/Work.py". I want to precise that it didn't give me the executable directly I had to select it myself in "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9". I tried some suggested fixes as changing the "$(SRCROOT)/Work.py" by the path till Work.py : "/Users/user/Downloads/Python/Work.py". But still it persisted on the same error. So the question is how to make Xcode run a python code given the issues I encountered ?
Thanks !
So I fixed it by searching Work.py file and where I saved it. After that hit right click on the Work.py file and click on Get Info. Expand General: and then copy the text from Where:. Paste that in that Argument box and close the windows. Everything should work now.
Related
I recently installed the Python VSCode extension, and when I did it popped up with a handy tutorial page.
However, after closing it, I cannot for the life of me figure out how to get this page back.
I've tried reinstalling the extension, checking through all of the commands, modifying settings, nothing seems to work.
Checking through the repo for the python extension, there seems to be a onWalkthrough:pythonWelcome that creates this page. However, I have absolutely no idea how to manually invoke this again.
Does anyone know how to do this? I know it's not strictly necessary, but I just assumed it would be easy and was surprised and stubbourn when it wasn't.
After asking the devs directly, it seems that it's extremely simple!
Get Started: Open Walkthrough... in the command palette will open a menu of available walkthroughs from extensions you've installed, including the Python one I was trying to find.
It has been removed, you can refer to these page for more details:
Should we not open the start page if a user already has a folder open?
Python Start Page
Welcome page opens while I am starting to type in a python file
Remove start page and its build dependencies
Whenever I try to run my python code or even the simplest hellow command in VS Code's termilnal, it is just showing this:
C"/users/admin/document/my python file
Why does it happen?
Oh, this is more like an VS-Code question. But anyways: I believe you have to use a command to run the file, just like this:
py <file-path-here>
Example:
py example.py
Also, maybe try installing the Python extension in VSCode.
And make sure you have Python installed correctly (check the button "add Python to path" in the first page of the Python installation setup).
If all of this does not work, make sure to select the correct Python version in VSCode by doing this:
Go to top menu, click view, command pallete, type Python Select Interpreter and choose the correct version.
Also, check if the file ends with .py so VSCode knows that you are working with a Python file.
Since you're new here: you can support me a lot by upvoting this answer or marking this as an answer. <3 Thanls
I am currently learning to code with python in vscode but recently I have been having problems with file seemingly deleting themselves after attempted execution (image 1). I have tried Ctrl+z and I have tried recovering them but neither have worked. The files are not in my recycling bin either. If I try to create a new file of the same name in the same folder it shows me a error message (image 2) of "unable to resolve non-existing files"
When I execute my code the file saves but then becomes deleted:
This message appears if I try to undo the delete:
Have you tried to restart vscode? It is recommended that you could try the following aspects:
Check if there is any effect caused by the related expansion. For example, LaTeX Workshop extension has the function of cleaning generated files.
Check your setting.json Files,clear the contents of the user setting.json file and the vs code will return to the default value.
If it still doesn't work, you could consider installing vscode again.
Try running the Python file through a command prompt or terminal using the command python <foo_file_name>. Doing this will either confirm or deny the theory that #jasonharper made in the comments.
If you can run the script that way then we know that #jasonharper was correct and somehow your execute button/command was tampered with.
I had a similar issue using a different programming language. Building generated a file that got deleted automatically.
In my case the Windows 10 default antivirus was the cause. Turned off real-time scanning, tried again and then my files weren't deleted.
Adding an exception for the folder fixed it.
I had the Same problem with a PHP file, and turns out it wasn´t VS CODE. It was my antivirus that was moving the file to quarentine!!
I just installed gnuradio-companion (for about the 10th time).
When I try to run it by clicking on gnuradio-companion.py in the bin folder all I get is a python screen with a blast of text that closes before I can see what it says. When I first tried it I got the errors about the paths not being right. I corrected them and now I just get this flash. Is there some way to keep the screen open so I can see the errors?
Background: I said this was (about) my 10th attempt. After many failures I got to the point that I had version 3.6.?.? running except it didn't have the source I needed (rtl-sdr). I found that if I installed version 3.7.?.? I could get some of the source components from 3.7 and copy them to the 3.6 folder but there were some osmosdr files I couldn't find. I decided that by now, after all these attempts, maybe I should uninstall everything associated with gnuradio and do a clean install using v3.7.13.4/v1.5 from http://www.gcndevelopment.com/gnuradio/downloads.htm
I assumed at that point that all I had to do was click on gnuradio-companion.py in the bin folder. Well, I had to make the python that came with this download the default for .py file types. Then I had to get the paths right (as I said above). Now I am stuck at the flashing screen. Did I miss something else in this install process?
Try putting input() at the end of the code to have it wait for user input before it finishes executing and closes
I recently booted up my Pyzo IDE with the intention of doing some programming, however, upon starting up the python shell it gave this following error:
The given path was not found
The process failed to start (invalid command?). (1)
I am not able to run any code with this error. If I try to run it nothing happens and the error re-appears.
I have tried reinstalling the whole thing without success, I have tried reading the log but there was no error message and I have also tried looking for posts regarding the same problem without success. I was hoping if someone could explain what my problem is and a possible solution, thanks.
This is how I fixed it:
I went to miniconda3 file in C:\Users\<user>\Miniconda3 (might be in other file/the thing is you need to find the miniconda3 file)
Find the Python application
Rename it to "python.exe"
Then go to shell configuration and replace the path to the operable python program in "exe" with your path (for me it was
C:\Users\<user>\Miniconda3\python.exe)
For me the solution was much simpler than the solution proposed.
I had misspelled the path to python.exe
Go to Shell tab
Press the button that says Python and has a small arrow at the right bottom
After pressing the button a drop-menu will appear. In this meanu choose Edit shell configurations ...
A new window will open. In this window put the correct path in the exe field
The path for me (windows 7) was c:\users\user\appdata\local\programs\python\python38\python.exe. For other users might be different