python-idle

Getting email message after IMAP IDLE command exists response

自作多情 提交于 2019-12-08 10:04:59
问题 Is it safe to use the total number of messages in the exists response as a way to then get the uid? 7.3.1. EXISTS Response Contents: none The EXISTS response reports the number of messages in the mailbox. This response occurs as a result of a SELECT or EXAMINE command, and if the size of the mailbox changes (e.g., new messages). The update from the EXISTS response MUST be recorded by the client. Example: S: * 23 EXISTS In app output 2013-02-02 01:24:42-0500 [IMAP4Client (TLSMemoryBIOProtocol)

“No display name” error when launching idle in cygwin

本小妞迷上赌 提交于 2019-12-07 17:27:55
问题 I am getting a "Tlc error: no display name...etc" when I try to open python scripts in idle using Cygwin. I type the following: idle python_script.py Do I need to install another Cygwin package to make this work? Windows 7- recently installed. Thanks!!:) 回答1: The error means that the program cannot find a display to show the window on. To solve that you need to install X Windows system and then set the display environment variable to: export DISPLAY=:0.0 See this answer for more details:

How to find my IDLE's Python, then apply pip upgrade to a package it uses?

谁都会走 提交于 2019-12-07 17:08:59
问题 I have two python 2.7's of interest: version with IDLE that came from https://www.python.org/downloads/ anaconda 2.7 installation I use MacOS. (I understand I'm overdue to switch to Python 3) I'd like to apply pip install --upgrade PackageName to a package that IDLE's Python uses, but when I type that in my terminal it tries to apply it to my anaconda version. Is there a way I can find my IDLE's python, point to it, then apply the pip command to it? Here's what I have: $ which python /Users

How do I use Numpy in Python IDLE?

眉间皱痕 提交于 2019-12-07 14:31:58
问题 Variations of this question have been asked, but the answers always start from scratch (i.e. from installing numpy). I already have numpy installed on my computer from an earlier time when I downloaded Anaconda. If I try to install numpy again using pip install numpy , I get a long error like, the end of which looks like Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\imray~1\\appdata\\local\\temp\\pip_build_Imray\\numpy\\setu p.py';exec(compile(getattr

No output from Process using multiprocessing

我们两清 提交于 2019-12-07 12:49:58
问题 I am a beginner in multiprocessing, can anyone tell me why this does not produce any output? import multiprocessing def worker(num): """thread worker function""" print('Worker:', num) if __name__ == '__main__': jobs = [] for i in range(4): p = multiprocessing.Process(target=worker, args=(i,)) jobs.append(p) p.start() 回答1: You're starting your Process() , but never waiting on it to complete, so your program's execution ends before the background process finishes. Try this, with a call to

Python - subprocesses and the python shell

萝らか妹 提交于 2019-12-07 06:43:16
问题 I am trying to shell out to a non-python subprocess and allow it to inherit the stdin and stdout from python. - i am using subprocess.Popen This would probably work if I am calling from a console, but it definitely doesn't work when I am using the python shell (I am using IDLE by the way) Is there any way to convince python to allow a non python subprocess to print it's stdout to the python shell? 回答1: This works both from a script and from the interactive interpreter, but not from IDLE:

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

只愿长相守 提交于 2019-12-06 13:29:42
问题 I have tried uninstalling it and have searched other answers. None of them have worked; IDLE opens, but I can't run anything I write. 回答1: This question has been asked before. Based on previous answers, I compiled a list of possible causes and solution on CPython tracker issue 25514, post of 2016-01-18. SO question 1 Causes people have found or think they have found. Antivirus/firewall (4 people, linux iptables, Windows firewall, antivisus , so not a myth ;-) Shadow files, as described [in

How do I get rid of the ' the program is still running are you sure you want to kill it' warning on python?

前提是你 提交于 2019-12-06 12:42:04
问题 print ('Password Request Initiative') password = 'abcd' user_input = input('Please Enter Password: ') if user_input != password: print("Haha. Nope") quit() elif user_input == password: print ("User is now logged in...") enter code here that's the code, but when I run it and type the wrong password it shows this warning:And I want it to run without this message so it just instantly closes 回答1: To avoid the message when running from IDLE, do not use quit() or exit() in a program. They are not

Using “Edit with IDLE” with a Python 2.6.5 script

情到浓时终转凉″ 提交于 2019-12-06 11:29:40
问题 I have installed both Python 2.7.1 and 2.6.5 versions on Windows. I have added only the path of Python 2.6.5 in the Environment Variables. Now, I want to run a Python script x.py using Python 2.6.5. I know how to do it using the cmd but It would be more convenient to just open it with IDLE and run inside it using the Run Module option. This is supposedly done by right-clicking over the script, and then going to Edit with IDLE option, but this opens and runs the script using Python 2.7.1. Is

How does Python IDE IDLE shows autocompletion list on top of text widget at cursor position?

偶尔善良 提交于 2019-12-06 10:15:45
问题 Is it using listbox? context-menu? inserting widgets within text? something else? Also, is there some documentation about how IDLE functions? Which python files do what, etc? 回答1: The autocompletewindow is a tk Toplevel with a Listbox and Scrollbar . Code is in idlelib/AutoCompleteWindow.py (and associated code in AutoComplete.py). The Idle doc gives a user view of Idle. There is no doc giving a programmer view of idlelib. (I wish there had been one when I started with Idle. Now that I