Ready to Start Your Career?
August 30, 2016
Part 1: Creating *Juliar * Modules in Python
August 30, 2016
August 30, 2016
With the release of *Juliar * Alpha 10, you can now make modules for *Juliar * in any language! This means that you can use your favorite language to create modules.This tutorial assumes you know basics of *Juliar *. If you don't, check out the following tutorials:https://www.cybrary.it/0p3n/programming-with-juliar/https://www.cybrary.it/0p3n/programming-with-juliar-part-2/https://www.cybrary.it/0p3n/using-juliars-encryption-module/At the time of this post's release, only the "Python" module is available, so we'll be using that. However, "C#" is coming soon, as well as other languages. *Juliar * makes it dead simple to write modules in Python. To get started, please download the *Juliar * Development Kit at: www.juliar.org/pythondevkit.zipOnce you've done that...extract the zip file and you should have 3 files.
- Juliar.exe ---Main *Juliar * Language
- Juliar.pyc -- The Helper file. Every module you make in Python for * Juliar * must include this. A more experienced person might be wondering, "Do we need to include this file? Can't we make our own?" Although, you can make your own, *Juliar * is an evolving language, and it would be simpler to replace "Juliar.pyc" than to change your project files. It is highly recommended that you use this helper file.
- example.py -- The example file (we won't be using it except for reference).
return "Hello Friend!"*Please NOTE that each def REQUIRES (content,optionals): Get used to using that!Save the file!That's it! You just created your first *Juliar * module in Python! It's as simple as that. As you know, it should output "Hello" and let's test it.Open up "Juliar.exe" and type in *hello *Hmm, it says that the command hello is not found...Where did we go wrong?Right, we didn't import the module...so let's import it now.Type in:
*import=py myfirstmod.py *If everything goes correctly, it should output that you successfully imported commands! The command that should be displayed is hello. Let's test it again.Type in:
*hello *It should output "Hello Friend!" You can create MORE Modules the same way just by following the pattern of:
return somethingIn "myfirstmod.py" file add a new command greet:
return "Hello my dear friend "+contentCan you guess what this command will do? Make sure to save the file and let's go back to "Juliar.exe"Let's execute command *greet Andy *You'll get an error....? Why?Well, the module we imported originally did not have greet command. We need to re-import the myfirstmod.py.Let's do that now. Type in:
*import=py myfirstmod.py *Now typing in *greet Andy * works! and output "Hello my dear friend Andy"Try using *greet * with different names. Congratulations! You just got a white belt in creating modules for *Juliar *!Thanks for following the tutorial and have fun creating modules for *Juliar *If you find any bugs, feature suggestions, or want to help out please contact me. Let's make this great language even better. We appreciate all comments.By the way, Package Manager is coming soon, so you'll soon be able to share your creations with the world! Never discard your creations.If I get a good response, I'll write more parts to this tutorial to do some really amazing things.
Build your Cybersecurity or IT Career
Accelerate in your role, earn new certifications, and develop cutting-edge skills using the fastest growing catalog in the industry