jamesbraza Posted July 17, 2019 Share Posted July 17, 2019 Hello Digilent Forums, I am trying to write a Python script for the impedance analyzer. I am reading the WaveForms SDK and following examples. I noticed all methods in the examples that use the dwf (Ex: `dwf.FDwfDeviceOpen`) use positional arguments. In the SDK, it lists the parameter names/types for the method (Ex: `FDwfDeviceOpen(int idxDevice, HDWF *phdwf)`). I have tried and failed to figure out how to specify them using keyword arguments instead. Is it possible? Thank you in advance for your help! Link to comment Share on other sites More sharing options...
attila Posted July 18, 2019 Share Posted July 18, 2019 Hi @jamesbraza The dwf API consists of C style functions which are positional. Link to comment Share on other sites More sharing options...
jamesbraza Posted July 18, 2019 Author Share Posted July 18, 2019 Hi @attila, Thank you for getting back to me. I ended up writing 1:1 wrapper functions on the API methods I use that look something like this. def FDwfDeviceClose(hdwf: c_int) -> int: """Close the handle for a given device. Args: hdwf: (c_int) dwf handle Returns: int: 1 if successful, 0 if unsuccessful """ return dwf.FDwfDeviceClose(hdwf) Note: `dwf` is a global variable in this case. Cheers to AD2! Link to comment Share on other sites More sharing options...
Question
jamesbraza
Hello Digilent Forums,
I am trying to write a Python script for the impedance analyzer. I am reading the WaveForms SDK and following examples.
I noticed all methods in the examples that use the dwf (Ex: `dwf.FDwfDeviceOpen`) use positional arguments.
In the SDK, it lists the parameter names/types for the method (Ex: `FDwfDeviceOpen(int idxDevice, HDWF *phdwf)`).
I have tried and failed to figure out how to specify them using keyword arguments instead. Is it possible?
Thank you in advance for your help!
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.