Learning Python. my first program

I Decided i would try learning Python, so i chose a book on the subject from oreilly i like there books they make very good quality books and the book i chose was no exception "Learning Python" its is a very factual read listing all the fundamentals of strings, dictionaries and variables …yawn! i soon got bored of just reading about them well after 230 pages i did and decided the best way for me to learn was to decide to program something and use the book as a reference along with Google of course and then go back to reading it after i put some of the concepts in to practice .

The program i decided to write would be a stock ticker , asking you to enter your portfolio and then looking up the current prices , this project gave a lot of learning opportunities , user input , web fetching etc and also left a lot of scope for growth as i learn . adding features like profit and loss current values etc and then maybe even a GUI. From the perspective of someone who is already a programmer it all sounds very simple , but from someone who is not a programmer the concept of it all and the design of what i wanted was a real intriguing thought.

so i started my project design , my first stumbling block was to get the variables into a way they would be usable , i wanted to create a dictionary for every stock symbol that i entered containing Price and Quantity so i need to name the dictionary with the value of a variable (the stock symbol) i tried a few way and searched to find more ways with no luck so i decided to get on IRC and look for some help on there , i found a python channel and asked my question the guys on there were patient and helpful , it turns out that the way i wanted to do things was not the best way to do it and probably not even possible so i was guided to making 2 dictionaries one called price and one called quantity , the keys in the dictionaries would then be assigned form the variables with the value also being a variable , and would be easily read by humans too; for instance the price dictionary would have a key of goog and the value 132  this would mean that the price of goog would be 132.

so after setting up loops etc the whole thing went well until i came to getting the webfetch , after some googling i managed to get the web fetch working too.

so at the moment the program does function it takes your input stores as a portfolio and then gets the current prices. Next i want to implement extended features on the returned data like showing the current value of the stock with the current price and showing profit or loss percentage etc and also editing the portfolio. These are all not difficult things but will take time to do, but so far i am finding my Python experience a fun one . so stay tuned for updates and eventually the completed code.

Read and post comments | Send to a friend


My fist apple pie

Today i created my first apple pie the outcome was that the filling was good but i need to make it less juicy and that my pastry needs changing.

i will try again , its not like its a hardship eating them 🙂

Read and post comments | Send to a friend

Hike to the beach

Today inbetween my busy schedule i managed a walk to bradys beach, a short little hike on  beautifull sunny day .was good for my back i think , and was  good excersise after my few weeks of rest.
here are some pics from the hike.


Read and post comments | Send to a friend

Rain, Fish and Monopoly

The boat finaly got fixed on Thursday so it was time to head out from Victoria and i am now  in bamfield  and its stopped raining ,
Today we played online monopoly, its great and its free  … it originaly a Linux application but there is also a Windows version called gtkatlantic and its open source and free. there are never very many people on the servers. Graphics are crapy but you can never go wrong with game play …its monopoly! good if you get  a few friends playing it, as it has ingame chat .

i was just looking through my pictures of my recent trip to Buchart Gardens and thought i will post a blog entry and attach a few of them.


Read and post comments | Send to a friend

%d bloggers like this: