I'm currently writing a screen capture app for Windows and Linux using PyGTK, and I've hit a slight problem with displaying notifications. On Linux, I've been using the libnotify bindings to provide notifications, which has been working very well; however, this has no equivalent on Windows.
I'd use the Win32 APIs directly to display the notification if I could, but I can't seem to find any way to get the tray icon ID from either GTK or PyGTK.
So should I bite the bullet and write a new Windows-specific staus icon class using the Win32 APIs? Or is there a way to initiate a Win32 notification from (Py)GTK that I've missed?
If anyone has any other ideas for displaying simple notifications on Windows, I'd love to hear those too.
Looking at the GtkStatusIcon source code I don't see the NOTIFYICONDATA exposed anywhere. For X11 there is get_x11_window_id, which has no equivalent and just returns 0 in Windows. Perhaps you could file a bug to request similar functionality.
For now, you'll have to create your own tray icon. A quick search at comp.lang.python gives useful result.
Related
I think I've found the relevant MSDN doc here: http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.aspx But I'm unsure how to (or if it is possible) go about accessing such functionality via pywin32.
You are not going to be able to show a balloon tip through that API unless you are using IronPython.
The pywin32api is just a wrapper for the win32 c/c++ libraries. So the library you would be looking for is the Shell_NotifyIcon function.
You can get at the taskbar using the win32api, but it is nontrivial. Here is an example that someone else has created to minimize a python application to the task bar.
You may also find it much easier to use something like IronPython, WxPython, PyQT, or PyGTK.
I am looking for a way to play video streams with python. I couldn't find anything nice, so I ended up embedding webkit inside a gtk window, and streaming the video in there. it works well, but feels rather hacky to me.
So, my question(s):
Is there any other way to stream video (youtube, justin tv) using python and gtk?
If not, is there a way to make my code run on Windows? Currently it only runs on Linux, I suspect because of a lack of Flash support for GTK on windows. Are there any efforts being made to fix this?
ALright, I've come up with an answer.
Instead of using webkit, which doesn't seem to have flash support on windows, I'm gonna use the chromium embedded framework. It should let me do what I need to do, which is embed flash in a desktop app, whilst also allowing for the option of a html based interface.
It's open source, and supports flash on windows(and linux, I believe).
Take a look at GStreamer (python package)
http://gstreamer.freedesktop.org/
Its an open source multimedia framework.
There are also articles about RTP streaming using GStreamer in below links
http://gstreamer.freedesktop.org/documentation/rtp.html
http://eetimes.com/design/signal-processing-dsp/4004620/DSP-video-processing-via-open-sourceAPIs
There is also a streaming media server built using GStreamer (with LGPL license).
http://www.flumotion.net/
PS: if you are keen on using Adobe AIR to build a cross platform flash player below mentioned link will be at your rescue.
http://www.artima.com/weblogs/viewpost.jsp?thread=208528
I myself haven't built this app, however had researched it earlier to build one. Hope it would be useful.
I have a horribly complicated (and very poorly designed) autodialer application I need to automate to make it possible for some less technical users to contact customers.
I would like to try using Python to accomplish this, and was wondering what experiences people have had with this. Poking around I've found a few extensions geared towards this type of thing:
Python Win32 GUI Automation (EDIT: PyWinAuto is hosted on GitHub now)
WATSUP
winGuiAuto
I would like to compile the end product into a standalone executable, so I'm looking for an extension that plays nice with pyinstaller, but is flexible enough to tackle this application with lots of tabs, checkboxes, radio buttons and buried options- and also refuses to save it's settings properly on close :( The system is running Windows 7.
Has anyone out there tried this sort of thing and could indicate which one could handle these requirements?
(Compatible with pyinstaller and Windows 7, and can handle drilling down to checkboxes, radio buttons etc.)
PyWinauto should be able to handle it. I used it for automating a OpenGL video game that had buttons and the like that are not Windows widgets so I had to use mouse clicks. However with your app you should be able to drill into the widgets with the functions it provides for using windows widgets. I recommend if possible to have pywinauto actually launch the dialer as it can be harder to find the correct name of the running app if you don't.
If the app does not use windows gui widgets then you will be able to have it click on the apps window to automate things. One thing you will find is the app must be visible and in focus. So if you want your app to be user interactive you will have to place a window in proximity to the dialer that has buttons. You will have to train your people not to click the autodialer window.
I don't know much about python, but project Sikuli sonuds great for what you want to do. It's a python project with image recognition -> http://news.ycombinator.com/item?id=1074469
Is there a way to make my Python console application's window flash in the Windows taskbar, to get a user's attention?
My script will be run exclusively in a relatively homogeneous Windows environment, so I don't care about detecting whether a particular API is present, or whether a solution is cross-platform or not (of course cross-platform is better for future reference... but I don't need it for this application).
This is the simplest solution I could come up with:
import ctypes
ctypes.windll.user32.FlashWindow(ctypes.windll.kernel32.GetConsoleWindow(), True )
Flashing the taskbar in Windows is accomplished using the FlashWindowEx API function (Python API help).
I haven't tried this myself, but it should be possible to call this function from Python using PyWin32 (Python for Windows extensions) that can either by installed manually or by installing ActivePython.
I'm looking for different solutions to playing back SWF files on Windows, OSX and Linux using Python. Ideally I'd like to embed the player inside a wxPython frame/window.
One possibility I'm investigating is the Mozilla XPCOM framework since its used by FireFox to load the Flash plugin within the browser.
Have you considered Adobe AIR?
Bruce Eckel said: Try combining the power of Python with the polish of Adobe Flash to create a desktop application.
Though I don't know how to embed a browser within a wxPython window, the following code might serve in a pinch (and will work cross-platform, assuming you're working in Python 2.5 or above):
import webbrowser
webbrowser.open(your_swf_url)
It might be best to delegate this task to the browser anyway.