python-idle

Run pip in IDLE

会有一股神秘感。 提交于 2020-01-05 05:27:06
问题 Sry for this stupid question. I am new for python and I am currently using IDLE for python programming. Is there anyway to hide the output generated by the command? pip.main(['install', 'modulename']) I was trying to install matplotlib by pip in idle, but then both the speed and idle itself got slower and slower and finally the process became endless. So I was thinking about can I enhance the speed a little bit by hiding the output. I tried code like this: import sys import pip import io

Python IDLE file editor thinks I want more auto-indent than I do

假如想象 提交于 2020-01-05 04:29:24
问题 I have a bit over 500 lines of code-plus-comments that I've written over the past few days. It runs (see edit) , and does what it's supposed to. But whenever I hit enter after any text, IDLE fills in whitespace to column 28. If I go from column 28 and type a line that should need more indentation, for example For i in range(25): , and hit enter, it still only indents to column 28. When I edit a new file, it indents the right amount. When I try extending a logical line to multiple physical

Python IDLE search in history (similar to Ctrl+R in bash)

一世执手 提交于 2020-01-04 07:53:09
问题 Is there an equivalent in the IDLE ide for python to Ctrl+R in bash, where you type a part of the line, and it matches it against the history of already entered lines? 回答1: This is not as good as Ctrl+R, but you can type some of the starting text, and then press Alt+P. So if you type for and then press Alt+P, it will find the last line that starts with for , if you press it again, it will find the next-to-last line that starts with for , and so on. This only allows you to search for lines

How to find and replace all tabs with spaces in idle

主宰稳场 提交于 2020-01-04 01:57:35
问题 I have an invisible expected an indented block error, which is likely caused by me using tabs instead of spaces. When I open the "find/replace" window and try to enter TAB in the find field IDLE unsurprisingly just skips to the replace field. How do I do this? Final update: Thank you for all answers, much appreciated. My problem was that python wants the function comments to be indented too, that is def imdheladumb(): """ I'm dum as hel """ does not work, it needs to be def imdheladumb(): """

how to detect idle user in iphone-sdk

坚强是说给别人听的谎言 提交于 2020-01-02 07:16:28
问题 In my Application I want to call Logout Function if user is idle for certain amount of time how to accomplish this answer doesn't work for me iPhone: Detecting user inactivity/idle time since last screen touch if i subclass my app delegate class from UIApplication and implement - (void)sendEvent:(UIEvent *)event It gives me error *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'There can only be one UIApplication instance.' I can't find the other

Python error - IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection

拜拜、爱过 提交于 2020-01-01 04:18:08
问题 I am new to programming and i decided to learn Python first, so; I installed Python, latest version 3.4. and I am trying to open Python IDLE(GUI) mode, so when I open I get message "IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.". My firewall is not problem beacuse I put Python throught it. I also tried to reinstall it and it didnt made diffirence. So please if somenone can help! Thank you on your time :D 回答1: Delete all

setting up numpy/scipy in idle

Deadly 提交于 2019-12-31 04:13:26
问题 I would like to use numpy in a python program I am creating, but I can not figure out how to use it inside of IDLE. The download page for numpy redirects to the one for Scipy, which is fine, infact I would like to download the rest of Scipy as well (especially matPlotLib), but it isn't as important to me as numpy, but the scipy download page tells you to get it from even larger packages, none of which I can figure out how to use in IDLE. Note that I use the python 2.x series, and I also use

Use IDLE to launch script using the full file path

不问归期 提交于 2019-12-30 05:26:08
问题 I'm currently using Notepad++ to edit my python script, and I would like to be able to use a shortcut to make my script run in IDLE. Currently, I have: cd C:\Python32 pythonw.exe Lib\idlelib\idle.pyw -c "$(FULL_CURRENT_PATH)" When I try to run it, I get a Syntax error on the : in C:\Users\... However, if I omit -c , IDLE properly opens up the file in it's editor and then I am able to run it. I feel like I'm missing something simple, can anyone help me out? 回答1: Argument -c used to start the

How to repeat last command in python interpreter shell?

a 夏天 提交于 2019-12-28 03:18:12
问题 How do I repeat the last command? The usual keys: Up, Ctrl+Up, Alt-p don't work. They produce nonsensical characters. (ve)[kakarukeys@localhost ve]$ python Python 2.6.6 (r266:84292, Nov 15 2010, 21:48:32) [GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print "hello world" hello world >>> ^[[A File "<stdin>", line 1 ^ SyntaxError: invalid syntax >>> ^[[1;5A File "<stdin>", line 1 [1;5A ^ SyntaxError: invalid syntax >>

Deleting consonants from a string in Python

元气小坏坏 提交于 2019-12-28 02:15:07
问题 Here is my code. I'm not exactly sure if I need a counter for this to work. The answer should be 'iiii' . def eliminate_consonants(x): vowels= ['a','e','i','o','u'] vowels_found = 0 for char in x: if char == vowels: print(char) eliminate_consonants('mississippi') 回答1: Correcting your code The line if char == vowels: is wrong. It has to be if char in vowels: . This is because you need to check if that particular character is present in the list of vowels. Apart from that you need to print(char