I’m trying to make an app in CPython that should work on both linux and windows.
I’m using the webkit library, witch works fine on linux (Ubuntu 12.04), but I can’t get it to work on Windows.
I know that I can compile my app into a Windows executable (.exe) with py2exe, but to do that it must work on my Windows machine.
The question is: Is there any way I can package my app under linux, so it will have it’s dependencies (webkit) bundled with it, so it will work under Windows? Or is there any way to make a windows executable that doesn’t need any dependencies from a python file, under linux?
Thank you!
EDIT:
Here is my code for the test app:
import gtk
import webkit
class Base:
def __init__(self):
self.builder = gtk.Builder()
self.builder.add_from_file("youtubeWindow.ui")
self.main_window = self.builder.get_object("main_window")
self.scrl_window = self.builder.get_object("scrl_window")
self.webview = webkit.WebView()
self.scrl_window.add(self.webview)
self.webview.show()
self.webview.open("http://youtu.be/o-akcEzQ6Y8")
self.main_window.show()
def main(self):
gtk.main()
print __name__
if __name__ == "__main__":
base = Base()
base.main()
Ok, so i couldn’t get webkit to work on windows with GTK, but i found out that Qt provides an integrated WebKit module, so I donwloaded PySide (the Qt wrapper for python) and I tested it with this script:
Also i used GUI2EXE and *cx_Freeze* to package it into an .exe windows app. (Don’t forget to include the modules atexit,PySide.QtNetwork, more details here)
A cool guide on Qt-Webkit can be found here (It usese PyQt, but it’s compatible with Pyside)
Also a Pyside tutorial here