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 11-19-2018, 12:23 PM
theride theride is offline
Registered User
 
Join Date: Nov 2018
Posts: 6
Python Script Parameters

I am executing my python script from the command line (example below). Is there a way to pass parameters to the python script?

c:\program files\vandyke software\Clients\SecureCrt.exe" /Script "C:\pythonfile\script.py"


Thanks.
Reply With Quote
  #2  
Old 11-19-2018, 12:54 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,607
Hi theride,

You can use /ARG on the command-line to pass arguments to your script.

More info can be found in the following Help file topics:
  • Scripting / Script Objects Reference / Application object

  • Scripting / Script Objects Reference / Arguments object

  • Using the Software / Command-Line Options / Table of Standard Command-Line Options
Depending on what you are trying to do, a simpler method might be to take advantage of the ability to pass arguments by configuring that script to be run from a button on the button bar.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 11-19-2018, 12:59 PM
theride theride is offline
Registered User
 
Join Date: Nov 2018
Posts: 6
Thanks for the quick response. I am trying to pass two strings to the script. Can you help me out with the syntax.

c:\program files\vandyke software\Clients\SecureCrt.exe" /Script "C:\pythonfile\script.py" /ARG "string1 string2"
Reply With Quote
  #4  
Old 11-19-2018, 01:48 PM
theride theride is offline
Registered User
 
Join Date: Nov 2018
Posts: 6
i figured it out, thanks.
Reply With Quote
  #5  
Old 11-19-2018, 02:08 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,607
Hi theride,

Thanks for the update.

For others that might come across this post, the /ARG option should precede each argument:
SecureCrt.exe /Script "C:\pythonfile\script.py" /ARG "string1" /ARG "string2"
__________________
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 05:07 PM.