Categories
Programming

Functions in Python: How to define and use them

If you want to use Functions in Python, you will need to define them first. Python is very straight forward in that. For example, we want to create the function ‘Cyberwarzone’, and once the ‘Cyberwarzone’ function is called, it has to print ‘This is cyberwarzone’. The code for this function looks like this: Cyberwarzone():   […]

Categories
Programming

How to download a page in Python

If you want to download a page with Python, you will be suprised on how many ways you are able to do so. In this post I have collected two methods which will allow you to download a HTML page directly with Python. The first one is the WGET function, this function is very direct. […]

Categories
Programming

How to loop in Python and print found items

If you want to create a loop in Python, you can use the the following code. This code uses a list, and we are going to loop through that list with a simple Python loop. The loop which is shown below uses the myLISTITEMS list which contains the items hacker, security and success. The len(myLISTITEMS) […]

Categories
Programming

How to read a file into a Python list

There are various ways to read a file to a list in Python, I usually use this method to load a list from a file. This method allows me to specify the file which i want to open, and it allows me to print the found lines in the list. The code The .splitlines() function […]

Categories
Programming

Writing a list to a file with Python

If you want to write a list to a file in Python, you will need to use the following Python code. The Python code which has been provided below is used worldwide by Python programmers to write a list to a file with Python. The code allows you to write rows which are found in […]