Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-13-2020, 04:01 PM
zum zum is offline
Registered User
 
Join Date: May 2020
Posts: 2
Error importing functions in Python

Hi support team,

I'm trying to import fuctions from a separated script to be used by my main script,but I got below error when my main script is run:

ImportError

Error: No module named "script which have the functions"
File: Path where I have both files
Line: 9

from "Script which have the functions" import main


The main script look like this:

Code:
# $language = "Python"
# $interface = "1.0"

from "Script which have the functions" import main

crt.Screen.Synchronous = True
s = crt.Dialog.Prompt("Type ID: ")

main(a)
I emulate the functionality in my python terminal and it worked as expected. But when I implement same functionality in SecureCRT I got the error above.

Is there a workaround about it? or I'm doing something wrong? Im using Python 3.7.6 and SecureCRT 8.0.4. Both files are allocated in same location.

Last edited by cboyack; 06-15-2020 at 07:09 AM. Reason: Please surround code with [CODE] and [/CODE] for proper legibility
Reply With Quote
  #2  
Old 06-15-2020, 08:54 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,322
Hi zum,

Python 3.x is not supported in SecureCRT 8.0.x (or even 8.7.x). It's version 2.7. But Python v3.x support is available in a pre-release build of SecureCRT v8.8.x.

If you want to try the pre-release build, send email to support@vandyke.com with the email address associated with your download account and reference Forum Thread #14205 in the subject line.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:44 PM.