First WebApp

Let’s create our first Web application in python using pyWebIO library. I am creating a simple calculator that will accept two numbers as inputs and based on the selected operation (i.e., addition, subtraction, multiplication or division), it will display the output. Let’s create a new file, to our existing project. Right click on the projectContinue reading “First WebApp”

WebApps in Python

PyWebIO – Helps to build webapps in Python. The main advantage is that no javascript nor the front end code is required. Refer to this site for more information on PyWebIO – https://www.pyweb.io/index.html Let’s see how to create our first web application using PyWebIO.

Create First Project in Visual Studio

Open Visual studio and create a new Project. Search for Python in the templates. Select Python web project and click on “Next“. Then, click “Create“ This creates a new Python project and can be viewed under “Solution Explorer“. Let’s install a python library called Flask. Expand Python Environments, you should be able to see theContinue reading “Create First Project in Visual Studio”

Reduce

Reduce is a functionality that is introduced in Python that will take 2 elements at a time from either list or tuple and the result of that operation is again taken with next element in the list till we arrive at a solid answer and the list or tuple traversing is complete. Let’s understand thisContinue reading “Reduce”

Globbing

At times, whenever we are searching for files in our System or Laptop, we have used wild card patterns like *, ?, etc. For example, if I want to search files that starts with Hepsi, I will use pattern like Hepsi* which will list down all the files that start with Hepsi. Python provides aContinue reading “Globbing”

Exceptions

While we are trying to access files via python, if there are any issue, it will raise an IOError. There are many scenarios where we can get IOError. ❑ If we attempt to open for reading a file that does not exist, it will throw an IOError.❑ If we attempt to create a file inContinue reading “Exceptions”

Files and Directories again

Let’s continue writing to file that was created in the previous post. In the code snippet above, Line number 1: The file path is mentioned in the __file__ variable. Line number 3: This code represents how to open the file and write the file. Line number 5: Writing file with few more data. Line numberContinue reading “Files and Directories again”

Modules

Modules are the logical unit that comprises of functions that can be reused in other multiple files. Consider module as the dll or the external files which can be referred in the file. Let’s see how to create a module. Create a new file called “modules.py” Add a function as shown below, This function justContinue reading “Modules”

Lambda Functions

Lambda functions are small and anonymous functions. Lambda function can take ‘n‘ number of arguments, but will have only one expression. To create a Lambda function in Python, we need use Lambda keyword. Let’s see with an example. If we assign a function to a variable, it becomes an anonymous function and thus a lambdaContinue reading “Lambda Functions”

Functions Again

ArgumentsConsider our previous function that was created that takes two parameters, num1 and num2. So, while calling the function we need to pass the same number of parameters i.e., if the function definition has two parameters, we need to pass two values, if the function definition has three parameters, we need to pass three values.Continue reading “Functions Again”

Design a site like this with WordPress.com
Get started