I have a rather small Pygame based python script and I just bought a Mac so I'm trying to run my script on here. Everything has been installed correctly (Checking by typing 'import Pygame') into python terminal as-well as running a basic hello world program. However, when I try running this script, IDLE gets brought to the front but nothing happens from there. (The script is supposed to pop-up a new window). Is this a problem with my installations or my code? (Code works on windows setup).
You could try to run the script again on a windows computer to see if you forgot to save some changes or if the file got corrupted somehow. You could also use bootcamp to install Windows on your mac since you could have one windows version on your mac for coding purposes and the regular mac OS for other stuff if you like.
you can execute it by left clicking in your script and select open with python launcher
Related
It seems that the spyder has removed python console, but I got a program can only be run by python console, what can I do? or is there any thing I am wrong?
I got some codes from github, and it needs ADB driver for Android, after I installed ADB, I can run the program in cmd using python wechat_jump_auto.py, but cannot run in spyder with ipython.
In Spyder3 installed in Windows OS, we can add the path to adb using Tools --> Current user environment variables....
Here, we can add the path to adb.exe file by appending it to the path variable. Then, we need to restart Spyder3. Then you will be able to directly run your script with access to adb.exe from Spyder3 IPython console or simply by clicking Run button.
Just came across the same problem as you recently.
In fact, it seems that program using ADB tools just cannot run in Spyder even by python console (my Spyder IDE is equipped with both Ipython console and Python console).
One practical way to solve this problem is to run your code in cmd.
Open your cmd window and do something like this:
python "xxx(path)\xxxx.py(file name)"
In my case, it looks like this:
example image
Hit Enter, and hopefully your code will run successfully.
If it still cannot run, maybe you haven't set your environment variables correctly.
Hope this can solve your problem. Good luck :)
I am very new to R, and should only have two plugins that get loaded specifically for *.R scripts: jalvesaq/Nvim-R and vim-pandoc/vim-rmarkdown. However, I shall see the following error message every time I open an *.R file:
The problem when I open an R-script
On a MacBook Air (through MacVim):
On a Windows machine (Gvim):
I would need to click on the Reopen button for once; and the Close program button for twice. Afterwards, the Nvim-R plugin runs with no problem.
Possible solution?
Can I possibly get ride of these warnings? And/or, should this be a Vim-Python support problem? When starting the python-mode plugin, I get a Windows R6034 runtime error.
I have no trouble using other plug-ins that also calls Python, including: VOom, vim-tex and
Partial solution on Windows platforms
To delete all existing Python and Vim distribution;
To install a 64-bit Python (my version that worked is Python 2.7.14)
To install a 64-bit built Gvim (I found it from Cream, build Vim 8.0-1123)
Sanity check
Open a Vim with the following plug-ins loaded: Nvim-R, klen/python-mode.
To open a *.R file
To open a *.py file
Pending solution on Mac OS X
Also asked a question through the Mac-superuser forum: https://apple.stackexchange.com/questions/302213/how-to-properly-use-macvim-on-os-x-and-to-delete-the-duplicative-app-via-fi
I recently created a small python program that I distributed to a few friends. In order to make it more easy for them to launch the program, I used files named maclaunch.command and winlaunch.cmd files for mac and windows respectively so they could just double click the file in order to launch the program.
The program works fine on my computer (mac), and I tested it on a windows laptop we had lying around (windows 8) and it worked fine there as well. However, after I distributed it to a few friends and having them install Python 3 (the version of python that I am using) we appear to be experiencing an error in windows 10 where the winlaunch.cmd file doesn't launch the program, instead flashing the command line app for just a second. It is supposed to launch the command line, but it should remain open long enough for people to read it. The program runs fine when I have them use IDLE to open and run it.
Here is the code for winlaunch.cmd (the one for windows):
py -3 source.py
Any one have some insight into how to fix this?
I am learning Python and came across this problem. I know that i can put "input()" at the bottom of the program, but the problem is that it IS there, but console terminates nevertheless. It seems like the programm never starts at all. I am using the 3.5 version of Python.
Open a terminal, navigate to the directory of your file, and type python myfile.py. If you just double click the file in your system explorer it will run and close when it finishes, which is often too fast to see what's going on.
I think you are starting the programme by clicking on it don't do that to run your programme follow following steps
1.open command prompt
2. go to the path where you have your python programme
3. use command for python for eg: python programme.py in linux
4. if it says python command not recognised probably because the path to python executable is not present in system path add it to environment variable and that should work fine
I've recently started to use Python, and I don't know much about programming.
I've installed Python 3.4.3 in my Mac OS X Yosemite, and it worked fine for a few months, but now every time I want to run a module it stops responding.
so I use IDLE and when I open a new file to define a function I can write, then I click run and I save my file, and then when I click save IDLE doesn't restart as it use to and I can't write on it or do anything else. there is no crash report, no nothing, just all frozen. I close it and if then I re open and write on IDLE it works but as soon as I try to run a new file again it freezes.
How can I solve it?
to try stuff out i've been using repl.it online and it is useful for a learner like me but still I would like to be able to use IDLE on my mac.
THANK YOU FOR YOUR HELP!!!!
Try using Anaconda, which is another Python distribution, but more science-oriented. It has all the commonly required modules already in it (plus other for scientific purposes), so that you don't have to install them as and when required. And when you install Anaconda, it automatically installs Spyder, which is a much better IDE than IDLE.