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.
Related
I'm currently at a crossroads. I'm somewhat versed in Python (2.7) and would really like to start getting into GUI to give my (although mini) projects some more depth and versibility.
For the most part, my scripts don't use anything graphical so this is the first time I'm dipping my toes in this water.
That said, I've tried using pygame and tkinter but seem to fail at every turn to get something up and running (although I had some slight success with pygame)
Am I correct to understand that for both I need X started in order to generate any type of interface, and with that, so I need X to get any type of input (touchscreen presses)?
Thanks in advance!
In order to use tkinter, you must have a graphics system running. For Windows and OSX that simply means you need to be logged in (ie: can't run as a service). For linux and other unix-like systems that means that you must have X running.
Neither tkinter nor any of the other common GUI toolkits will write directly to the screen.
I'm gonna give an alternative answer. If you know HTML, CSS and Javascript (or have time to give it a try) I would recommend using Flask, http://flask.pocoo.org/.
With flask you can create websites but you can also (as I am using it) let it be your GUI. It will work on any device and looks really good :).
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.
I'm working on making a "bot" for a game I play on my computer (windows8.1) just to see if I can. One of the tasks I need to automate is to find something on the screen. I can't get the sprites for the game though. I tried taking a screenshot and searching the screen for that image but it fails because the exact image is not on the screen. I imagine I would need to check pixels (if that's possible)
I'm not looking for actual code as an answer. I just need somewhere I can learn how to do what I want to do. Any help is appreciated!
When making "bots" like you do, your approach of searching for pixels is usually a bad practice. It's really error-prone and needs a ton of computing power.
Other popular tools (for example the hearthstone deck tracker) are checking the ram for the current state of the game. This is the safest and best approach.
Python is probably not capable doing that.
Java, C++ or C# are the language you want to write a bot in. I'd highly recommend you switch to one of these.
The Hearthstone Deck Tracker is an open source project on github. Check the code if you want to learn something about bots / tools https://github.com/Epix37/Hearthstone-Deck-Tracker.
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.
I have a significant game I really need to port to tablets. (Android has PyGame subset for Android, which I'm still investigating). It would be great to take my Python code and move it to a more cross-platform engine.
I'm looking for engines with a pure code API, something I can wrap my intermediate glue for graphics and audio around. Kivy and some others use too much *ML (or JSON). Hoping I missed something good. The best I've seen is Futile for Unity3D, but Boo !!!!!= Python.
Have a look at http://ignifuga.org, it's Python based and inspired by projects like Cocos2d and AndEngine.
Have a look at Kivy framework. I tried just some very simple demos but I can confirm that you can run it on PC/Mac/iOS.