I am using Python 2.7.3 on OS X 10.8.3, installed with MacPorts. If I hit command + c or command + x on content in IDLE, I can paste it with command + v into other apps. However, I cannot use command + v to paste into IDLE itself, either from other apps or from within IDLE.
If I highlight content in IDLE, a right-click on the mouse will duplicate (i.e. paste) that content. This is sort of a workaround, but it is annoying not to be able to paste URL's or code from outside of IDLE.
Make sure that you have the cursor more than one space after the last >>>. It won't paste unless you do.
The cmd+C and cmd+V commands weren't working for me either, so I removed them (and macports) and then installed python from the python.org website. I only needed numpy and matplotlib, so I installed those from their sources and it works.
It isn't a solution, but the broken hotkeys seem to have something to do with x11 (https://mail.python.org/pipermail/python-list/2010-January/563387.html). I installed XQuartz(http://xquartz.macosforge.org/landing/) and it still didn't help, so I just removed everything.
Related
I searched everywhere, but did not find an answer. Since I think the answers are outdated because they use python.pythonPath and this does not exist anymore.
My problem is the following:
But I installed Python#3.10 already via homebrew (I have a mac M1 with macOS Monterey).
If I use ,,which python3'', I will get:
And here you can see the output of ,,echo $PATH'':
What should I do, so that the error message does not appear again??
You have to click on 'No Interpreter Selected' and then you can add a path to python
If nothing else will work
Go on terminal and write your python-path\python.exe python-file.y.
If this works you can create a shell script inside of your folder and then put inside the python call. Then you can start your python file with the shell script.
You can go to the Extensions Library and download the Python Interpreter for VS Code. Make sure Python is installed on your PC.
If you still have problems, try reinstalling Python and VS Code.
I think the above two answers have been well analyzed. If you can't solve the problem, you can refer to the instructions of vsocde and reinstall python.
I have been programming with python for about half a year, and I would like to try manim ( the animation programme of 3blue1brown from youtube), but I am not sure where to start. I have not installed it, but I have tried to read up on it. And to be honest I do not understand much of the requirements of the program, and how to run it.
Google has left me without much help, so I decided to check here to see if anyone here is able to help.
From what I understand, you run manim directly in python and the animations are based on a textfile with code i assume is LaTex. I have almost no experience with python itself, but I have learned to use it through Thonny, and later Pycharm.
My main questions are: (Good sources to how to do this without being a wizard would be really helpful if they exist☺️)
Is it possible to install manim in pycharm, and how? Do i need some extra stuff installed to pycharm in order to run it? (I run a windows 64-bit computer)
If i manage to do this in pycharm, Will I then be able to code the animations directly in pycharm (in .py or .txt files), or is it harder to use in pycharm?
All help or insights is very appreciated😅 As I said I am not extremely knowledgeable in computers, but I am enjoying learning how to code and applications of coding😊
I recommend you this playlist
I always uses pycharm for manim.
Firstly i setup python interpreter by just open File->Settings->Projet->Project Interpreter then just press on little gear icon to add python interpreter to Existing environment and locate C:\Python3x\python.exe
Then just open a terminal from left-down corner and run some basic commands to run manim as mentioned in tutorials or manim github page.
Something that works nicely for me is to run manimgl.exe from Python in PyCharm using the subprocess module. It also goes well with using the run shortcut while iterating with small edits.
I like to do this from the script in which my main scene is defined, for example, I have main.py which defines MyScene:
from manimlib import *
class MyScene(Scene):
def construct(self):
...
if __name__ == '__main__':
import subprocess
params = 'manimgl main.py MyScene -c WHITE'.split()
subprocess.run(params,
check=True,
capture_output=True,
text=True)
# Possibly look at captured output here
The code inside if __name__ ... does not execute when the same script is loaded by manim. What is nice is that one can easily add automation steps before or after the actual execution if needed and it keeps everything related in a single script.
Edit: I also end the animations in the construct() method of MyScene with exit() to terminate the preview. I honestly don't know if this is good practice, but it works well for my usage pattern.
Note that this does require that manimgl.exe reside somewhere that is in your path, in my case (Windows) I installed this for my global Python interpreter. I followed the instructions on GitHub and it works for me because the following is in my path:
C:\Users\XXX\AppData\Local\Programs\Python\Python38\Scripts\
It may vary depending on where your Python is installed. For a venv, you could do something like:
params = '.\venv\Scripts\manimgl.exe ...'.split()
Yes, you can
1.Write your code in pycharm
2.save it
3.copy that .py file to where you installed manim. In my case, it is
This pc>> C drive >> manim-master >> manim-master
4.select on the path and type "cmd" to open terminal from there
Type this on the terminal
python -m manim -pql projectname.py
This will do.
To play back the animation or image, open the media folder.
For some reason, whenever I try to open a python script that has around ~450 lines of code, IDLE's windows simply appears empty and when I try to run it doesn't run anything either... However, if I try to run a smaller program it works for some reason. Does anybody know how I am able to run a python script on my Mac besides IDLE or how to fix the IDLE window being blank whenever I open a file?
To learn how to run Python Python programs on a Mac, read Chapters 1 and 4 of Python Setup and Usage. Running from an IDLE editor is just one way.
IDLE uses the tkinter module which wraps the tcl/tk GUI framework. Did you read and follow the instructions of how to replace the buggy tcl/tk that Apple supplies? Read the entire page before starting! Ignoring this page is the most common reason people have problems with IDLE on the Mac. There are a few others, but I do not remember one that matches your description.
I am working on a good Python environment for use on a Windows 7 machine. I am a big emacs fan, and like using the windows native build that's part of cygwin (emacs-w32). This way, I have access to all the cygwin tools from within emacs.
I also really like Anaconda's python distribution. I really don't feature downloading and maintaining all those packages myself, esp. within cygwin.
Also a big ipython fan.
On a Linux cluster, I'm having good luck using ipython as my python interpeter within emacs. I make a lot of plots, so matplotlib has to work too.
So I'm trying to get "ipython interpeter within cygwin emacs" to work.
Is this a good idea? Better ways to go? I know there's Spyder, but I honestly like working within emacs for editing .py files. Not just emacs keybindings - the whole emacs environment (grep, ediff, dired, etc etc).
Right now, I've gotten emacs to pick up ipython in the python 3 anaconda install. It runs, but I get extransous characters, e.g.:
^A^BIn [^A^B1^A^B]: ^A^B
instead of In [ 1 ]:
Also figure windows tend to not work (figure appears, but Windows says Not Responding, plots don't appear).
Thanks.
Update:
Thanks for the response. I did some more playing. To be exact:
* Setup bash path so Anaconda python and ipython found
* Started ConEmu (windows terminal program)
* ran bash from a cmd (dos) prompt
* ran cygwin's emacs: emacs -nw -Q (no window and no customization)
* Open .py file, C-c C-z, runs Anaconda python -i
* Get these messages:
Make dedicated process? (y or n) n
Making python-shell-interpreter local to Python while let-bound!
Making python-shell-interpreter-args local to Python while let-bound!
funcall: Args out of range: "^M", 0, 2
The final line appears in the emacs "status line" at the bottom. There is a buffer with Python running, seems to be fine. Except Ctrl-D doesn't work. If I type 'quit', I get the message "Use quit() or Ctrl-Z plus Return to exit." What happened to Ctrl-D?
If I repeat the exercise with ipython, the same messages are given, ipython buffer runs, I get the random ^A^B's, Ctrl-D doesn't work.
I would like to be able to open a simple program I have written with the editor Canopy (from Enthought) without opening the editor itself, only with a double click on something.
I work on a mac.
I tried to go with: right-click + get info + open with... + "python launcher". But it doesn't work. I don't know if it is because my program uses Canopy specific packages like Traits and TraitsUi.
Thanks a lot for any help!
Bye!
Normally you should use the terminal
$python yourpgrogram.py
If you really need to double-click try pyinstaller to make a bundled app.