I would like to build a cross-platform GUI application in Python that displays PostScript files I generate, among some other stuff. What is the best way to accomplish this? Ideally I would be able to do things like zoom and pan the displayed graphic.
Do any/some/all of the GUI toolkits have something I can drop in to do this, and if so what are they called and how do they work? If necessary, I can convert the postscript file to PDF or a raster format behind the scenes, but I'd rather not do the latter.
I asked pretty much the same question a little time ago. Here it is. Hope it helps.
Note: Poppler is highly undocumented. If you use Gtk for your GUI there are a few working examples. In Qt things are a little harder, and I haven't figured out a way myself yet.
In a word Ghostscript. It's been a while since I used it, but it's cross-platform and you can use it to generate image files which your app could then display, pan, and zoom. I used it to develop and test some pretty involved commercial Postscript code for my own products and under contract for others. It's open source, which came in handy for a couple of use cases I had. Nowdays I believe it does PDF, too.
Related
I want to create text editor that have coloring feature, Bold,Italic, ... and too many basically Office Program feature for users of my program. but creating this will take too much of my time. so is there a module, package or code for this ?
Thanks.
Gtk3 already has Gtk.TextView and Gtk.TextBuffer which has the requirements you mention (though might be missing some of the more sophisticated ones of a real Office suite). It can also insert images, and do many other tricks. Of course, you have to provide the commands to do steer the widget into executing each of them.
Another possibility is using a web-based editor, and include webkit in your project.
I found a user friendly way plotiing meteorological maps with python. I found this flight path tool, http://www.aviationweather.gov/flightpath2?gis=off , and i want to make something like this in python. I have made the scripts retrieving the data and plotting the maps but i want to make the interface. Is it difficult? Do you have any ideas?
Are you wanting to make a web-based interface? If so, I suggest maybe Django. If you want just a script with some nice GUI on a local machine, I think Qt is easy to use. I can't run the java file from aviationweather.gov (or rather, do not wish to) so I don't know what the interface is like. But using either Django or Qt, I think those are the tools I would start with.
Check out the video here.
https://blogs.msdn.microsoft.com/visualstudio/2016/03/22/introducing-r-tools-for-visual-studio-3/
Start watching about 7 minutes into the video. I think that will be a great learning experience for you, and should get you going in the right direction.
So, I have looked around Google, and here, I do get some interesting results, like using Tkinter and some example from YouTube videos, but I don't think I am asking the right question.
Basically, I want to create a GUI, in Python, and I want to be able to use the standard Windows drop-down menu. By this I mean; File, Edit, Help, Etc. Is there some sort of template to create this or do I need to create my own, using button configurations?
I am assuming I am missing a large portion of information, specifically relating to Windows manipulation, in my studies so far.
You are looking for a GUI framework, there are several to choose from but personally I would say the main ones are:
Tkinter comes with python so nothing to download, looks "unixy"
QT & pyQT very powerful, cross platform, big downloads, always looks QT
wxPython Uses wrappers around native controls so small, fast, cross platform, looks native. Especially download & install the documents & examples package - gives you lots of code examples in the searchable demo that you can edit and run within the demo.
I really should mention that my personal favorite is wxPython, as I have used it a lot over the years.
So, Google App Engine doesn't look like it's going to include the Python Imaging Library anytime soon. There is an images api, but it's paltry, and inadequate for what I need.
I'm wondering what Python only (no C-extensions) there are that can replace the Image.paste and the ImageDraw modules. I don't want to write them myself, but that is an option. I'm also open to other solutions, such as "do the processing somewhere else, then call via api", if they're not too ugly. (For the record, the solution I just suggested seems pretty ugly to me.)
How have others gotten around this?
(I'm not wedded to GAE, just exploring, and this looks like a deal breaker for my app.)
Notes:
For me, crop, resize is not enough. In particular I need
paste (replace part of an image with another.... can be faked with "compose")
draw (for drawing gridlines, etc. Can be faked as well)
text (write text on an image, much harder to fake, unless someone wants to correct me)
My skimpygimpy.sourceforge.net will do drawing and text, but it won't edit existing images (but it could be modified for that, of course, if you want to dive in). It is pure python. see it working on google apps, for example at
http://piopio.appspot.com/W1200_1400.stdMiddleware#Header51,
That's an experimental site that I'll be messing with. The link may not work forever.
Your assumption is wrong. If you use the Python 2.7 runtime, you can use PIL (version 1.1.7) as documented here: https://developers.google.com/appengine/docs/python/tools/libraries27.
This article also explains how to enable PIL for your app.
BTW, the last comment in the bug you referenced also mentions it.
I don't know if it has all features you want, but I have been messing with PNGCanvas, and it does some things I have done before with PIL
Now according to this ticket "On the Python 2.7 runtime, you can import PIL and use it directly. It's the real PIL, not a wrapper around the images API."
I'm writing a XM desktop application (I plan on releasing the source on github when I'm finished if anyone is interested) Anyway, the one part I know very little about is how to play media within Python (I'm using PyQt for the frontend). Basically, I have a mms:// url that I need to play. I was wondering if there is a library that could accomplish this or something, really I just need someone to point me in the right direction.
I know its possible, because SMplayer (Python implementation of MPlayer that uses Qt) works with MMS, I may have to take a peak at they're source if worse comes to worse.
You can have a look at
PyMedia
PyGame
wxPython
Here is a code snippet of doing a similar thing with wxPython.
All of these can play media files.