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”
Tag Archives: start learning python
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”
Files and Directories
Python provides functions to write / read files and operations like reading contents from the directory. These functions play a trivial role as most of the programs involves reading files or directories. Let’s discuss few functions related to this. File Object – First step to read / write files in Python is using File object.Continue reading “Files and Directories”
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”
Functions
Functions are logical grouping of code statements that collectively performs a specific operation or a specific requirement. Example: If I am building a calculator, a calculator can perform various mathematical operations like addition, subtraction, division, etc. I can create one function for addition, one function for subtraction, one function for division, and so on. Let’sContinue reading “Functions”
For Loop
As it says in the header, FOR LOOP is used when we want to execute block of code statements again and again until a condition is met, we can use For loops. To be very specific, to iterate any collections, like a list, tuples, etc. we can use For loops. Example: Let’s understand FOR LoopContinue reading “For Loop”
While Loop
While Loops can be used if we need to execute the same set of statements again and again until a condition is met. For example, if we need to print a statement 5 times, we can use while loop. Let’s try to understand with an example: Example: Let’s try to print the value of variableContinue reading “While Loop”
If Statements
Well, if statement is common across many programming languages. When we have scenario, that an action should be performed only after a condition is satisfied, we can use if statement. For example, when a person is trying to login into his gmail account, he has to give his user name and password to validate andContinue reading “If Statements”