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

61

u/valkyndev Nov 24 '20

Hey! Curious to know, what exactly are are you writing that's 10,000 lines long? I've been trying in my own time to start work on a project that can reach that can kind of scale, but I don't know where to start

68

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

It's a semiconductor wafer endpoint detector.

These tools polish wafers and it's important not to overpolish. So based on the different types of the wafer, wafer size, whether we're measuring types of endpoint algorithms of the tool, it reads data that converts and displays realtime graphs. The program watches, calls endpoint, and signals to the tool to stop polishing. (This is a VERY general rundown of the program)

I also have built-in tools for post-processing of wafer data, exporting data, and a whole host of additional features.

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!

5

u/[deleted] Nov 24 '20

have you considered using labview?

5

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

I use A LOT of matplotlib, numpy, and scipy.

I don't know much about labview, or have any experience with it.

2

u/selah-uddin Nov 25 '20

*sad panda noises*

4

u/kingsillypants Nov 25 '20

in high voltage physics class, that's what we used.

Also, I'm not allowed in the lab alone. Which is fair. :P

2

u/sxh967 Nov 25 '20

Imagine if your company was in Poland and you had a trademark dispute with a Polish ice cream manufacturer.

-11

u/[deleted] Nov 24 '20

Now explain why your employer puts hundreds of thousands of dollars of machinery and product into the hands of a Python noob?

15

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

Because my results produce $$$, and that's all anyone cares about. They don't care how I get there, as long as I get there.

Edit: As for me, I want to continue to learn and grow in my Python skills. So this milestone I've overcome, I feel is great for my personal growth and self-efficacy in my programming skills.

6

u/[deleted] Nov 24 '20

Can’t argue with results! Keep it up. I imagine programming is a natural branch to your trained discipline? Industrial process engineer?

10

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

I have a dual Computer Engineering/Computer Science degree from 2002, then law school (I hated law), then a Masters in Education. I left tech to teach middle school math for 10 years. But I couldn't afford my family because we pay teachers like garbage, so I came back to tech 2 years ago.

My title is Software Engineer and I use Python, ladder logic, all sorts of proprietary PLC languages, HMI code, and a few others. It's been a great journey and I really enjoy it.

Edit: I loved teaching, and this is the type of teacher I was:

Action Fraction math video

And yes, I am Action Fraction.

2

u/kingsillypants Nov 25 '20

congrats man!

1

u/CarbonTubez Nov 25 '20

How are you retrieving the real-time tool process data into Python? I work in the field but use offline SQL data.

2

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

Proprietary hardware configurations.

3

u/Hmolds Nov 25 '20

I can understand from a new beginner's perspective that the number of lines is impressive. However, the line count doesn't solve your problem. The code does. Having much unnecessary code leads just to problems down the line.

Check out the "Stop writing classes" talk by Jack Diederich where this genius quote came from.

I hate code, and I want as little of it as possible in our product.