'Convert python script outputs to pdf just like jupyter notebook

I have been looking for something similar to this:

!jupyter nbconvert File.ipynb --no-input --to pdf

It's just that I cant use jupyter in the production environment, So i have to convert it into script and then generate pdf using that script. Also, input should not be displayed in the pdf file, Just the outputs. Do we have something like this in normal python?

I have N number of lines written in jupyter and I want the output from those lines of code to be in a pdf. Like a report



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source