Addon Details

Watch - Add Favorite


2 out of 3 users claim this version works for them.
Does this version work for you?
14
w00ts
w00t!2

Remote Python interpreter - Version 1.5

posted on 2011-07-27 16:19:37
by GODJonez

Requires: [list][*]Common sense[/list]


Description

[color=red]Warning: do not use on public or shared servers. Or if you do, don't come cry to me you were not warned in case the whole system gets compromised because of unauthorized access to this addon remotely.[/color] As a server addon this script listens to network connections that spawn Python interpreters that are operated interactively via the network channel. This makes it possible to for example open a Python shell in a separate window and interact in the server's space having access to modules such as es and gamethread and actually able to interact with the game world through the EventScripts functions. This can be useful for addon developers or for example people doing screencasts. The package contains the actual addon (remote_interpreter.py) and then the client module (remote_python.py) that can either be ran as a Python script (e.g. python remote_python.py ...) or imported as a module in an interactive session and then called to connect. Steps to get started on server side: [list=1][*]Download the script and put to your server as usual [*]Edit the script file remote_interpreter.py and set up the network parameters and password (default is listening on IPv4 localhost at port 14726 and using the server rcon_password as the password) [*]Load the addon when you want to use it[/list] Steps to connect from command line: [list=1][*]Launch the remote_python.py file as a script. [list][*]On Linux you can make the file executable (+x) and call ./remote_python.py [*]otherwise you need to call it explicitly with Python: python remote_python.py [*]You need to provide one parameter which is the address of the server as you set it up. So by default this should be localhost:14726.[/list] [*]If connection works, you will be asked for password. Type the password and press Enter. [*]If you typed in the right password as you set up the server, there you go, Python shell from the server. [*]To quit, send EOF character. On Linux this is done by using Ctrl+D. On Windows you need to use Ctrl+Z possibly followed by Enter.[/list] Steps to connect from another Python shell: [list=1][*]Import remote_python as a module: "import remote_python" [*]Call the interact function from this module with the socket details as parameters, e.g. "remote_python.interact(socket.AF_INET, ('localhost', 14726))" [*]The rest should go like in command line case [/list]

Installation

Read the description.

Version Notes For 1.5

Updated on: 2011-07-30 13:47:02 EST by GODJonez (View Zip Contents)
[list][*]Another Py 2.5 fix[/list]

( Previous Versions )