Skip to main content

Hi

I'm trying to port some code so that all the uopy connections will use u2py instead, so I don't have to spend another extra license when calling my Python code from BASIC.

I've been looking to the u2py code for the u2py File object and I can't see a "close" method.

What's the proper way to close a file when using u2py?



------------------------------
Héctor Cortiguera
Quiter Servicios Informaticos SL
------------------------------

Hi

I'm trying to port some code so that all the uopy connections will use u2py instead, so I don't have to spend another extra license when calling my Python code from BASIC.

I've been looking to the u2py code for the u2py File object and I can't see a "close" method.

What's the proper way to close a file when using u2py?



------------------------------
Héctor Cortiguera
Quiter Servicios Informaticos SL
------------------------------

Hi Hector,

You shouldn't need to handle the closing of the file as its managed in the u2py class. Python has a garbage collector that will eventually clean up the object but you can still programmatically add manual handling if you wish to do so.



------------------------------
Bryan Tieu
Rocket Internal - All Brands
------------------------------


Hi Hector,

You shouldn't need to handle the closing of the file as its managed in the u2py class. Python has a garbage collector that will eventually clean up the object but you can still programmatically add manual handling if you wish to do so.



------------------------------
Bryan Tieu
Rocket Internal - All Brands
------------------------------

Hi Bryan

Already found the close method for the file.

We're in a resource-constrained environment, so every access should be managed carefully, we can't rely on garbage collection.



------------------------------
Héctor Cortiguera
Quiter Servicios Informaticos SL
------------------------------