python - Use IOSTREAM instread of file in Pygmentize -


i have following in python script:

what try is

read partial source code(e.g. line 20 line 40) buffer , pip/apply iostream pygmentize can generate code highlighting partial source code.(e.g. line 20 line 40)

currently, create partial tmp file partial source code(e.g. line 20 line 40) , use tmp file on pygmentize.

subprocess.call(["pygmentize", "-f", "html", "-o", htmlfile, tmpfilename]) 

tmpfilename file name code want highlight.

my question:

how can create iostream , pip/apply iostream pygmentize don't have create tmp file in /tmp directory

any suggestion appreciated!


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -