python-idle

How to restore IDLE to factory settings

末鹿安然 提交于 2020-01-20 08:42:25
问题 I was messing with the Preferences in Python IDLE and I couldn't edit the size of the window. So I right clicked on the windows size where it says "Width and Height" and got a ridiculous size for width! Now IDLE wont even turn on. I tried uninstalling it and installing it again but it doesn't work. I have a Mac. How do I reset IDLE? 回答1: Assuming you mean Idle (which comes with Python), close Idle, then in Terminal, type: mv ~/.idlerc ~/.idlerc-save 回答2: I know you're using Mac, but here's

How to fix Python restarting whenever I start program on IDLE environment?

你说的曾经没有我的故事 提交于 2020-01-17 21:12:13
问题 import random winning_conditon = 0 no_of_guesses = 0 comp_guess = random.randint(1,100) while (no_of_guesses == 11) or (winning_conditon == 1): user_guess = int(input("What is your guess? ")) if user_guess < 1 or user_guess > 100: print("Your number is invalid!") elif comp_guess == user_guess: print("Well Done!") winning_condition = 1 elif comp_guess < user_guess: print("Your number is too high!") elif comp_guess > user_guess: print("Your number is too low!") no_of_guesses = no_of_guesses + 1

What Terminal does Python IDLE use on Windows

强颜欢笑 提交于 2020-01-15 11:30:11
问题 I was helping a fellow Stack Overflow-er today and I noticed that I don't know what terminal IDLE uses in Windows. I am tacitly assuming that Python didn't write their own terminal for Windows, and that they probably use an API that gives them some version of cmd or powershell . I verified that the interpreter runs on cmd , but I don't know about IDLE . What terminal does IDLE use in Windows? 回答1: IDLE is not built on an external shell or terminal, but on the Tkinter GUI toolkit. The source

Running Python file by double-click

旧时模样 提交于 2020-01-13 08:17:12
问题 I have really annoying problem, I cannot run a Python file just by double-clicking. I have tried to set it to open the file with idle.bat but that only starts IDLE editor on double-click, it does not run the Python file. 回答1: What version of Python do you have installed? You should write your own batch file to execute your python binary and your script. For example, with a default Python 2.7 installation on Windows, this could be the entire contents of your script. myscript.bat : ECHO ON REM

Running Python file by double-click

雨燕双飞 提交于 2020-01-13 08:16:17
问题 I have really annoying problem, I cannot run a Python file just by double-clicking. I have tried to set it to open the file with idle.bat but that only starts IDLE editor on double-click, it does not run the Python file. 回答1: What version of Python do you have installed? You should write your own batch file to execute your python binary and your script. For example, with a default Python 2.7 installation on Windows, this could be the entire contents of your script. myscript.bat : ECHO ON REM

How to attach Messages from a Form shown with ShowDialog to Application2?

元气小坏坏 提交于 2020-01-11 03:16:07
问题 I am trying to use the code in this article that lets you know when your app is idle.. This code works great if your application has only one form. You call Application2.Run(myOnlyForm) on it and all messages get routed through the filters in Application2. However if at any point you call mySecondForm.ShowDialog() that dialog does not get its messages filtered through Application2. Is there any way (with out bad side effects) to get the messages on mySecondForm to go through the `Application2

Why do I get a recursion error with BeautifulSoup and IDLE?

那年仲夏 提交于 2020-01-08 18:04:47
问题 I am following a tutorial to try to learn how to use BeautifulSoup. I am trying to remove names from the urls on a html page I downloaded. I have it working great to this point. from bs4 import BeautifulSoup soup = BeautifulSoup(open("43rd-congress.html")) final_link = soup.p.a final_link.decompose() links = soup.find_all('a') for link in links: print link but when I enter this next part from bs4 import BeautifulSoup soup = BeautifulSoup(open("43rd-congress.html")) final_link = soup.p.a final

Why do I get a recursion error with BeautifulSoup and IDLE?

限于喜欢 提交于 2020-01-08 18:02:58
问题 I am following a tutorial to try to learn how to use BeautifulSoup. I am trying to remove names from the urls on a html page I downloaded. I have it working great to this point. from bs4 import BeautifulSoup soup = BeautifulSoup(open("43rd-congress.html")) final_link = soup.p.a final_link.decompose() links = soup.find_all('a') for link in links: print link but when I enter this next part from bs4 import BeautifulSoup soup = BeautifulSoup(open("43rd-congress.html")) final_link = soup.p.a final

Trouble importing module in Python 2.7

和自甴很熟 提交于 2020-01-06 07:20:50
问题 My Mac computer has Python 3.6 and Python 2.7 and I have successfully installed the basic modules such as numpy, scipy and matplotlib, for example, by doing the routine pip install and pip3 install. My Python 3.6 works totally well in Anaconda-Jupiter-Notebook, IDLE and Terminal, while Python 2.7 works only in terminal but not in IDLE. Then for version check I tried pip --version Returning: pip 10.0.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip

Changing indentation in Python's IDLE

倖福魔咒の 提交于 2020-01-06 06:56:07
问题 I have written many lines of code already, and have now changed my mind on their indentation. (I want to put all of these lines into a 'while' loop.) For each line, I could press the space button or tab, but this would take a long time. Can I add the appropriate indentation/margin to all these lines at once? 回答1: In Sublime Text, highlight text and press TAB (or SHIFT + TAB to do the opposite i.e. remove one level of indentation). This will do the same as adding a tab at the beginning of