python cross platform apps
Question: 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()
    


Answer: 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:

    
    
    import sys
    from PySide import QtCore
    from PySide import QtGui
    from PySide import QtWebKit
    
    class MainWindow (QtGui.QWidget):
    
        def __init__(self):
            super(MainWindow, self).__init__()
            self.setGeometry(300,300,800,600)
            self.setWindowTitle('QtPlayer')
            web = QtWebKit.QWebView(self)
            web.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled, True)       
            web.load(QtCore.QUrl("http://youtu.be/Dys1_TuUmI4"))
            web.show()
            self.show()
    
    
    def main():
        app = QtGui.QApplication(sys.argv)
        win = MainWindow()
        sys.exit(app.exec_())
    
    if __name__ == '__main__':
        main() 
    

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](http://qt-project.org/wiki/Packaging_PySide_applications_on_Windows))

A cool guide on Qt-Webkit can be found
[here](http://www.rkblog.rk.edu.pl/w/p/webkit-pyqt-rendering-web-pages/) (It
usese PyQt, but it's compatible with Pyside)

Also a Pyside tutorial [here](http://zetcode.com/gui/pysidetutorial/)

