r/learnpython • • Dec 23 '19

What are some creative small programs that you have coded using Python?

I am a beginner at coding with Python, so I am curious about learning what small programs or projects you all have created. I am hoping to develop my skills using Python, so I figured looking at actual code for various programs would greatly help.

Please include a short description of what the program does and the code itself in the comments below. Thank you!

348 Upvotes

224 comments sorted by

View all comments

Show parent comments

1

u/bumpkinspicefatte Dec 24 '19

That's fine, it was cool you created it and even cooler you shared. Would've been interesting to see a piece that had the purchasing part, nonetheless thanks and well done!

0

u/mar480 Dec 24 '19

It's essentially the same programming logic:

Once the book now button is identified:

  • Click

  • Implicit wait for page load

  • Identify other buttons/login elements

  • Access, click or type as needed

  • Repeat until done

The real skill of selenium IMHO is to master the implicit wait and exception handling (this is where I learned how to use try/except). With this under your belt, you can automate pretty much anything online. I know people always bring BS4 into the conversation but I've never really needed it for anything other than reading a specific piece of text or regexing.

1

u/bumpkinspicefatte Dec 24 '19

Yes I understand the logic behind it, just was always curious to see a super simple breakdown of some working Python code.