16.06.2010, 06:15
(
Last edited by dugi; 04/07/2010 at 12:41 PM.
)
Well, I started this project ages ago, it failed, then I was motivated to restart it and got it to a fairly working state.
This is my development thread for my plugin which integrates the Python interpreter into SA-MP. Basically you can run Python scripts on SA-MP servers, similar to MaVe\'s Lua wrapper. (though obviously that allows you to run Lua, not Python scripts)
Ask questions and such if you want, I\'ll update it with more information and screenshots soon, and hopefully within a month or two it will be released.
What is it?
A plugin which will allow you to run scripts coded in Python on SA-MP servers, using both Python and SA-MP functions.
What\'s Python, and where can I learn it?
www.python.org
Why Python?
Because it rocks. Take a look at its massive collection of in-built modules: http://docs.python.org/modindex.html
What can you do with it?
Run Python scripts on SA-MP servers. You will have access to all of the normal SA-MP functions, in respective modules (ie. functions from a_vehicles.inc will be in the "vehicles" module, you will only need to import what you use) as well as all of Python\'s built-in modules. (such as urllib, cPickle and SQLite, just to name a few cool ones)
What about the speed?
I haven\'t actually done a speed test, but it will probably be slower at executing callbacks in Python scripts, and at calling SA-MP functions from Python scripts.
There is nothing I can do to help this, it\'d be a lot faster if plugins were given native access to the server, but rather everything must be done through Pawn. (without memory hacking, that is) Nevertheless, the delay in executing functions and callbacks will be mere milliseconds, if that.
I haven\'t done a speed test to compare Python and Pawn default functions, either, but probably will soon. Oh well, Python still rocks.
When will it be released?
When it is in a stable state with all functions/callbacks implemented, and doesn\'t crash the server every 5 seconds.
What will be included with it?
The plugin itself, all of Python\'s default modules, and all SA-MP Pawn scripts rewritten to Python. (as examples)
It currently uses Python 2.6.x, but may be upgraded to 3.
I want it now!
No you don\'t. If you want to help test it, though, you can PM me. Pawn and Python scripting experience would be handy, but I\'d be happy to let most people test it if they want to.
Where are the screenshots? Have you actually done anything yet?
Screenshots are coming soon. I\'ve mostly integrated the Python interpreter into a plugin already, some work is left on that though, as well as adding all native SA-MP functions to be accessible from Python.
Can I help?
If you have experience with Python, possibly. You can also help test the plugin, read above. PM me.
Join the IRC channel for development updates and latest news - #sa-mp.python on irc.tl (formerly FFSNetwork)
UPDATES- June 18 - base.pwn rewritten in Python as an example: http://pastebin.com/i5uRgHkg
- June 18 - Looking for Python coders to rewrite default SA-MP scripts (Pawn > Python)
- June 19 - Threads don\'t seem to be working :\