python-idle

Macports IDLE unresponsive

纵然是瞬间 提交于 2019-12-12 02:56:30
问题 I have just installed Macports for a short course I am planning to do. IDLE does not open whether I launch it from Terminal or Finder. Just for clarification, I am issuing idle2.7 to launch it from terminal. I have tried this solution but nothing happened. *Python & IDLE 2.7.11 来源: https://stackoverflow.com/questions/35249159/macports-idle-unresponsive

Control - Z In Python Code

陌路散爱 提交于 2019-12-12 02:55:40
问题 In IDLE, there's no clear screen, and after reading the forums the best method is plainly to print a ton of "\n"s. However, after playing with IDLE, I made a discovery. When my game was waiting for an input after printing out instructions using print statements, instead of inputting any useful character, I entered 'control-z,' and IDLE began to remove the text that was display by the print statements, one by one. My main question is, how do I manually in the code itself enter 'control-z', so

port binding error, on Python opening

二次信任 提交于 2019-12-11 20:40:06
问题 When I open Python's IDLE, sometimes and error name 'port binding error' is accrues, and IDLE is filed to run on the computer. one this error accrues, it will repeat every time I'll open IDLE, till the computer will be restarted. the error box saies: ' ILDE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server. This might be because no networking is installed on this computer. Run IDLE with the -n command line switch to start without a subprocess and

Indention issue in Python IDLE

不想你离开。 提交于 2019-12-11 18:13:01
问题 IDLE config is set as indentation width - 4 spaces key set - IDLE classic windows at startup - Open shell window paragraph reformat width (in characters) - 70 I open up python IDLE and I am in the shell window. I click file > new file. I am now in the text editor. I write a line of code. It doesnt matter what the syntax is. When i push the "enter" button on my keyboard. Instead of dropping down to the next line and being in the proper spot. The little thing that blinks to show you where your

Python shell getting restarted

前提是你 提交于 2019-12-11 14:09:51
问题 Shell restarts without printing the output. import tensorflow as tf from tensorflow.python.client import timeline a = tf.random_normal([2000, 5000]) b = tf.random_normal([5000, 1000]) res = tf.matmul(a, b) print ('aaaaaaaaaaaaaaa') with tf.Session() as sess: # add additional options to trace the session execution options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) run_metadata = tf.RunMetadata() sess.run(res, options=options, run_metadata=run_metadata) print ('bbbbbbbbb') # Create

Check if USB device is idling, LINUX

别说谁变了你拦得住时间么 提交于 2019-12-11 13:23:44
问题 I've got a quick question, but I can't find an answer. Is it possible in linux (or in python) to see if an external usb pen drive is idling? I need to know this for a python script I'm writing. I need to rename a folder on an external usb pen drive as soon as nothing is writing to it. edit: I know there is lsof command to list open files. 'lsof /theDir' only works half. It works OK when the process copying to the USB is still running. But when the process stops, lsof shows nothing. But the OS

Why does Python's IDLE crash when I type a parenthesis on Mac?

坚强是说给别人听的谎言 提交于 2019-12-11 12:21:25
问题 Ok, I realize this may be an extremely nuanced question, but it has been bugging me for a while. I like the simple scripting interface of IDLE, but it keeps crashing on me when: (1) I am coding on an external monitor and (2) I type the parenthesis button, "(". IDLE never crashes for me for any other reason than this very specific situation. Strangely, if I have an external monitor connected, but I have the IDLE dev window on my laptop's main screen, I have ZERO problems with crashing. (???) I

Writing to a file prints integers to my IDLE shell

删除回忆录丶 提交于 2019-12-11 11:52:53
问题 Writing to a file prints integers to my IDLE shell. They seem to range from 15-40 and there's one for every line printed to my file. This only occurs if I write the statement directly in IDLE, outside of a function. This causes the integers to print: >> file = open('filename', 'w') >> for element in list: file.write('{}\n'.format(element)) while this doesn't: >> def print_to_file(): file = open('filename', 'w') for element in list: file.write('{}\n'.format(element)) file.close() >> print_to

I can't print from Python IDLE in Windows 10

匆匆过客 提交于 2019-12-11 10:39:41
问题 Since upgrading to Windows 10 I can no longer print from the IDLE Python IDE. The "print to default printer" box comes up as usual, but nothing is sent to the print queue ... I checked in Devices & Printers. Printing from other applications works fine. 回答1: I confirmed on my Win10 machine. However for me, the problem is not with Win 10. It is a stupid bug that I introduced in 2.7.11, 3.4.4, and 3.5.1. I am assuming that you must have upgraded Python also. You can test if you have the same

Tkinter code using font module can't run from command line?

谁说我不能喝 提交于 2019-12-11 10:37:50
问题 I have code using tkinter which I can run from IDLE just fine, but which throws the exception AttributeError: 'module' object has no attribute 'font' when it is run from the command line. Other tkinter programs work fine, but anything using the tkinter package's font.py gives me this error. I've checked my python files and c:/Python34/Lib/tkinter/font.py is there. I am not sure why, from the command line, it thinks font is an attribute and not a module of the tkinter package. Example code: