Site Sponsors:
Python 2100: Objects, Factories, & Frameworks 
Today we proudly release our latest training offering.



Designed for ADVANCED 'Python'eers, in Python 2100 we will discover how to use @staticmethod, @classmethod, getattr(), hasattr() as well as object factories, and "abstract" signature classes.

In addition to advanced framework & object management patterns, this one (1) hour training opportunity will also cover multi-object initialization as well as modern framework testing & maintenance strategies.


[ view entry ] ( 679 views )   |  permalink  |  related link
Python Stock Market 
Today we are hosting yet another "meetup." Designed for those who have been taking our Python 1000, 2000, and 3000 training, our goal is to build-up the resumes of our students.

Targeting a REAL WORLD game-play scenario that would impress would-be employers, we have set our sights upon a simple strategy.... Whoever can make the most "money" in the stock market, wins?



Anticipating the need, we decided to demonstrate how to get closing quotes from a particularly favorite quotation service:


# pip install urllib, first!
import urllib.request

class Stocks01:

def __init__(self, endpoint="https://www.alphavantage.co/query?function=TIME_SERIES_DAILY", key="demo"):
self.end = endpoint.strip()
self.key = key.strip()


def get_history(self, token):
url = self.end + '&symbol=' + token.strip().upper() + "&apikey=" + self.key

try:
response = urllib.request.urlopen(url)
return response.read()
except Exception as ex:
print(ex)
return None



stocks = Stocks01()
data = stocks.get_history("msft")

if data is not None:
import json
info = json.loads(str(data, "utf8"))
for row in info:
print("*" * 10, "KEY:", row)
if row != "Time Series (Daily)":
print("(skipped)")
continue
for ss, val in enumerate(sorted(info[row])):
print(ss, val)
for rec in sorted(info[row][val]):
print("\t\t", rec, info[row][val][rec])


Rather than using "demo," the link below will tell you how to get a free API key.

Hope you find it useful!


BONUS: Inspired by this meetup, PyDAO is a neat way to convert CSV / TEXT data (from NASDAQ, etc.) into Python.


[ view entry ] ( 300 views )   |  permalink  |  related link
Python From Requirements 
Supporting yesterdays skill review session, we added a series of "sub-challenges" to project PR05. The additions were added to the bottom of the document.

Designed to help new students understand how to develop software in the professional software development world, such presentations are being extremely well received.



Those needing extra help with PR05 and / or any of the other activities can find the solutions to these & other projects in our new Python by Requirement book on Amazon.


Sharing is caring!

-Randall


[ view entry ] ( 319 views )   |  permalink  |  related link

<<First <Back | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Next> Last>>