How do you run another file from
Jalcon (24)

Right now were creating a program called Jalcon Industrial:
And there is a /run command which runs other programs on different .py documents, so we were wondering how you can run those files from the main program?

P.S To run the python program you may have to open it in a new tab with this:

You are viewing a single comment. View All
ArchieMaclean (751)

You can use the import command to import another file. Usually this is used to import functions. Here is an example:

def greet():
  print("hello world!")

# first way
import test

# second way
from test import *    # import * means import everything

# third way
from test import greet

Please upvote if this helps :)

Jalcon (24)

@ArchieMaclean First of all, we upvoted your post :)
And WOW you are speedy! You also provide an answer to ask posts within (most of the time) the first minute!

ArchieMaclean (751)

@ArchieMaclean btw, if you need some code to run when you import it, just put the code in the file ( and it will run when (note that it usually runs at the start of the program (, not when it is imported)