python-idle

Difference Between Python's IDLE and its command line

放肆的年华 提交于 2019-11-30 02:32:08
What are the key differences between Python's IDLE and its command line environment? IDLE looks nicer, of course, and has some kind of GUI... Moreover, is IDLE treated the same as the shell? I mean, the shell is the middle layer between the user and Python's interpreter? Thanks They are both the same thing but, IDLE is made to write python code so its better if you can to write on IDLE. You can also try Notepad++ its a pretty good program to write code on. I am not sure what you question is, but here is a Windows-7 oriented answer of similarity and difference. In the start menu for Python x.y,

How to turn on line numbers in IDLE?

☆樱花仙子☆ 提交于 2019-11-29 20:47:02
In the main shell of IDLE, errors always return a line number but the development environment doesn't even have line numbers. Is there anyway to turn on line numbers? Unfortunately there is not an option to display line numbers in IDLE although there is an enhancement request open for this. However, there are a couple of ways to work around this: Under the edit menu there is a go to line option (there is a default shortcut of Alt+G for this). There is a display at the bottom right which tells you your current line number / position on the line: There's a set of useful extensions to IDLE called

SyntaxError: multiple statements found while compiling a single statement python

匆匆过客 提交于 2019-11-29 17:46:20
this is my code, super simple: #borders of the bbox longmax = 15.418483 #longitude top right longmin = 4.953142 #longitude top left latmax = 54.869808 #latitude top latmin = 47.236219 #latitude bottom #longitude longstep = longmax - longmin longstepx = longstep / 1000 #longitudal steps the model shall perfom #latitude latstep = latmax - longmin latstepx = latstep / 1000 #latitudal steps the model shall perform I try to run in it in the Python IDLE (python 3.3) and this errormessage occurs SyntaxError: multiple statements found while compiling a single statement Removing the "#" it works just

TypeError: 'filter' object is not subscriptable

守給你的承諾、 提交于 2019-11-29 16:02:12
问题 I am receiving the error TypeError: 'filter' object is not subscriptable When trying to run the following block of code bonds_unique = {} for bond in bonds_new: if bond[0] < 0: ghost_atom = -(bond[0]) - 1 bond_index = 0 elif bond[1] < 0: ghost_atom = -(bond[1]) - 1 bond_index = 1 else: bonds_unique[repr(bond)] = bond continue if sheet[ghost_atom][1] > r_length or sheet[ghost_atom][1] < 0: ghost_x = sheet[ghost_atom][0] ghost_y = sheet[ghost_atom][1] % r_length image = filter(lambda i: abs(i[0

WCF service in Azure worker role slow on first request after being idle

家住魔仙堡 提交于 2019-11-29 15:43:32
We have an Azure worker role that exposes a RESTful WCF service (using System.ServiceModel.Web) through a ServiceHost. The performance is irreproachable on massive traffic, but it seems like the response time is significantly higher (more than five seconds) on the first request when the role has been idle for some time. Does anyone know what might cause this? David Makogon The default AppPool timeout is 20 minutes. Might you be running into this? If so, you can add something like this to a startup script to change the timeout: %windir%\system32\inetsrv\appcmd set config -section

Script fails with AttributeError when run in CMD, but executes fine in IDLE

眉间皱痕 提交于 2019-11-29 15:02:14
I am quite new and confused. I tried a simple script with tkinter and it worked fine in IDLE but when i try to launch it from CMD - the tkinter window opens and it looks fine , but when you attempt to click any button or file menu options an AttributeError raises: Exception in Tkinter callback Traceback (most recent call last): File "C:\Python33\lib\tkinter\__init__.py", line 1489, in __call__ return self.func(*args) File "060214_Manual_Evaluation_of_Protein-protein_Cross-Links.py", line 13, in Open_csv self.CsvPath = tk.filedialog.askopenfilename() AttributeError: 'module' object has no

Unsupported characters in input In Python IDLE

一个人想着一个人 提交于 2019-11-29 14:51:52
suffixes = { 1: ["ो", "े", "ू", "ु", "ी", "ि", "ा"]} When I done message given by IDLE is Unsupported characters in input Also not see the proper font in MS-DOS. What encoding is your source file in? If it is UTF8, put the comment # -*- coding: utf-8 -*- at the top of the file. If you don't declare encoding in your first or second line in your python source file, then the python interpreter will use ASCII encoding system to decode the characters in the file. As these characters you used couldn't be decoded by ASCII encoding system, errors happended. The solution is as @RemcoGerlich said. Here

Script works in IDLE, but .py-file doesn't work

南笙酒味 提交于 2019-11-29 14:14:55
问题 I have a tkinter script, which runs just fine in IDLE. However, when I double click the .py-file from Windows Explorer, the console window flashes half a second and then it exits. I was able to screenprint the console window. It says: ...etc.etc... NameError: global name 'simpledialog' is not defined simpledialog is a module in tkinter which I use in my script. As I do from tkinter import * , there is no need to explicitly write tkinter.simpledialog . It works in IDLE, why not as .py? 回答1:

IDLE timeout parameter in Oracle

。_饼干妹妹 提交于 2019-11-29 13:57:44
We are stuck in a situation where one of our processes is taking 3 hours of computing without touching the database. The connection that was taken before calling the process gets closed by the Oracle server and any subsequent query or commit throws connection closed exception. It appears to us that the problem is related to Oracle closing the connection that is idle for that long for some reason. We tried changing EXPIRE_TIMEOUT in sqlnet.ora but that didn't help either. What can we do to resolve this problem? What is the error you get when you try to use the connection? Oracle by default will

Close Python IDLE shell without prompt

半城伤御伤魂 提交于 2019-11-29 12:29:33
I am working on a script (script A), that needs to open a new Python IDLE shell, automatically run another script (script B) in it and then close it. The following code is what I use for this purpose: import sys sys.argv=['','-n','-t','My New Shell','-c','execfile("VarLoader.py")'] import idlelib.PyShell idlelib.PyShell.main() However I can't get the new shell close automatically. I have tried adding the following to script B but either it doesn't close the new shell or a windows pops up asking whether I want to kill it. exit() . import sys sys.exit() Instead of monkeypatching or modifying the