Python Plugin Loader
PythonLoader 0.3.4
This plugin allows developers to code bukkit plugins in the python programming language. The plugins in python can either use a thin wrapper to the standard Bukkit API, or the newer decorator API. For more detailed instructions for installing this plugin and how to code plugins, take a look into the Readme on Github.
Features:
- Load bukkit plugins written in python.
Installation: Put PythonLoader.jar into plugins directory and jython.jar into lib directory (within bukkit folder not plugins folder).
Downloads:
- PythonLoader 0.3.4
- Jython (By downloading and using Jython you accept the Jython License)
- Source Code
Documentation
The Readme on github contains an introduction to creating plugins in python
Also make sure to check out @zaph34r's tutorial series
I have to give special credits to lahwran who created the whole decorator API and corrected many of my mistakes. :)
is there a way to reload a single script/plugin?
i was sorta hoping since its python it would be easier to develop in it by just changing and reloading
@RedSeamonster I had the same problem on 1.5.2 and yeh I know that because the plugin binds to java via jython it doesn't need updates. But have you tried reloading the server (/reload) a couple of times in a short timeframe? Certain crash on the third to 4th reload.
If you do not experience this problem, can you show me an example of your code, maybe some hooks are bad.
Also for the yml option, try downloading the yaml parsing library for python (all python code NBNB) and parse it with yaml.load(yamlcontent) there is also the builtin for loading it through java I think
@yurippenet
Ya, I have the main.py file, I am just wanting a config.yml file in order to give the user configuration options. I'm not quite sure how to allow someone to configure the plugin (like in Essentials, for example).
And for your first question, I have had no issues running the loader on 1.5 at all. I'm pretty sure that because of the way it works, not many changes (if any at all) are required per new version of Minecraft. I have not, however, tested it with 1.6 dev build.
Couple of things: 1: Are you still maintaining this plugin? 2: Anyone know how to fix the reload bug where when you reload the server after a couple of times it crashes (PermGen out of memory something something)
3: @RedSeamonster First of all you don't really need a config.yml Just make a plugin.py.dir and put a main.py inside it. For me it didn't read the config.yml at all it seemed.
Could someone with more experience put together an example of a plugin with a config.yml file? I'm having issues understanding how to put it together in Python.
@JuniorGenius
Yes.
This is actually quite neat. Although I am a Java developer, not Python developer, I know a few people who are. This would be quite useful for them as most of them don't know Java.
Does this work in 1.5.2?
Does anyone know of any reason not to use Python's zipfile module to access the .pyp package? Eg. for populating the data dir on first run.
@b1naryth1ef
Thanks, it works.
EDIT
Issue solved.@RedSeamonster
How would I add aliases in the actual "hook.command("testcommand") line? The ReadMe gives examples of desc and usage but not that.
@WaferMouse
Ok thanks. I will mess around with this stuff some more and report back if I find something helpful.
On linux, the easiest way is to manually add the path to your modules directory (keep in mind I use Jython 2.7 so change the versioning accordingly.)
@RedSeamonster
I managed to get PyYAML working by dropping it into bukkit/lib/Lib/
If you're smarter than me, you might be able to find a nicer place using this pseudo-Py-code:
If you do find a better place, let me know!
If anyone can point me the way to reading a YAML file into a dictionary, I'd be very grateful. I'm not exactly experienced with Java dev.
I'm also trying to get MySQLDB package to work with this, and am having alot of trouble.
Anyone with some ideas/input on this subject?
Do you know how/if you can install Python Modules in these plugins? I want to use "requests" but it isn't exactly working at all. Any ideas?
@drhydralisk
You could use sqlite3
@ttfractal44
Agreed, I suppose what could be done is to have people who have plugins completed submit them with links to the project or something..