Subprocess module in Robofont

RoboFont Forums Help / General Subprocess module in Robofont

This topic contains 2 replies, has 2 voices, and was last updated by  frederik 5 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6118

    Roberto Arista
    Participant

    Hello RoboUsers!

    I would like to use the subprocess python module in Robofont.
    If I launch the following script from sublime/terminal:
    import subprocess
    subprocess.call([‘vfb2ufo’, ‘font.ufo’])

    this is the output that I receive:
    VFB2UFO Converter
    Copyright (c) 2013-2015 by Fontlab Ltd.
    Build 2015-01-23

    Otherwise, launching the same file from Robofont, I receive this output:
    Traceback (most recent call last):
    File “test_subprocess.py”, line 2, in <module>
    File “subprocess.pyc”, line 524, in call
    File “subprocess.pyc”, line 711, in __init__
    File “subprocess.pyc”, line 1308, in _execute_child
    OSError: [Errno 2] No such file or directory

    There seems to be a problem related to paths, but using something like:
    os.path.join(os.getcwd(), ‘font.ufo’)
    doesn’t fix the problem.

    Any tips?
    Actually I’d like to use the vfb2ufo tool someway, so if there’s an alternative to subprocess module is of course welcome.

    Thanks

    #6119

    Roberto Arista
    Participant

    Solved:
    from mojo.compile import executeCommand
    print executeCommand([‘vfb2ufo’, ‘font.ufo’], shell=True)

    #6120

    frederik
    Keymaster

    yep, using executeCommand solves your issue when shell is set to True

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.