0

I'm trying to use PyDAQmx. If I try to import like

    from PyDAQmx.DAQmxFunctions import *
    ...
    DAQmxResetDevice(ch) #unresolved

the function call is not recognized. However the following works just fine:

    import PyDAQmx.DAQmxFunctions as daq
    ...
    daq.DAQmxResetDevice(ch) #fine

Any idea why that might be? I'd like to use the first case just to avoid unnecessary clutter in my code since there will be a lot of function calls from that library. I know importing has been discussed to death and I looked at quite a few threads, but couldn't really find anything explaining my issue.

FYI, python 2.7, PyCharm 4.5.3 Community Edition, NI-DAQ 14.5.1, PyDAQmx 1.3.1.

kbau
  • 203
  • 1
  • 10

1 Answers1

1

PyDAQmx doesn't have an __all__ definition in its __init__.py: https://github.com/clade/PyDAQmx/blob/master/PyDAQmx/__init__.py

Without an __all__, Python doesn't know what to import.

Joe Friedrichsen
  • 1,976
  • 14
  • 14