Displaying & Modifying Diagrams / Flowgraphs in PyQt GUI - python

Essentially what I would like to do is draw a circuit diagram in a PyQt based on input given from another part of the GUI. My first thought was to simply use graphical tiles, and switch them out as pixmaps based on the input, but that is pretty clunky.
I suppose finding a way to actively display dia diagrams in a frame of the GUI would work as well.
Regardless, how would you recommend going about doing this? Is there as easier way?
Thanks!
Edit: Does anyone have experience with any of the following?
http://code.google.com/p/pydot/
http://code.google.com/p/python-graph/
http://code.google.com/p/yapgvb/
http://live.gnome.org/Dia/Python

To anyone that needs to go down this route in the future, the best option was definitely pydot. Easy to use, and pretty full-featured. Way to go, Graphviz.

Related

What is the easiest way to make StyledTextCtrl look like a TextCtrl?

The only additional features I need from StyledTextCtrl are the following:
Change caret width using SetCaretWidth(pixels)
Change caret colour using self.SetCaretForeground(colour)
Change entire background colour to transparent (or alpha). I don't know how to do this.
Change Font (face and size). I don't know this either.
Other than that I want it to behave exactly like a normal TextCtrl. ie. No scrollbars, no multilines etc. A lot of info here, but it is overwhelmingly big! So how much code will I have to write before I shoot myself in the foot?
There's a sample model here, for quick testing.
You can do (4) with a plain wxTextCtrl without any problems, so if you can live with just this, I'd strongly suggest just using the standard control instead. You can make the window transparent but this is not implemented in all ports (notably not in wxMSW) currently. The other two points are extremely unlikely to be ever possible with the standard control as it's really supposed to use the standard caret.
If you really need (1) and (2) you will have to use the non-native wxStyledTextCtrl but then you really should abandon any idea to make it behave exactly like the native control, it won't work.

What kind of algorithm should I look for in order to recognize the blueprint of a building?

I have a project in which I should analyze the layout of a building in order to navigate inside it, and I was thinking about taking the blueprint of the building (or maybe an edited version of the blueprint, which should be modified in some way I am still thinking of), transforming it in some kind of object and then elaborate it.
Basically, I was thinking about doing something similar to OCR but limited (and I guess using limited sounds pretty silly to most of you, but still bear with me) to recognition of, for example, walls and doors. My idea was transforming the whole image into a matrix of points - I guess, a lower resolution version of the source - and then elaborating over the matrix the route from point A to point B.
This is the idea, but I guess that I'm actually looking at a problem way more complex than it looks to me, moreover I don't really know whether this is the best (read: easiest) way to proceed.
In short, my question is:
Is this framework feasible? Are there any libraries for, say, Python, with similar functions? Is the recognition doable by working in someway with a graphic design software (e.g. Photoshop)?

question about python GUI

So I am taking a digital image processing class that requires implementing some image filters, reconstruction, enhancements. I plan to use python for it but my professor wants to have a simple GUI with two canvas for pre- and post-processing images, a drop down box for filter selection, some textboxes for filter value/thresholds and stuff. I have the following questions to ask:
Is it possible to load image to a canvas in python GUI library?
Does the advantage from coding out-weight the disadvantages of having to code the GUI manually?
Given the requirements, what would be the best and easiest library to use? I choose python since it reduces implementation time, but if the GUI turns out to be a bummer I would rather use Java.
If the answer for the 3 previous questions are YES, please point me in the right direction with some documents.
Thank you!
I recommend writing the processing code separately, then writing a GUI wrapper around it.
There are many choices, however I'd consider the big three below:
Tkinter, in the standard install, simple but a bit clunky.
wxPython, a better choice, higher quality but a bit more complicated. Uses native widgets.
PyQT, many love this toolkit and its documentation. I have only limited expertise with it. Uses custom drawn widgets.
Look at Phatch. It is a Python Photo Batch Processor with a nice graphical user interface. It is based on PIL imaging library which you'll probably want to use.

Renderer for 3D model (points/lines) in Python

I have a 3d model that consists of points, lines and balls in space. For debugging, it would be nice to render these objects in real time and rotateable.
What are my easiest options to achieve this in python?
Since I know nothing about graphical programming, I'd like to write as litte boilerplate code as possible.
The easiest way to get 3d graphics on screen in python is VPython, though if your model is stored in a CAD file format, you'll need some other library to load the data. With just VPython, you will either need to hard-code the model or implement your own loader.
Two options I'd consider myself (depends what you're trying to do in the end):
Blender has fairly amazing Python integration. Simple example here. As I understand it, Blender's own file save format is executable python which prods the Blender Python API to reconstruct the scene. There's also a mechanism for introducing gamey logic into the Blender world but I know even little about it. Blender does have a crazy steep learning curve though.
Get into OpenGL using the Python OpenGL bindings. "Simple" example.
If you're more interested in creating the models, go with the former; if you're more interested in the rendering of them, go with the latter.
The first thing that springs to mind is processing which is an easy to use visualization toolkit. Although you actually implement your visualizations in java, a quick google found this which lets you write your sketches in python instead.

Any graphics library for unix that can draw histograms?

A python program needs to draw histograms. It's ok to use 3rd party library (free). What is the best way to do that?
You can use matplotlib.
Gnuplot.py lets you use Gnuplot from python.
How much power do you need? How much external weight are you willing to take on? ROOT is accessible in python using PyROOT. Heavy and a lot to learn to get the most out of it, but very powerful.

Categories

Resources