I've installed and re-installed Python 3.6.1. I am not given the options at the top like "file, edit, shell, debug, etc" at the top. I have no idea what to do at this point as I've searched around for a while and haven't come up with a solution. Does anyone have any idea of what I should do about this?
In Windows, at least, the console does not have a menu at the top. When you run interactive python, there is no menu. When you run a program that does not create a menu, there is no menu. When you run an IDE such as IDLE, the IDE puts its menu at the top. The particular menu entries you refer to occur on the IDLE menu. So start IDLE from an icon or from a console. For the latter, <python> -m idlelib should work, where ` refers to a python binary. Some details depend on the OS.
Related
I'm kind of new to software development. Outside of VSCode, I can open up a terminal (let's say PowerShell), run python in it, type in a command (like 2+2), be able to click the up arrow key to find my previous command so that I can run it again.
If I run PowerShell in VSCode and do the same thing, nothing happens when I click the up arrow where I would expect my previous command to be cycled.
Is this a problem with my Python or VSCode? I've been looking for a solution for this but haven't found many useful topics on this.
This was going to just be a comment but its too long. Sorry it isn't more informative than it is. This is kind of an odd problem because VSCode isn't a true IDE. It doesn't have its own shell and just hijacks your powershell or bash terminal, depending on which OS you are using. You should be able to use your up and down arrows just like you can in powershell. I have tested it on my own VSCode installation and it works fine for me. If it's a problem, it's not with python, since VSCode will interact with the terminal the same way no matter which language you are using it for, so its probably with VSCode or your terminal. I have heard of others having issues with up arrow autocomplete in bash, so if you are connecting to a bash terminal that could be it, but I've never heard of it glitching in powershell. I'd say check which terminal you are using, see if the problem persists when you change terminals, and try reinstalling VSCode if it does. Past that, I don't know what to tell you.
I found a work-around. For me, neither git bash, nor PowerShell allowed up/down arrows for history switching within a python shell. So here it goes.
Ctr-Shift-P opens VSCode commands
Python: Create Terminal does not actuallt start python, but it does launch powershell in a mode that will enable us to succeed
py starts python shell with working up/down arrows!
I have no idea if this problem has the solution I want but here goes.
I'm making a PyQt4 program that apparently needs the console window to run properly. However, whenever I activate another window, sending the program I'm working on to the back, the only way I can get back to it is by closing all the windows in front of said window. I can't just click on the taskbar because the only thing that comes back is the console window.
I'm curious. Is there a way to have the GUI window activate along with, or independent of, the console window without having to go through the annoying process of closing (minimizing) potentially all the rest of your windows?
Edit: I just realized my question is pretty vague. Let me elaborate.
I'm compiling said program using pyinstaller.
The reason it needs the console window to work properly (I have tried using the .pyw file as well, to no avail) is because there's another program that's the core of this one that prints out to it in a way I can only describe as violently.
Apparently it won't be happy unless it has the console to record it's outbursts.
That being said, I need the console window. However, as I mentioned before, that is the only thing that comes up when the pyinstaller icon is clicked.
There is a gui attached to the console, but there's no way to get it back even after the user would minimize it because the pyinstaller icon insists it doesn't exist.
Maybe it has something to do with how I defined the window while programming it, but I don't see why that would be the case. Is there something in particular pyinstaller doesn't like that would make it act like this?
How are you launching the PyQt application?
If you're launching it with the python executable, it will create a console.
python my_application.py
Instead, launch it with the GUI version of python -- pythonw:
pythonw my_application.py
If the python path isn't in the system path, you may need to specify the whole path to the executable:
C:\python27\pythonw.exe C:\path\to\my_application.py
I am trying to use vpython, any way I can, but I'm failing...
First, I installed the Anaconda Python 2.7.10 on Win 8.1.
Then, I installed Vpython by typing into the command line:
conda install -c https://conda.binstar.org/mwcraig vpython
Then I tried 3 things:
(1) Double-click the "VIDLE for VPython" shortcut on my desktop. Nothing happens. I look at the target, which points to pythonw.exe.
I double-click directly on pythonw.exe. Nothing happens.
(2) I notice that there is also python.exe in the same folder, so I double-click on it, and get a command prompt. I type "from visual import *" and it seems to execute without error. Then I type "sphere()" and opens up a gray window titled "vpython" but it just hangs without ever showing me a sphere.
(3) Then I launched spyder, and typed "from visual import *", which seemed to execute without error. Then I typed sphere(), and it spits out the text "visual_common.primitives.sphere at 0x152ccb38" and another gray window pops up with the title "vpython" but it also hangs indefinitely.
How can I debug this situation? Thanks so much! I'd really like to show a simple vpython script in my physics lecture tomorrow...
I know its late, but it might prove useful to others:
To run vpython 7 from an IDE you need to have Python 3.5.3+ installed. Note that for use in Spyder you have to go to Run > Configure and specify "Execute in a new dedicated Python console" ( Vpython doesn't work in spyder 3.2.0).
This information can also be found at http://vpython.org/.
For questions regarding vpython I recommend you ask in the Vpython users google group.
I am sure I am using incorrect terminology, but hopefully you can grasp my meaning. I am working with Spyder python 2.7, and I have somehow lost my "output" window. I attached a screen shot. Formerly, there was a window, that, after having run my code, gave me the results of my code. How do I get this window back? I went to the view options, but had no such luck.
(Spyder dev here) You have two options to make your console back (that's the right name of what you called as output window :)
Go to the View Menu and there from to Windows and toolbars and select either Console or IPython console.
If this doesn't solve your problem, just open a Windows terminal (i.e. cmd.exe from the Start > Run Window menu) and in it run this comnmand:
spyder --reset
and then restart Spyder again. That should solve your problem for sure.
I am running python 2.7.1. I can't figure out how to launch the IDLE IDE. I am told it comes already installed with python, but I can't find it using spotlight.
In the stock Mac OS X python installation, idle is found in /usr/bin, which is not (easily) accessible from Finder and not indexed by Spotlight. The quickest option is to open the Terminal utility and type 'idle' at the prompt. For a more Mac-like way of opening it, you'll have to create a small app or shortcut to launch /usr/bin/idle for you (an exercise left to the reader).
When you open up a new terminal window, just type in
idle
Then you will see a little rocket icon show up as IDLE loads
Then the Python shell opens up for you to edit
I think the shell command is
python -m idlelib.idle
but i am not a mac user so i can't test.
One way to run IDLE from spotlight or an icon in the Applications folder is to build a quick Automation for it. As mentioned by other commentators, this probably isn't necessary for Python 3, as it creates a shortcut automatically, and some hand-installed versions have tools to do this automatically. But if you want to roll your own:
You'll need to know the terminal command to open your version of IDLE. On my Mac right now (early 2016), running python 2.7.10, it is "idle2.7"
Using spotlight, or in the Utilities folder, open "Automator"
Choose an "Application" type document.
Make sure "Actions" is selected in the gray bar, upper left.
In the actions column, find "Run Shell Script" and double-click it, or drag it to the workflow area on the right.
Enter the terminal command in the parameters box that appears.
Save your automation (I called mine "IDLE" and put it in the Applications folder, to make it easy).
It's now available (as soon as spotlight indexes it) via all the normal methods. The only side-effect will be that while it's running, your menu bar will have a spinning gear over in the tray area next to the clock. This indicates an automation workflow is running. Once you close IDLE, it will go away.
first to launch the terminal CMD+space
second to input idle3
the idle will be activated automatically.
After you launch idle from the command line (make sure idle shell window has focus), click File, click "New File". A new window opens; this is your editor.
Type your program in the editor. Click "File", click "Save As...". Save your file somewhere with any name you choose, and a ".py" extension to the file name.
Click "Run", click "Run Module" (or, F5). Assuming no errors, the results will appear in the Shell window. Edit your file & repeat as necessary.
The answer of Matthewm1970 works like a charm!
And if you add an & to your shell command, the automation script will end immediately. There is no spinning gear. Like so:
/usr/local/bin/idle3.5&
Note the ampersand.
Cheers.
-melle
open Terminal
type "idle" and press enter
right click on "Python" icon > Options > Keep in Dock
so for python 3.4.3 in applications a folder named "python 3.4" click that and click IDLE.
for python 2.7.9 go here https://www.python.org/downloads/ and get 2.7.9 and a folder named "python 2.7" click that and click IDLE.
As to the earlier questions about starting IDLE: you can certainly start it from the command line. Also, if you installed Python using Homebrew, you can run 'brew linkapps' (from the command line); that will place an app for IDLE (among other things) in Launchpad (Applications folder).