TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 07-04-2009, 04:08 PM   #1 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Arrow Python to PHP Translation Needed

Ok I have this python code and I need it translated to PHP super fast before my mother in law dies...

Code:
#!/usr/bin/env python

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

class Application(QObject):

	def __init__(self):
		QObject.__init__(self)
		self.setObjectName('Application')

	class Console(QObject):
		
		def __init__(self):
			QObject.__init__(self)
			self.setObjectName('Console')
		
		@pyqtSignature('QString')
		def display(self,text):
			print text
		
		@pyqtSignature("")
		def fortune(self):
			print "fortune called"
			return 23 # XXX: does not work

	
if __name__ == '__main__':
	
	app = QApplication(sys.argv)
	
	web = QWebView()
	web.setWindowTitle('My Application')
	web.resize(800,600)
	web.setHtml(QString("<a href=\"#\" onclick=\"Console.display('wow!')\">Hello, World!</a>"))
	
	frame = web.page().mainFrame()
	frame.addToJavaScriptWindowObject('Applicaiton',Application())
	frame.addToJavaScriptWindowObject('Console',Application.Console())
	
	web.show()
	
	sys.exit(app.exec_())
Now get going this is a life and death situation!!!
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need delphi to PHP translation Village Idiot Python to PHP Translation 10 06-25-2012 12:34 PM
PHP socket based communication with a python server tripy Advanced PHP Programming 7 07-15-2009 08:20 PM
need a built in function in php which work same as isinstance function of python tech Absolute Beginners 1 06-25-2009 01:22 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM


All times are GMT. The time now is 04:28 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design