interactive

Is there a way to make python become interactive in the middle of a script?

痞子三分冷 提交于 2019-12-03 05:06:37
问题 I'd like to do something like: do lots of stuff to prepare a good environement become_interactive #wait for Ctrl-D automatically clean up Is it possible with python?If not, do you see another way of doing the same thing? 回答1: With IPython v1.0, you can simply use from IPython import embed embed() with more options shown in the docs. 回答2: Use the -i flag when you start Python and set an atexit handler to run when cleaning up. File script.py: import atexit def cleanup(): print "Goodbye" atexit

Matplotlib interactive graph embedded in PyQt

心不动则不痛 提交于 2019-12-03 03:22:42
I've created a simple python script that when run should display an embedded matplotlib graph inside a PyQT window. I've used this tutorial for embedding and running the graph. Aside from some differences in the naming conventions and in the overall UI my graph is generated exactly as the one in the tutorial mentioned. My problem is that I would like to make this an interactive graph that allows for zooming and dragging, but I would like to do this with only the mouse (clicking and dragging, scroll wheel, etc) and without the toolbar (as I find it ugly). Widget Class: class MplCanvas

Interactive Floor Plans in HTML5

不问归期 提交于 2019-12-03 02:46:36
问题 I have to develop interactive floor plan navigator and viewer for apartment buildings, which will succeed its Flash-based predecessor. I am now in the process of evaluating techniques and technologies best suited to implement this in HTML5. I will have to support all common browsers (IE starting with 7). Requirements: The user is presented with several static outdoor views of the building, between which he can switch with a simple widget. They will be able to select a floor on this outside

start interactive mode on a specific script line

。_饼干妹妹 提交于 2019-12-03 02:30:34
I need to run my Python script as usual, but I want to stop execution on a specific line and start interactive mode. In other words, I want to be able to check the value of all my variables at that point, and continue myself from there on python's command line. How can I do this? This can be done with the code module. The easiest way is to call code.interact() . Use a debugger and add breakpoints. Do you use an IDE? All the major IDEs have debugger support. From the CLI, you can use pdb . Not exactly what you're looking for, but you can easily have your program break out to pdb (the Python

Is there an interactive graphing library for python

帅比萌擦擦* 提交于 2019-12-03 01:41:32
问题 I'm looking for an interactive graphing library for Python. By "graph", I meant a set of nodes connected by a set of vertices (not a plot of values over x-y axis, nor a grid of pixels). By "interactive", I meant I can drag-and-drop the nodes around and I need to be able to click on the nodes/vertices and have the library pass the nodes/vertices to my callbacks, which may add/remove nodes/vertices or display information (I cannot load the full graph at startup as the dataset is too large

interactive lua: command line arguments

人盡茶涼 提交于 2019-12-02 21:55:44
I wish to do lua prog.lua arg1 arg2 from the command line Inside prog.lua, I want to say, for instance print (arg1, arg2, '\n') Lua doesn't seem to have argv[1] etc and the methods I've seen for dealing with command line arguments seem to be immature and / or cumbersome. Am I missing something? You're missing the arg vector, which has the elements you want in arg[1] , arg[2] , and so on: % lua -i -- /dev/null one two three Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio > print(arg[2]) two > More info in the Lua manual section on Lua standalone (thanks Miles!). daurnimator In addition to

Interactive plotting with R raster: values on mouseover

喜夏-厌秋 提交于 2019-12-02 20:39:20
I'd like to do a small program in R for interactive visualization and modification of some raster datasets, seen as colored images. The user should open a file (from the terminal it's OK), plot it, select the points to edit with mouse clicks, and insert the new values. So far I achieved that easily. I use the plot() function from the raster package to visualize the plot, then click() to select the points and edit their value via the terminal. I'd like to add the ability to show the values on mouse over. I've searched for ways on how to do this, but this doesn't seem to be possible with the

Interactive Delegate Methods Never Called

隐身守侯 提交于 2019-12-02 19:41:25
I want to make an interactive transition between a ViewController (1) and a NavigationViewController (2). The NavigationController is called by a button, so there's no interactive transition when presenting. It can be dismissed by a button or a UIPanGestureRecognizer, so it can be dismissed interactively or not. I have an object named TransitionManager for the transition, subclass of UIPercentDrivenInteractiveTransition. The problem with the code below is that the two delegate methods interactionControllerFor... are never called. Moreover, when I press the buttons or swip

Is there a way to make python become interactive in the middle of a script?

柔情痞子 提交于 2019-12-02 18:20:47
I'd like to do something like: do lots of stuff to prepare a good environement become_interactive #wait for Ctrl-D automatically clean up Is it possible with python?If not, do you see another way of doing the same thing? With IPython v1.0, you can simply use from IPython import embed embed() with more options shown in the docs . Use the -i flag when you start Python and set an atexit handler to run when cleaning up. File script.py: import atexit def cleanup(): print "Goodbye" atexit.register(cleanup) print "Hello" and then you just start Python with the -i flag: C:\temp>\python26\python -i

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

被刻印的时光 ゝ 提交于 2019-12-02 17:42:43
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 though, there are other questions on this site convering 2D libraries. Update: please, stop adding details