The most important part of coding plugin is making a good functional sample code.
To begin with there is an old fashioned ascii art at terminal or CMD.EXE. We will show this example as a new plugin.
Figlet is an imprementation to build BIG ascii art characters from normal text.
And you can find esaily python figlet module at google or pypi.
You can install pyfiglet using pip:
pip install pyfigletThe first and most important thing to build plugin is making a good python running code.
Now that you installed pyfiglet let's make a python script.
from pyfiglet import Figlet
f = Figlet(font='slant')
print(f.renderText('text to render'))This three lines code is enough. This shows how the python is simple for developers.
Let's save this script as pyfiglet_test.py. Then we can run.
python pyfiglet_test.py
__ __ __ __
/ /____ _ __/ /_ / /_____ ________ ____ ____/ /__ _____
/ __/ _ \| |/_/ __/ / __/ __ \ / ___/ _ \/ __ \/ __ / _ \/ ___/
/ /_/ __/> </ /_ / /_/ /_/ / / / / __/ / / / /_/ / __/ /
\__/\___/_/|_|\__/ \__/\____/ /_/ \___/_/ /_/\__,_/\___/_/Let's go back to our PyCharm environment.
You can find a file named requirements.txt at the asciiart folder. This folder is a sub folder from argoslabs and myplugin. This requirements.txt is the normal python and get some hints form this artical, How to install Python packages with pip and requirements.txt.
You need to add any dependent python modules.
Here is the example requirements.txt for this example:
# pip dependent packages
# default for alabs
alabs.common
# for ASCII Art using Figlet
pyfiglet
- Starting with
#is the comment line.- Every plugin must include
alabs.commondependent module. DO NOT SET specific version number for this module.- For some reason you need to set specific version for the module like
pyfiglet==0.7
Usually python modules are supported cross platform - Windows, Linux and MacOS. But sometimes some modules is need to installed and runned on specific OS.
For example,
# For Windows win32 dependent job : Windows ONLY!!!
pywin32; sys_platform == 'win32'After you modified requirements.txt you need to install that module for this python environment.
To install this requirements open the terminal from the context menu, Open In > Terminal.
Please make sure you have set the
Python Interpreterat Project menu at settings inPyCharm.
At PyCharm's terminal you can run this command:
pip install -r requirements.txt -i https://pypi-official.argos-labs.com/simple
alabs.commonpython modues exists at our officai repository.- So next index option,
-i https://pypi-official.argos-labs.com/simpleneeded forpip installcommand.




