Python Forum
Calling cell / modules in PyCharm Community - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Calling cell / modules in PyCharm Community (/thread-34422.html)



Calling cell / modules in PyCharm Community - erdemath - Jul-29-2021

Hi,

I moved to PyCharm community from spyder. I have issues with calling modules that are defined in a cell. All are stored in the same folder.
Let me give you a dummy example below;

#............................... Class - I ............................................#
class DataRetrieve():

    def __init__(self):
        self.filename = r'C:/Users/... .png'

        # Get the basics of data
    def main_extractInfo(self):
        ...................
    return data_sampling_rate

if __name__ == '__main__':
    runner = DataRetrieve()
    runner.main_extractInfo()
#................................................................................................#

#.........................Class - II to call Class - I ......................#

from DataRetrieve.DataRetrieve import main_extractInfo # At this point the message is ''cannot find the reference DataRetrieve in DataRetrieve.py''

class DataPreProc():

    def main_Data_PreProc(self):
    .....................................................................................
    return data_new

if __name__ == '__main__':
    runner = DataPreProc()
    runner.main_Data_PreProc()