r/learnpython • if MacItaly: return helpful / else: return to_Google • Nov 24 '20

Beginner/Intermediate Python Programmer Finally Using Multiple Files for Project

Holy Moley! I started playing around with building a mini-project using multiple files instead of one long file. Wait, let me back up...

I just started Python about a year ago, self-taught, and have been actively building desktop apps for my company in the CMP Semiconductor field. They're efficient applications that my boss loves and have been able to make us some good $$$. But, my codes are over 10,000 lines long. And I knew there had to be a better way.

Fast forward to today where I built a main file, and put a class in another file with some basic math functions. Then in my main file I built a little GUI to solve simple math problems. (I LOVE PYSIMPLEGUI, a big shout out to u/MikeTheWatchGuy for all the work he does.) And I just imported the class into my main and called it as normal...and it works. Easy as pie. I couldn't believe it. I feel like I've just learned a super valuable piece of information that I had been missing out on. Milestone achieved.

Thanks for reading and sharing in my epiphany!

433 Upvotes

75 comments sorted by

View all comments

Show parent comments

18

u/valkyndev Nov 24 '20

Very interesting, Python seems very useful for working with large sets of data. I've just started learning myself and there seems to be an abundance of libraries to easily pull from

18

u/[deleted] Nov 24 '20

[removed] — view removed comment

5

u/valkyndev Nov 24 '20

Sorry if this is too simple a question, but out of curiosity, for your particular use, how do Python's features/libraries help? What're your exact analysis needs?

17

u/[deleted] Nov 25 '20 edited Nov 25 '20

[removed] — view removed comment

6

u/MacItaly if MacItaly: return helpful / else: return to_Google Nov 25 '20

Nice. Clear and concise!

1

u/HardstyleJaw5 Nov 25 '20

I do molecular Dynamics simulations of channels so I routinely work with patch clamp data, glad to see python helping on your end too!