Skip to content

petomalina/PyCommander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyCommander

PyCommander is a simple system for organizing commands. This example shows how it work:

import PyCommand
import PyCommandTable

class MyCommand(PyCommand.PyCommand): # we are defining new class on top of the PyCommand

    def __init__(self):
        super(MyCommand, self).__init__('$') # initing trigger, the $(dolar) sign will be the trigger

    def call(self,args):
        print("This was called!", args)


table = PyCommandTable() # we create a new table

command = MyCommand() #creating instance of our command

table.add(command) # we add our command to the table

table.call('$') # output >> This was called! []

table.call('$', [1,2,3]) # output >> This was called! [1,2,3]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages