Enabling PathExt disables tcstart.btm processing

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Aug 28, 2008
86
2
#1
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.
 

rconn

Administrator
Staff member
May 14, 2008
10,101
85
#2
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
 
Aug 28, 2008
86
2
#3
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?
 
#4
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
 

rconn

Administrator
Staff member
May 14, 2008
10,101
85
#5
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
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,385
39
Albuquerque, NM
prospero.unm.edu
#6
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.
 
Aug 28, 2008
86
2
#7
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!
 
#8
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
 
#9
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.
 

samintz

Scott Mintz
May 20, 2008
1,204
11
Solon, OH, USA
#10
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!
>
>
>
>