by doitwithcode | Feb 21, 2020 | Blog, Python
Suppose I want to create a Selenium script that logs into Facebook, I would first have to log in to Facebook by instructing Selenium to fill out the login form below However, instead of spending time to write code for the login ( fill in the form and click on Log in...
by doitwithcode | Feb 19, 2020 | Blog, Python
A Python module is a file or group of files that contain function definitions and statements. A module can be created by creating a .py file. For instance, we can create a file hello.py with the following code: def say_hello(): print(“Hello World!”) We can...
by doitwithcode | Feb 12, 2020 | Blog, Python
Python 3 has a built-in method for accepting user input. Let’s take a look at how to implement this. We want to accept two numbers from a user then return the product of both number1 = input(“What is the first number? “) number2 = input(“What...
by doitwithcode | Feb 4, 2020 | Blog, Python
The function below sums up two numbers with Python: def addition( a , b ): return a + b print( addition( 4, 5 ) ) print( addition( 2, 2.5 ) ) The function will work with integers and floats. If however the function is run with an integer and a string, the following...
by doitwithcode | Jan 20, 2020 | Bash, Blog, Linux
Suppose you have a variable below how would you increment that variable by 1 in Bash x=0 You can use let x++ If we want to loop through a number of items while incrementing the x variable, we can use the for loop below: for name in Lisa Lilly Lousa ; do echo $x $name...
by doitwithcode | Jan 17, 2020 | Blog, Python
I encountered the error below while trying to make a request using urllib SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)> (caused by URLError(SSLCertVerificationError(1, ‘[SSL:...