Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Enabling PathExt disables tcstart.btm processing

Aug
132
4
I'm trying to achieve what seems to me like a simple goal: being able to run Python scripts easily from within TakeCommand v10.00.57. I tried using the internal scripting support, but that causes crashes about which I've posted elsewhere at http://jpsoft.com/forums/showthread.php?t=1031

My next step was to use an external interpreter, and I found that to work. The one annoyance was that I couldn't get TakeCommand to tab-expand script names as executable commands. After looking through the help, it seemed the PathExt variable might be what I wanted, so I tried enabling that via the OPTION command. As soon as I do that, though, TakeCommand stops processing the tcstart.btm file in its program folder.

What seems simple is turning out to be surprisingly unpleasant.
 
Phileosophos wrote:

> I'm trying to achieve what seems to me like a simple goal: being able to run Python scripts easily from within TakeCommand v10.00.57. I tried using the internal scripting support, but that causes crashes about which I've posted elsewhere at http://jpsoft.com/forums/showthread.php?t=1031
>
> My next step was to use an external interpreter, and I found that to work. The one annoyance was that I couldn't get TakeCommand to tab-expand script names as executable commands. After looking through the help, it seemed the PathExt variable might be what I wanted, so I tried enabling that via the OPTION command. As soon as I do that, though, TakeCommand stops processing the tcstart.btm file in its program folder.
>
> What seems simple is turning out to be surprisingly unpleasant.

The default Windows PATHEXT definition does not include the .BTM
extension; so you need to either add that or rename your TCSTART to a
.BAT or .CMD.

Rex Conn
JP Software
 
Phileosophos wrote:
The default Windows PATHEXT definition does not include the .BTM
extension; so you need to either add that or rename your TCSTART to a
.BAT or .CMD.

Rex Conn
JP Software

I'm glad you said that because I suspected that might be the issue. So that spawns a follow-up question: how do I set the default PATHEXT variable as part of TakeCommand's configuration? Or is that something I just have to do through Windows?
 
Phileosophos wrote:
| ---Quote (Originally by rconn)---
| Phileosophos wrote:
| The default Windows PATHEXT definition does not include the .BTM
| extension; so you need to either add that or rename your TCSTART to a
| .BAT or .CMD.
|
| Rex Conn
| JP Software
| ---End Quote---
|
| I'm glad you said that because I suspected that might be the issue.
| So that spawns a follow-up question: how do I set the default PATHEXT
| variable as part of TakeCommand's configuration? Or is that something
| I just have to do through Windows?

If you want to set the Windows default, you can use SET /S. That's needed
only once.
--
HTH, Steve
 
Phileosophos wrote:

> ---Quote (Originally by rconn)---
> Phileosophos wrote:
> The default Windows PATHEXT definition does not include the .BTM
> extension; so you need to either add that or rename your TCSTART to a
> .BAT or .CMD.
>
> ---End Quote---
>
> I'm glad you said that because I suspected that might be the issue. So that spawns a follow-up question: how do I set the default PATHEXT variable as part of TakeCommand's configuration? Or is that something I just have to do through Windows?

It's normally set in Windows (via the control panel/System).

Rex Conn
JP Software
 
My next step was to use an external interpreter, and I found that to work. The one annoyance was that I couldn't get TakeCommand to tab-expand script names as executable commands. After looking through the help, it seemed the PathExt variable might be what I wanted, so I tried enabling that via the OPTION command. As soon as I do that, though, TakeCommand stops processing the tcstart.btm file in its program folder.

I think you may be doing it the hard way. Instead of using PATHEXT, I'd just create an executable extension for .PY files.
 
I think you may be doing it the hard way. Instead of using PATHEXT, I'd just create an executable extension for .PY files.

Could you elaborate on that? Strictly speaking, the *.py files are already executable. Let's say I go to a Python script directory and type out "HelloWorld.py" and hit enter; the script would run just fine. The problem I was having was that typing "Hel" and hitting the tab key wasn't expanding to "HelloWorld.py" without diddling PathExt. If you know a better way, though, I'd love to hear it!
 
Phileosophos:
| Charles Dye:
|| I think you may be doing it the hard way. Instead of using PATHEXT,
|| I'd just create an executable extension for .PY files.
|
| Could you elaborate on that? Strictly speaking, the *.py files are
| already executable. Let's say I go to a Python script directory and
| type out "HelloWorld.py" and hit enter; the script would run just
| fine. The problem I was having was that typing "Hel" and hitting the
| tab key wasn't expanding to "HelloWorld.py" without diddling PathExt.
| If you know a better way, though, I'd love to hear it!

"Executable" depends on context. I interpret your above statement that when
you are at an interactive prompt in Python a file with the .py extension is
executable _BY_PYTHON_, but what would it do if you typed tcstart.btm?

A file extension marks an "executable" file in TCC if

1/ PATHEXT option is

* enabled, and the extension is one in the PATHEXT variable, OR

* disabled, and the extension is one of the TCC standard extensions:
.BAT, .CMD, or .BTM (files is interpreted directly by TCC); .EXE, .COM (file
is "run")

2/ Regardless of the state of the PATHEXT option, if the file extension is
explicitly made executable by creating an environment variable whose name is
the file extension (including the leading period, e.g., .PY) and the value
is the TCC command to execute.

TAB completion immediately at the command prompt works only for
TCC-executable files as defined above. Insert a space at the beginning of
the command line, and tab completion works for all files.

Note that files with file extensions which have Windows-associated
executable filetypes can also be used as commands, but are not
"tab-completable".

I use the following 3 executable extensions in TCC:
.ali=alias/r
.fun=function/r
.set=set/r

You can find a lot of this information in HELP topics "filecomp.htm" (in the
search tab enter TAB COMPLETION or FILE COMPLETION) and "exeext.htm" (search
for EXECUTABLE EXTENSIONS).
--
HTH, Steve
 
Re: Enabling PathExt disables tcstart.btm processing

On Thu, Mar 12, 2009 at 7:17 AM, Phileosophos <> wrote:

> ---Quote (Originally by Charles Dye)---
> I think you may be doing it the hard way. Instead of using PATHEXT, I'd just create an executable extension for .PY files.
> ---End Quote---
>
just fine. The problem I was having was that typing "Hel" and hitting
the tab key wasn't expanding to "HelloWorld.py" without diddling
PathExt. If you know a better way, though, I'd love

Try doing this:

SET .PY=NOTEPAD

Then, type "Hel" and touch the tab key. You'll find that it does
expand to "HelloWorld.py" If you press Enter, it will now launch
notepad with HelloWorld.py

Then, replace NOTEPAD with your python executable that would take
HelloWorld.py as an argument. I am totally ignorant of python, and
can't offer a suggestion because of that.

--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 
Hit the spacebar first, then type Hel, then hit tab.

-Scott

Phileosophos <> wrote on 03/12/2009 10:17:40 AM:


> ---Quote (Originally by Charles Dye)---
> I think you may be doing it the hard way. Instead of using PATHEXT,
> I'd just create an executable extension for .PY files.
> ---End Quote---
>
> Could you elaborate on that? Strictly speaking, the *.py files are
> already executable. Let's say I go to a Python script directory and
> type out "HelloWorld.py" and hit enter; the script would run just
> fine. The problem I was having was that typing "Hel" and hitting the
> tab key wasn't expanding to "HelloWorld.py" without diddling
> PathExt. If you know a better way, though, I'd love to hear it!
>
>
>
>
 
Back
Top