I am taking a slight break from C++, going back to Python, one of my favorite languages ever! I found the following material on structuring Python code and it is great! Posting it here so I can always come back to it. I recommend it to all the Python enthusiast looking at ways to improve their coding structure. Intermediate and […]
I wrote this a while back to scrape a given URL page for all links it contains and then search those links for term relations. The Python scrapper first finds all links in a given url. It then searches all the links found for a list of search terms provided. It will return stats on the number of times specific […]
Error I received the following python error: TypeError: expected a character buffer object The below screenshot shows my code. Solution I was using the replace method, while the better method for my situation would be to use the re.sub(patter, replace, string) method, the new line became: my_text = re.sub(comp, ‘#undef SEEK_SET\n#undef SEEK_END\n #undef SEEK_CUR\n#include ‘, f) The replace method expects […]
Django comes packaged with a lightweight python server. It is not intended to be a production server but more a testing/development host. Running the server is as easy as running the following command within a Django project: python manage.py runserver Since it’s so lightweight, it doesn’t come with the same abilities as other servers like Apache or Nginx. It can’t […]
Today I soldered a PIR sensor to my Pi! Basically, I want it to detect movement and turn on a LCD screen, then turn the screen off again after a minute of no movement. So when I walk into a room, the screen turns on and when I leave, the screen turns off. Equipment My Pi (See early Posts) PIR […]
Here is another great reason to love Python! Matplotlib is a plotting visualization tool for plotting graphs in python. What better way to present data than in XKCD format!