Convert python script to windows executable
Hi all,
I made a python script using Qt for a nice gui that reads the dvd in the drive, catalogues all the movies/files on the disk and stores them in a db so that when i want to watch a movie from my collection i can simply put in the name and it will tell me what disk the movie is in. now the problem is i want to port this python script to a windows executable so that i can run this on my windows desktop as well. had some questions/concerns regarding this .. hoping someone can help : 1. since the script uses qt first of all can it be ported to windows ? 2. in the script itself i use some native linux commands like 'du' .. would i need to change them to something else if i port ? 3. what about all the packages like pydb that i have importted in the script ? so they get compiled in the final .exe automatically ? this little script has been a much needed time saver for me and i would really love to be able to run it on windows ... even thought about coding it in C on windows .. but why waste time if i can manage to port the same python code to an .exe. thanks for the help -ankit |
Quote:
About qt: I think that qt3 has no free license for windows. If you used qt4 you are not going to have problems. You should be able to compile it in windows with very little work. But it all depends on the application. Some apps use OS specific code, others do not... Quote:
That's why it's a good thing to stick to standard ANSI libs (or qt, or whatever libs you are using). If you use libraries that are available in many architectures and OSes, and stick to the standard libraries of your chosen language, then you are going to have a much easier life. If you use external tools and libraries that are OS dependant, then you are going to have to reprogram that part of the program each time to want to use a new OS. Quote:
Quote:
If you are wanting to do so to override the dependencies, forget about it. You will still need everything you need on linux to run it. So, if you are using functionalities that are linux-only you are going to have to re-make some bits. |
Quote:
hmm ... is that the whole point of compiling it into a nice little exe file so that i do not need python on the windows computer to interpret my script ? also if i did manage to compile it into an exe why would i need the dependencies ? shouldnt they be compiled in as well ?? thanks -ankit |
There might be tools that can embed the python modules on a single exe file so your program can import them from there. I am not sure if there's anything to embed the rest of libraries like qt, however, even if there is, you need to make sure that everything needed is available for windows.
Supposing that statically linking libs into a python compiled object code, you can't expect to embed a linux qt .so file into such a file and hope that it will work in windows. You need the windows libs. And you definitely need to make sure that all the tools you use (for example, "du" as you said) are also available. There's no way to magically port your code if it's not designed to be portable. |
Quote:
|
All times are GMT -5. The time now is 07:18 PM. |