Posts

Showing posts from December, 2018

Learning Flask for Python: HTML and CSS

Image
I've started learning Flask for Python.  This seemed easier than learning Django.  I will eventually learn Django but since I don't know much about web page design I decided to start with Flask. The main goal of learning Flask and Django is to learn more about Python.  I am not really interested in becoming a Full Stack Developer.  I'm  more interested in exploring all the things that can be done with Python. In order to start learning Flask, I am learning the basics of HTML and CSS.  Here is my first web page.

Blackjack v3 with SimpleGui and Python

Image
So this is my latest version of Blackjack with took me a few hours to get right.  The big difference is the dealer's first card. This card is not shown until the end of the round. It looks simple but it took me some time to figure this out. The issue was solved with a boolean expression which was used to determine when to use the back card image.  I achieved this by adding another method in the Card class. While this was a simple solution, it led to a number of problems. In the Hand class, I created a call to draw the back card if the game was in play.However, this led to both dealer's and plaver's cards being covered. (see below) I fixed this for the player but I then had the problem that the dealer's cards  were covered when I only needed 1 card covered.  This was a problem that I couldn't solve easily and after some time I thought about giving up. I then decided to see if I could draw 2 face cards for the dealer and then put draw a 3rd image card...

Blackjack with OOP and SimpleGui in Python v2

Image
This is the latest version of Blackjack.  I have included images for the cards and added some text.  I am a good way through the design of the game.  I have a number of things to do but at least I have made it to this part. As always, I will make a video of the game when I am done. Naturally, I am behind the rest of the class for this assignment. Other things come first but I will switch sessions when I am done with this. project and the next two assignments. This is not an easy class. Rice states that this is a class of 4 weeks with 7-10 hours a week.  But in truth that is the time for a student. For a person who works it is about 3-5 hours a week for about 8-12 weeks. It takes about 2 weeks to complete the assignments with a perfect score. It then takes another week to do the quizzes; there are 2 quizzes each week. A person should also remember that there is no Q&A with online classes. If you don't know the answer, a person needs to do a lot of sear...

Blackjack with Simple Gui and OOP in Python

Image
This is my first version of Blackjack. It is build using OOP( Object Oriented Programming) and SimpleGUI in Python. This is the first test version without graphics.  I was advised to test the basics of the different classes and passing values back and forth before going on to implement the graphics of the cards. You can see the results of the came in the output section on the right. It should say "Player has won". I will need to fix that code in the next round. This was not easy to build because the teachers from Rice did not really explain OOP well.  They went over the basics but they did not go into too much detail. Overall, everyone ( books and videos) explain the basics of OOP but they don't really explain how to use classes across the whole program. While the program from Rice is generally good, online learning does not dwelve deep into the issues. It is mostly: here is are the basics and figure everything else out using the internet.  It means that a lot ...

Memory Game in Python with SimpleGui

Memory game is one of those early programming challenges you think is easy but is a little more challenging.  When you get the instructions, you think that it is not worth it. But bit by bit, you start to code and things start making more sense and your start realizing why you enjoy programming games. Pong is actually the game that I am most happen with so far. However, memory game allows me to use the mouse in gaming so this is cool... This is one of my early versions of the game. Considering that I stopped making games in SimpleGui for a few weeks, I am happy that I can get back into it. It the background, I print out code info. This is just for game control. Obviously, my code doesn't 100% follow the logic of the Rice professors, but it gets the job done so I am happy. Once again, there is no sound with the video.

Twitter Sentiment Analysis Using BaseMap

Image
In this chart, I use BaseMap and Sentiment Analysis to analyze the sentiments of the President of the USA 2018 State of the Union speech. The data comes from Twitter and was provided by Datacamp. It should be noted that only 1-3% of  Twitter Tweets have location data attached to them.  Color coding is blue is positive and red is negative.

Retweet network using NetworkX and Python

Image
This graph shows the retweet network of the 2018 State of Union address.  I developed it using networkX in Python.

Social Media Data Twitter with Python

Image
In these graphs, I am examine the tweets about Python and R.  The first chart examines mentions of Python and  R during the month of March. The next chart examines the sentiment of these tweets. This is whether people were expressing positive or negative comments about Python and R.