DailyFrankPeter
DailyFrankPeter

Reputation: 414

graphically (GUI) test Python scripts like jsfiddle

I'm exploring 2D interpolations for the purpose of writing a script in Python. I've been using the PIL (Pillow) modules to quickly display the results of the algorithms - this is best for cases when interactive input isn't necessary (i.e. testing on a random set of points).

For interactive testing I've found jsfiddle to be the most lightweight solution, but I admit it isn't ideal to rewrite functions in another language merely to be able to move points around, and input specific shapes of quads.

simple example of 4 points, drawn at random simple example, 4 verts drawn at random (JavaScript in JS fiddle; would like to do the same in Python)

What would be a fastest way to play around with a Python script graphically? Is there a Python counterpart of jsfiddle? I googled 'Python fiddle', of course, but it's not what I'm looking for. What I need is a simple canvas implementation and click events support.

Thanks in advance,

Upvotes: 5

Views: 2623

Answers (2)

Messa
Messa

Reputation: 25201

As mentioned in previous answer, there is Jupyter notebook – a software for interactive Python programming including graphical output.

You can run Jupyter locally or on your own server, but there are free cloud versions:

https://colab.research.google.com/

https://notebooks.azure.com/

Upvotes: 0

larslars
larslars

Reputation: 168

Well, there is Python Fiddle, but I think this question is going to be closed by admins as being off-topic on Stack Overflow; see this thread here.

I'd also come to think of Jupyter and Anaconda. The latter includes the former. These will harness matplotlib, amongst others, and Jupyter gives you a Matlab-like interpreter that shows you variable values for each line and you're able to step by step look at those variables and any graphs you are making.

Upvotes: 2

Related Questions