Part 1: Creating *Juliar * Modules in Python

August 30, 2016 | Views: 2122

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

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.zip

Once 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).

 

Alright, let’s create a new file “myfirstmod.py

Open that file and let’s put this in:

def hello(content,optionals):

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:

def nameofcommands(content,optionals):

return something

In “myfirstmod.py” file add a new command greet:

def greet(content,optionals):

return “Hello my dear friend “+content

Can 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.

Share with Friends
FacebookTwitterLinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterLinkedInEmail
Ready to share your knowledge and expertise?
Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Support Cybrary

Donate Here to Get This Month's Donor Badge

 

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel