I'm about to finish a program which uses Pygame, which means you would need to install Python and Pygame in order to run the game. How can I include Python and Pygame in the program itself, or is there an easy way to make an installer for the game?
py2exe seems to be a popular answer, and I would suggest looking into it as well. I would also suggest trying pyinstaller. The setup is a bit more involved, but the tutorials are great.
Like PygameNerd said, I would suggest looking into py2exe. I wrote a game for a game jam and wanted to distribute it to people in my dorm. I used py2exe to load it up and distribute it pretty effortlessly (especially using Pygame).
Check out the py2exe website as well as this link on working with various modules in your package. I had dependencies with wxPython and used the latter guide to much success.
Related
I've installed Caffe on my Windows computer but from what I can tell online most projects that use Caffe to do object detection are using some other forks of Caffe like NvCaffe or the SSD fork. None of these forks are available for Windows.
Does this mean it's not possible to do object detection on the Windows fork or is it just that people prefer not to. Sorry if this is a dumb question but I find the Caffe documentation somewhat lacking when it comes to explaining what features require what fork. I'm using the python interface if that makes any difference.
Thanks for any clarifications!
It is possible to run Caffe-SSD on Windows, but some effort is needed. You need to merge the changes from the Windows branch into the Caffe-SSD. There are some existing solutions for that (https://github.com/runhang/caffe-ssd-windows, https://github.com/gustavkkk/caffe-ssd-win, google for more), but I did not use those, unfortunately. Colleague of mine did it by himself, so it is definitely possible. As soon as you get it compiled and running, you will have a Python interface as well.
I made a really simple, pseudo GUI using pythondialogue (its a wrapper for whiptail for bash), I need it to be cross platform between linux and Mac OSX. The main issue is its really hard to find information on pythondialogue, the only documentation seems to be on their own site. I would just use whiptail, but I'm learning python so using this to hone my python skills.
What I like about pythondialogue (and whiptail) is that its not really a GUI, just a dialogue inside the CLI, so it can used purely through the command line such as if you SSH to the computer you want to run it on. Can tkinter do this too?
Either way, a big thing I'm wondering is what benefits tkinter would provide over regular pythondialogue. Obviously the difference is it lets you create proper GUI applications, but would it be wisest to only create a GUI application in cases where its absolutely necessary?
tkinter sounds like the easiest way to code GUIs in python. What disadvantages does it have to PyQt or wxPython. I wan't to start developing mobile apps as soon as possible and I see iOS and android apps can be written using python and Qt can be used to write both Android and iOS apps. So with this in mind, would learning PyQt mean I would also be developing the skills I'll need to create iOS and android apps? If so, this is most definitely what I'm going to do.
Learning PyQt will definitely help you learn to create IOS and Android apps. Even more, PyQt comes with QtDesinger which is a visual editor for creating apps with minimal coding. Tkinter in my perspective is for very light GUI programming. If you feel like you want to make money of these apps, I would highly advise you to check out Kivy.
I am putting together a few programs, and it's about time to start making GUI's for some of them. The code is currently written in Python 3.3.
I have researched a few GUI's for Python, namely Tkinter, wxPython and PyGTK. Everything I am finding seems to only create GUI's that look fairly archaic. I have created a couple of example GUI's, and they all work, they just look very Windows 95.
An example of what I am finding/creating:
An example of what I want-ish:
Is it simply an advanced knowledge of how the GUI's work, or are there just GUI modules more suited for "modern" looking GUI's?
If it is advanced knowledge of how the GUI's work, are there some tutorials out there for how to make GUI's look more "modern".
Thanks in advance.
Tkinter comes with a set of widgets called "themed tk", provided by the ttk module. It provides more modern-looking alternatives to some of the core widgets such as buttons and labels, and it also has a few new widgets such as a notebook and tree.
After a lot of research I've decided to use the Qt bindings library for Python called PyQt5 (http://www.riverbankcomputing.com/software/pyqt/download5). It's quite easy to implement and has tons of documentation. The interface elements (called widgets in Qt) look exactly like the ones in the host operating system: if you run the program in Windows 95, they'll look like that, same for Windows 7, and even MacOS. I find Qt extremely powerful. I'm developing a Python/MySQL application and the QtSql module helps a lot in the development with creating tables.
You can use htmlPy. So you can create GUI's with css html js with good looks.
QT is a good choice in many cases, but sometimes you need much faster response time, or native support of OpenGL(ES), or just another license. There are a lot of alternatives:
GUI Programming in Python (many specific frameworks): https://wiki.python.org/moin/GuiProgramming
The most widespread cross-platform GUIs: https://docs.python.org/2/library/othergui.html
I was looking into Tkinter, but I was wondering if there are any other packages that help with GUI. Even though Java is more robust than python, python is faster to write and would be very helpful if I am just trying to create a quick application. I usually use .Swing and .awt in java to make all of my applications.
Also, Is there something similar to JWS for python? I am looking to add a link on a website that will fire up a python coded application
Thanks
(P.S. I'm using Python 3.2.2)
I love using tkinter with python. It is pretty easy to do, there are lots of examples, and numerous questions with answers on here too! Also, 90% of people with python have tkinter already on their system, making distribution pretty straight forward. I also have had success using py2exe to create windows executables.
Here is a gui that I wrote in all of ~10 minutes. Once you understand the syntax it is very easy.
And another more elaborate one that I wrote with vtk and matplotlib embedded into the gui for 3D and 2D graphics! The question I asked with this.
Yes, python and tkinter are excellent for developing GUIs. While this is true of most scripting languages, I think these two make a particularly good combination.
For most GUIs, functionality is more important than form (ie: eye candy is not top priority). Even then, it's possible to make very nice looking GUIs with Tkinter. Tk has been my go-to toolkit for close to twenty years. It is most easily used with Tcl since that is its native language, but there's no denying the advantage python has over Tcl as far as built-in functionality goes.
That being said, all of the toolkits available to a python programmer are good. Tkinter's main advantages are that it is extremely easy to use and you probably already have it installed, so the barrier for entry is very low.
Instead of having a different download of a program for Windows and Linux, would it be possible to make the download be a cross-platform script/executable that can download the correct installer from an FTP server and start that? What language should I write it in? The only one I can think of would be Java, but I don't want to take the time to learn it. I can't write it in Python or BASH, because most Windows machines don't have these installed. How should I do this?
Cross-platform executable(like an exe or a.out or ELF) is out of question. An executable is never cross-platform when Windows is involved. The scripting languages(or JIT compiled) have to be brought in for this purpose. We are in a CHICKEN-AND-EGG paradox. You may have to detect the OS the downloader is using, using a Javascript script in your website page and decide on what is to be done next etc...
Although not exactly what you are looking for, below are some pointers.
The best tool I know of, for multi-platform installers, is Flexera Software's InstallAnywhere. That might be a bit costly. For free options I would look into options like:
PERL
PYTHON (but this is out of question as per your post, but look at the end of my post for more options for Python)
Although writing the installer in any of the above languages might mean a lot more work, they provide you unmatched flexibility and complete control.
Perl requires that you install Perl interpreter and modules on Windows. But this also seems to be out of question for you. So you may avoid the headache by looking into:
PAR
pp
For Python go through:
py2exe
pyinstaller