python: performance improvement for file reads? -


if have python module @ start of time (not in function or class) reads value file, executed every time? or pyc file read value in stores value in compiled file?

short of using reload, module imported , executed once, first time program imports it. further imports of same module bind existing name in scope import happens, read done once.

if you're asking whether compilation step reads file , embeds in .pyc, no. code isn't run @ @ compilation time.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -