mercredi 27 mai 2015

how to call a function in python in another function?

I have a function named mynet.py in that I make a network randomly(G) and choose some of its nodes as infectious nodes randomly. after making this network I want to save the result and call them into another function named myoperate.py. I use command: import mynet as mn G1=mn.G in myoperate.py, but it seems whenever I run myoperate.py the function mynet is runned and make a new network, how can I use the saved network in mynet into myoperate? any help would be appreciated




Aucun commentaire:

Enregistrer un commentaire