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 04-16-2019, 03:42 PM
slouw slouw is offline
Registered User
 
Join Date: Nov 2005
Posts: 123
Scripting Reference to current script filename

Is this possible?
I want to refer to the filename of the script from within that script.
Currently I hardcode the script filename when writing to a debug log file.
For example in the fragment below the script filename running is Blah.py.
I want to refer to a variable here which represents the filename of the script being run.
Seems a long shot....

Quote:
#Write to file
fileMode = "w"
fp = file("C:\PythonLog\\Blah.log", fileMode)
fp.write("00000 stub.py START\n")
fp.write("\n")
Reply With Quote
  #2  
Old 04-16-2019, 04:13 PM
slouw slouw is offline
Registered User
 
Join Date: Nov 2005
Posts: 123
Might have found it....

[ varname = ] crt.ScriptFullName
Reply With Quote
  #3  
Old 04-16-2019, 05:11 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 886
Quote:
Originally Posted by slouw View Post
Might have found it....

[ varname = ] crt.ScriptFullName
Yes. That's it.

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: http://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: http://www.vandyke.com/support
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 10:31 AM.