Month: October 2019

Connecting SqlLite3 database to Python and Reading it

Connecting SqlLite3 database to a Python file is actually 1 line of code: conn = sqlite3.connect(r"C:\Users\database.db") I have used a database from sqllitetutorial.net, which was rather neat. Then DB Browser for SQLLite a LEFT JOIN was implemented, in order to unite the

Tagged with: , , ,

Adding data to SqlLite3 database, but only one value with Python

Life is hard, when you are learning Python and you see things that are making no sense the way they run. After writing about adding data to SqlLite3 with Python, today I have tried to do the same, but for

Tagged with: , , ,

Find all HTML tags in a web page and print them from a sorted dictionary

Finding all HTML tags from a web page and recording these to a dictionary is magically easy task with Python (if you compare it with #VBA), when Beautiful Soup 4 is used. soup.find_all(True) loops through the tags and a simple

Tagged with: , , , ,

Write Formulas in Excel through Python XlsWriter

Writing formulas with Excel with Python is a technique, that needs some practice, actually. Although XlsWriter has some good documentaion, not a lot is covered on the point, that concerns creating a file with a formula in it. First and

Tagged with: , , , ,

Writing to a text file in Python from a variable, ignoring encoding problems

Writing to a file in Python is usually a simple 2-liner, which is easy to be written:

However, problems with the encoding may cause some research needed. Concerning the encoding this is a great article from the creator of

Tagged with: , , ,

Show all links from a website with Python and BeautifulSoup – Video

Showing all links from a website with Python and BeautifulSoup is actually 6 lines of code – 2 to define the used libraries and 4 to do the job:

In general, BeautifulSoup comes out of the box with beautiful

Tagged with: , , , , ,

Python – The birthday paradox algorithm

The birthday paradox is an interesting problem, mainly because of its somehow “unexpected” results. The problem usually is stated as the following: What is the minimum number of people in a room, in order to have a probability higher than

Tagged with: , , ,

VBA – How to implement workbook events in Excel – GIF

The Excel Workbook object is a part of the Workbooks collection. The events are the code, which is “activated” or “triggered”, once a specific event happens. These events are different and could be unlimited, but there are a few built-in Workbook

Tagged with: , , ,

Sets in Python – Differece, Symetric Difference, Union, Intersection

After writing the article scraping a web site up to the N-th level with Python, I have decided to summarize what could be achieved with Set() in this language. Pretty much, sets can be described as lists with a few

Tagged with: , , , ,

Numpy and Pandas – Small introduction with Jupyter Notebook

Last week I was participating at the Python and ML Summit in Berlin. One of the most interesting lectures, on which I participated, was a workshop by, named “Reading all yourself was yesterday – How to turn large amounts of

Tagged with: , , , , ,

Python and MachineLearning Summit in Berlin – Summary

This Monday and Tuesday (14. – 15. October 2019) I was in Berlin, participating at the #Python and #ML Summit. Actually, #Berlin is a nice city, one of my favourites in Germany, thus if you are not from there, only

Tagged with: , , , ,

Competitive Programming – Bus Stops Problem – Video

In competitive programming, following the ICPC rules, one of the best strategies is to scan the problems given to your team and to start with the easiest ones. The easiest ones are not always the first problems and sometimes these

Tagged with: , ,

VBA – How to avoid naming variables with non-latin alphabet characters (special letters)

Writing code in the local language is actually taught by about 100% of the German VBA books, which I have read. Which is “kind of ok”, if the VBA code only works on German computers. However, if this is not

Tagged with: , ,
Top