0
cmd = "perl -pe 's|hskip(.*?)(cm\\|in\\|pt\\|mm\\|em)|hspace{\\1\\2}|g' %s > %s"%(input_file, output_file) ret = subprocess.call(cmd, shell=True) if ret != 0: logging.error('FAILED: %s'%cmd) 

Error output:

'hskip' is not recognized as an internal or external command, operable program or batch file. 2021-02-21 16:39:46,454 root ERROR FAILED: perl -pe 's|hskip(.*?)(cm\|in\|pt\|mm\|em)|hspace{\1\2}|g' .\data\sample\im2latex_formulas.lst > .\data\sample\formul`as.norm.lst 2021-02-21 16:39:46,457 root INFO Jobs finished** 
3
  • 1
    Are you on windows? Commented Feb 21, 2021 at 11:28
  • 1
    Not a [latex] question! :) Commented Feb 21, 2021 at 12:56
  • Not a [perl] question either Commented Feb 22, 2021 at 8:11

1 Answer 1

3

If you are on Windows, you should use double quotes instead of single quotes:

For example:

cmd = 'perl -pe "s|hskip|hspace|g" in.txt > out.txt' ret = subprocess.call(cmd, shell=True) 

See also:

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.