Python freezes when configuring IDLE - python

So, recently I was using the Python theme function for the IDLE program itself. I downloaded three themes and built my own one, which is selected now. The problem is, I forgot to set colours for the blinker and highlighting, which is hugely problematic. When I went to see if I could change back to the default setting, Python IDLE simply froze up when I selected 'Configure IDLE' under options. I can still scroll through the file, attempt to close the window and minimise it etc, but it has just frozen up. I can't close it or continue working with the file. I've removed Python and then reinstalled it but that hasn't worked, should I just manually delete the themes and force IDLE to use the original one, or is there a way to fix this?
I am running Python 2.7 on Windows 8.1.
Thanks

Turns out one way is manually deleting the faulty theme. This allows the Configure IDLE menu to open. Whoops.

Related

how to run Pycharm twice OR many times from terminal Ubuntu? [duplicate]

I have just installed IntelliJ 9.0.2 on a machine running 64-bit Ubuntu 10.04.
How do I get another window to put on my second screen?
I would like to have both an editor and some tool windows on both screens.
All 'windows' inside of IntelliJ other than the code editor tabs have a "Float" option which pops open an independent window which you can drag to anywhere on your screen. This will allow you to manage your IDEA windows however you like.
IntelliJ also allow you to open multiple projects at once. When opening a project with one already opened, you are prompted as to wether you would like it in your current window or a "New Instance". If you choose new instance, it will open up a completely new IntelliJ with the other project in it. This will work for you if you have many projects you work on at once.
IntelliJ 14 and onwards you can select the settings cog and tick floating mode to detach menus, or drag editor tabs off the main window to detach them
If you're running on OSX you'll need to make sure it's not treating the screens as separate spaces, otherwise they'll snap back onto the same window as the main editor when switching between windows.
To do this untick Displays have separate Spaces in the Mission Control System Preferences.
IntelliJ 10 will have draggable & dockable editor tabs. A very nice feature. It's already present in the early access versions.

How to persist Python turtle graphics screen

I am learning Python (v 3.7) on a Mac using PyCharm. As I practice using the turtle library, the program runs without error, outputs the correct graphics, but then the graphics screen disappears immediately after the code completes runnning. Adding time.sleep(5) at the end of my program persists it and also shows that the focus changed from PyCharm to a Python program menu (which I can't find or turn on in the hope of keeping running).
When I use Thonny, the output persists, so I can check my work. How can I make it persist in PyCharm?
A well-structured Python turtle program will end with a call to mainloop() or one of its variants (exitonclick(), done()) This turns control over to the underlying tkinter event handler which will keep your window open, awaiting user events. Without this, the program simply ends and the window closes.
You don't need time.sleep() nor input("Press Enter to continue..."). Some Python programming environments clash with mainloop() but even those tend to disable it behind the scenes so the same code works everywhere.
First, do not use PyCharm to test. If you like it, more power to you, but personally, I have had many issues with output and PyCharm. Learn the command line, since you are using Mac. CodeAcacdemy and LinuxJournery have really good resources on that subject. Second, if you are still having issues, please reinstall trutle, Python 3.7 (there were some issues wiht it displaying on Mac), and macOS itself. Have a great day!
https://linuxjourney.com/
https://www.codecademy.com/learn/learn-the-command-line
Problems getting pygame to show anything but a blank screen on Macos Mojave

IdeaVim with Jupyter Notebook on PyCharm

I am trying out IntelliJ. I have installed the Python plugin, and IdeaVim.
I cannot navigate properly across Jupyter Notebook cells using hj. I mean, on normal mode, I cannot go to the next (or previous) cell, even if there is one, using hj.
Is there a way to do it without the mouse, possibly rebindable? I have read the tutorial and tried to find something in the program, but could not.
Ideavim plugin doesn't seem to support Pycharm's notebook implementation as of right now :(
There's an open issue marked as "bug" on Ideavim's issue tracker that was opened back in 2015 and it seems like it doesn't have any progress made since.
However according to the comment in the issue thread you can:
funny way to get into the command mode is type something so that the suggestion panel appears, now press "esc" you will get into Vim command mode
So this might indicate that this could be solved and updated in the future.
As an alternative you can try out jupyter-vim-binding, however it doesn't work with Pycharm either.

Start Python in Background

So I have uTorrent set up to run a Python script when a torrent's state is changed so it can sort it. It all works fine except it takes focus from whatever I'm doing and it's crazy annoying.
I run it using sorter.py <arguments>. I'm on Windows 10. What can I do, if anything, to get this to run in the background and not take focus from what I'm doing?
I'm also sorry if this has already been answered but I couldn't find anything that worked.
Running with pythonw (or changing extension to .pyw which is the same) may help.
pythonw.exe doesn't create a console window but I dunno about focus. It doesn't create any windows by default, either, so it shouldn't steal it.

Compiler vs. IDLE Environment

I'm using mac osx mavericks (fully updated) and while looking for a pyscripter alternative, I decided to download CodeRunner from the app store.
I've noticed that certain programs I create in one application, don't always run the same in the other environment.
For example, there are times when I create a program using CodeRunner, but when I open the exact same program in the IDLE environment, it spits back an error. Usually complaining about the syntax or logic of the program. And the other way around can sometimes occur as well.
Is this normal behavior? Should I be saving the program in a different format? I assumed that since I'm coding in Python, the code would behave the same regardless of the environment I use.
The different programs probably have different definitions of tabs and whitespace.In IDLE, you can use Format->Tabify/Untabify menu options to change between tabs and spaces. When you click on these menu options, you prompted for the columns per tab, which will default to 4(At least on my machine). Hope this helps!

Categories