interactive

list of methods for python shell?

狂风中的少年 提交于 2019-12-21 03:43:09
问题 You'd have already found out by my usage of terminology that I'm a python n00b. straight forward question: How can i see a list of methods for a particular object in an interactive python shell like i can in ruby (you can do that in ruby irb with a '.methods' after the object)? 回答1: Existing answers do a good job of showing you how to get the ATTRIBUTES of an object, but do not precisely answer the question you posed -- how to get the METHODS of an object. Python objects have a unified

list of methods for python shell?

邮差的信 提交于 2019-12-21 03:43:07
问题 You'd have already found out by my usage of terminology that I'm a python n00b. straight forward question: How can i see a list of methods for a particular object in an interactive python shell like i can in ruby (you can do that in ruby irb with a '.methods' after the object)? 回答1: Existing answers do a good job of showing you how to get the ATTRIBUTES of an object, but do not precisely answer the question you posed -- how to get the METHODS of an object. Python objects have a unified

Is there a good interactive 3D graph library out there?

你。 提交于 2019-12-20 09:04:12
问题 I'm looking for a library that will layout and display graphs (i.e. network diagrams, not charts) in 3D, with some interactivity like selecting and dragging nodes, rotating the display etc. I would like to do this in a web page so Javascript or Flash are preferable, I'd also consider Java. Having looked myself I realise the options are very limited so I'm interested to hear of any such libraries regardless of language or interactivity, even if they don't run in a browser. 3D is essential

Enter Interactive Mode In Python

独自空忆成欢 提交于 2019-12-20 08:34:24
问题 I'm running my Python program and have a point where it would be useful to jump in and see what's going on, and then step out again. Sort of like a temporary console mode. In Matlab, I'd use the keyboard command to do this, but I'm not sure what the command is in python. Is there a way to do this? For instance: for thing in set_of_things: enter_interactive_mode_here() do_stuff_to(thing) When enter_interactive_mode() calls, I'd like to go there, look around, and then leave and have the program

R equivalent to `python -i`

痴心易碎 提交于 2019-12-20 02:41:38
问题 Typing python -i file.py at the command line runs file.py and then drops into the python terminal preserving the run environment. https://docs.python.org/3/using/cmdline.html Is there an equivalent in R? 回答1: I may be misinterpreting what python -i file.py does, but try: From inside R, at the terminal, you can do: source('file.R') and it will run file.R , with the global environment reflecting what was done in file.R If you're trying to run from the command line, review this post 来源: https:/

How to edit table data with interactive event in matplotlib

天大地大妈咪最大 提交于 2019-12-20 02:37:37
问题 A table is created in a figure. Now I want to edit the table after double click at the cell, adding, deleting or revising the data in this cell. Just like the edit function in Excel. My python version is 3.64. Codes are following: import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots() # Hide axes ax.xaxis.set_visible(False) ax.yaxis.set_visible(False) # Table from Ed Smith answer clust_data = [[1,1,7]] collabel=("col 1", "col 2", "col 3") ax.table(cellText=clust_data

input vs. raw_input: Python Interactive Shell Application?

 ̄綄美尐妖づ 提交于 2019-12-20 02:05:40
问题 I was working off of the answer in this question: Python Interactive Shell Type Application My code looks like this def main(): while True: s = input('> ') if s == 'hello': print('hi') if s == 'exit': break if __name__ == "__main__": main() If I run it, and type hello, I get File "<string>", line 1, in <module> NameError: name 'hello' is not defined How should I be listening for text, and calling different functions based on the result? 回答1: You're running it under Python 2.x, where input()

input vs. raw_input: Python Interactive Shell Application?

拈花ヽ惹草 提交于 2019-12-20 02:05:16
问题 I was working off of the answer in this question: Python Interactive Shell Type Application My code looks like this def main(): while True: s = input('> ') if s == 'hello': print('hi') if s == 'exit': break if __name__ == "__main__": main() If I run it, and type hello, I get File "<string>", line 1, in <module> NameError: name 'hello' is not defined How should I be listening for text, and calling different functions based on the result? 回答1: You're running it under Python 2.x, where input()

How can I use –X:Frames in Ironpython?

我们两清 提交于 2019-12-18 17:29:08
问题 Visual Studio 2010 + Ironpython for .net4 I want to use numpy in ironpython, and they said I must use frames support. So, I should running ipy with -X:Frames or -X:FullFrames on the command line. But, I have two questions: 1.how can i use -X:Frames or -X:FullFrames in Ironpython Interactive console? 2.If I use C# 4 to load py which contained numpy, how can I use extern parameter like -X:Frames or -X:FullFrames? Thanks a lot. 回答1: IronPython Tools for Visual Studio has been deprecated by

Is there a possibility to execute a Python script while being in interactive mode

二次信任 提交于 2019-12-18 10:20:37
问题 Normally you can execute a Python script for example: python myscript.py , but if you are in the interactive mode, how is it possible to execute a Python script on the filesystem? >>> exec(File) ??? It should be possible to execute the script more than one time. 回答1: Use execfile('script.py') but it only work on python 2.x, if you are using 3.0 try this 回答2: import file without the .py extension will do it, however __name__ will not be "__main__" so if the script does any checks to see if it