VanDyke Software Forums

VanDyke Software Forums (
-   Scripting (
-   -   call (

Neisany 01-17-2020 02:57 AM

is there any esay way to call a python script into the script thats running

file 1

# $language = "python"
# $interface = "1.0"

crt.Screen.Synchronous = True


  import os
  strHome = os.path.expanduser('~')
  strPathToFile = "{0}/Documents/".format(strHome)
  strPathToFile = strPathToFile.replace('\\','/')

  run(strPathToFile)  <-- this is where I need help

I am looking to call different files to make the script modular and update-able easily. The second reason is some parts of the script will run independently of the main sub and will not want to use the main.

second file

# $language = "python"
# $interface = "1.0"

crt.Screen.Synchronous = True

def main():
        crt.Dialog.MessageBox("hello world")


bgagnon 01-17-2020 08:14 AM

Hi Neisany,

It's more a Python question than a SecureCRT question, but when I googled it, the answer was to use import. I hope this helps.

All times are GMT -6. The time now is 02:30 AM.