How can you store a file handle in python similar to perl? -


how can perform code in python

open( output, $outputfile ) , $struct{'existing'} = *output{io} $struct{'output'} = *stdout{io}; 

a "file handle" in python reference file object, handled other name in python. opening file returns file object:

output = open(outputfile) 

this reference can stored in data structure:

struct["existing"] = output 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -