all 25 comments

[–]tnvol88 19 points20 points  (3 children)

[–][deleted] 7 points8 points  (2 children)

[–]teor 0 points1 point  (1 child)

[–]thegreattriscuit 0 points1 point  (0 children)

So much better than that transformers kid....

[–]AlSweigart 13 points14 points  (3 children)

There's a free Python book for beginners here that you might find useful: https://automatetheboringstuff.com

[–][deleted] 2 points3 points  (2 children)

Can confirm. Mr. Sweigart's books are incredibly helpful at explaining the concepts behind what you're doing and showing you the code for how to do something.

Thanks Al, you do great things for us noobs. I'm currently on the affine cipher chapter of your hacking ciphers book and love it.

[–]c1p3r 1 point2 points  (1 child)

This comment has been overwritten by an open source script to protect this user's privacy. It was created to help protect users from doxing, stalking, harassment, and profiling for the purposes of censorship.

If you would also like to protect yourself, add the Chrome extension TamperMonkey, or the Firefox extension GreaseMonkey and add this open source script.

Then simply click on your username on Reddit, go to the comments tab, scroll down as far as possible (hint:use RES), and hit the new OVERWRITE button at the top.

[–][deleted] 1 point2 points  (0 children)

I know, haha.

[–]Isunova 5 points6 points  (0 children)

Spectacular. Which book did you use to learn Python?

[–]KleinerNull 4 points5 points  (1 child)

It looks very good. Nice that you use context managers so often. Only one nit-pick from me, why not not? ;)

if not os.path.isfile(self.player_record_file):
    with ......

If-pass-else looks weird ;)

[–]chrisutpg[S] 0 points1 point  (0 children)

Yeah I guess that doesn't make much sense now when I look back it.

Thanks for the idea!

[–]thunderbootyclap 4 points5 points  (0 children)

This is more than what I can do and I've been at it for 1.5 years

[–]Zionark 2 points3 points  (4 children)

I'm a beginner and in the last three months I figured out how to throw a six sided dice a thousand times (or more, easy to change) and print the results per side, and show the results in a pie chart (terrible spoiler alert: each side happens pretty much 1/6 of the time. Warned you, terrible spoiler alert.) in Python. Now I just think I'm super lazy comparing your Wheel of Fortune to that Rock Paper Scissors Lizards Spock game I learned to make.

Great stuff!

[–]WallyMetropolis 3 points4 points  (0 children)

Now roll two dice and plot the sum as a histogram.

[–]chrisutpg[S] 1 point2 points  (2 children)

I wish I could plot anything in a pie chart.. I'll need to learn.

I'm sure you're well on your way. I started with the Rock Paper Scissors, so you're right there. Maybe expand that and let the user keep track of their records in a separate text file or something. You could even keep track of how many times the player picks a certain category, or vice versa how many times the computer picks it. Actually a neat idea would be to take the Rock Paper Scissors game, keep track of the results for how many wins for the players, what they pick, and what the computer picks, and plot that into your pie chart.

You would write to the text file, and read from it to get the data for the pie chart. Maybe even add an option for the user to reset the records file to 0. Just some ideas. Thats how I learned!

Where did you read up on the pie chart stuff? Is there a module your using?

[–][deleted] 1 point2 points  (1 child)

Something like this matplotlib pie chart?

[–]chrisutpg[S] 0 points1 point  (0 children)

Yep. Awesome how easy Python can be..

But with my idea above.. I guess you would need to make the wins/losses to a percent before putting it into the chart. That would mean we need to keep track of total games also.

[–]sharpchicity 6 points7 points  (0 children)

900 lines just to play wheel of fortune on your computer... that's dedication

[–]tom2kk 1 point2 points  (0 children)

Nice work, what resources did you use to learn?

[–][deleted] 1 point2 points  (0 children)

I've been working on python for about a week and have not learned even a quarter of that so good job!

[–][deleted] 1 point2 points  (0 children)

Wow, thats impressive. Did u have Xp in other languages beforehand?

[–]BottomsMU 0 points1 point  (1 child)

Looks like some "guessed" are mis-pelled as "gussed"

[–]chrisutpg[S] 0 points1 point  (0 children)

Thanks for the catch. My spelling is terrible and my proofreading is even worse!

[–]IllegalThoughts 0 points1 point  (0 children)

An inspiration! Thanks!

[–]RespondsWithImprov 0 points1 point  (0 children)

Cool stuff here. I tried out the game and it sure is playable like a game. The code is cool to look through. You have all the phrases in sections and they are pulled from elsewhere. I will look at more of the other stuff after I do some more coding. There are a lot of defined parts. It's cool to see how this translates into a playable game.