How could I hide command prompt that pops up during launch and execute pylatex codes. I have a page working on it and generate pdf. I need to hide popup window when I run the code. 
Talking about this window:

Is there a way to hide or not showing latexmk.exe popup?
I have been googling and searching but I found nothing related to the issue.
Having had a look into Pylatex's source, the generate_pdf() method which I'm guessing you could be using, does in-fact allow for a silent=true/false parameter
Source comment:
silent: bool
    Whether to hide compiler output
However, this doesn't seem to be doing an awful lot and I believe if you were to pass that parameter in, you might still face the same issue, due to;
    else:
        if not silent:
            print(output.decode())
It seems there are two individual places where the use of check_output, which is a subprocess method, is being called to start-up latexmk. Which contributes to the window your seeing.
pylatest/document.py lines:
227
    output = subprocess.check_output(command,
                                     stderr=subprocess.STDOUT)
248
     output = subprocess.check_output(command,
                                     stderr=subprocess.STDOUT)
Possible Solution
You could make the adjustment to both those lines, by passing in the extra parameter shell=True, which will not display a cmd window upon invoking latexmk.
         output = subprocess.check_output(command,
                                         stderr=subprocess.STDOUT,
                                         shell=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With