Ready to Start Your Career?

Part 1: Creating *Juliar * Modules in Python

Rattar 's profile image

By: Rattar

August 30, 2016

Creating *Juliar * Modules in Python (Part 1) - CybraryWith 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: 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: 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.
  • -- The example file (we won't be using it except for reference).
 Alright, let's create a new file ""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 let's import it now.Type in:

*import=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 "" 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's do that now. Type in:

*import=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.
Schedule Demo