1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Enabling PathExt disables tcstart.btm processing

Discussion in 'Support' started by Phileosophos, Mar 11, 2009.

  1. Phileosophos

    Joined:
    Aug 28, 2008
    Messages:
    86
    Likes Received:
    2
    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.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,729
    Likes Received:
    80
    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
     
  3. Phileosophos

    Joined:
    Aug 28, 2008
    Messages:
    86
    Likes Received:
    2
    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. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    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
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,729
    Likes Received:
    80
    Phileosophos wrote:

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

    Rex Conn
    JP Software
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    I think you may be doing it the hard way. Instead of using PATHEXT, I'd just create an executable extension for .PY files.
     
  7. Phileosophos

    Joined:
    Aug 28, 2008
    Messages:
    86
    Likes Received:
    2
    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. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    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. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    605
    Likes Received:
    0
    Re: Enabling PathExt disables tcstart.btm processing

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

    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.
     
  10. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,177
    Likes Received:
    11
    Hit the spacebar first, then type Hel, then hit tab.

    -Scott

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


     

Share This Page