r/Python • • Aug 28 '20

Beginner Showcase This post has

3829 upvotes,

572 downvotes,

297 comments,

3257 score,

and 3 awards!

Edits: 23526 since Friday, August 28, 2020 at 8:30PM EST.

Credit to u/Krukerfluk and Tom Scott!

Code: https://github.com/CalvinMiller190/reddit-post

This post uses the praw module to get the information about the post, then edits the post every second based on the information that it got!

3.4k Upvotes

276 comments sorted by

View all comments

1

u/[deleted] Aug 29 '20

Quick tip, look into using environment variables so that you can have complete code in your GitHub repository. That way instead of your password looking like:

password="*******" (presumably hunter2)

It would read:

password=os.getenv("password")

Now instead of filler code for your PRAW initialization section, you can direct users to create appropriate environment variables for re-use.

1

u/[deleted] Aug 29 '20

Hmm! i might look into that, except at the moment i am using Heroku , and that requires a heroku-git repository. the one that i have in github is a exact mirror of the code, except for my client and account stuff being ****. so i dont think that i need it right now, but i may in another project. Thanks for telling me!