Michele De Stefano's C++ Utilities
fileobj_usage.pycmd
1 // fileobj_usage.pycmd
2 //
3 // Copyright (c) 2014 - Michele De Stefano (micdestefano@users.sourceforge.net)
4 //
5 // Distributed under the MIT License (See accompanying file LICENSE)
6 
7 
8 /**
9  * \example fileobj_usage.pycmd
10  *
11  * Shows the usage of the fileobj_usage extension from the Python prompt.
12  */
13 
14 mds_utils::python::FileObj usage example from the Python prompt:
15 
16 >>> import fileobj_usage as fu
17 >>> fid = open('test','wb')
18 >>> fu.write_double(fid,9.8)
19 >>> fid.close()
20 >>> fid = open('test','rb')
21 >>> v = fu.read_double(fid)
22 >>> v
23 9.8
24 >>> fid.close()