This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import * | |
import os | |
import File_Folder_Flask | |
# Server startup message | |
@route("/", methods=['POST', 'GET']) | |
def home(): | |
return ( | |
"Welcome! To the homepage") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this project I am showing CPS alarm and resync feature. | |
https://www.cisco.com/c/en/us/td/docs/wireless/quantum-policy-suite/R19-4-0/CPS19-4-0SNMPAlarmsandClearingProceduresGuide/CPS13-0-0SNMPAlarmsandClearingProceduresGuide_chapter_01.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why Robot Framework?? | |
It is for acceptance testing like when we know the functionality and to check. at that time it's automation can be done using this framwork.Minimal | |
programming knowledge is required. It's keyword driven means functions are akready written only arguments needs to be given. | |
It's clean code which means different sections for each type | |
for e.g | |
*****Settings**** | |
*****Test Cases**** | |
*****Keywords****** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dictionary Methods | |
Python has a set of built-in methods that you can use on dictionaries. | |
url : https://www.w3schools.com/python/python_dictionaries.asp | |
Method Description | |
clear() ===>Removes all the elements from the dictionary e | |
copy() ====>Returns a copy of the dictionary | |
fromkeys()===>Returns a dictionary with the specified keys and values | |
get() ====>Returns the value of the specified key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to access doc string of of function. | |
Doc string for any function can be accessed using funvtion.__doc__ | |
e.g | |
>>> def my_func(): | |
... """ i am happy and i only want to use doc string""" | |
... sum = a+b | |
... print(sum) | |
... | |
>>> my_func.__doc__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def json2xml(str_json): # function to convert json to xml | |
global my_str_startswith | |
global my_str_endswith | |
global mid_str_list | |
for items in str_json: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Multiprocessing Vs Multithreading : | |
Multiprocessing is when the part of program can be executed by separated processes. | |
The cost of multiprocessing is really high. | |
MultiThreading: | |
The main program is divided into sub threads. | |
Here to decide the number of thread is a big challenge , taking more number of threads can deduce ur latency since | |
thread concurrency has limit , after a limit it slows down the process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you are using python 2, then you can add a comma after the print function like this: | |
for i in range(10): | |
print i, # <- notice the comma at the end | |
will output: | |
0 1 2 3 4 5 6 7 8 9 | |
In python 3, print is now a function and will take an argument, called end like this: | |
print(i, end = " ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON - Python has a JSON module that will help converting the datastructures to JSON strings. | |
Use the import function to import the JSON module. | |
import json | |
student = {"101":{"class":'V', "Name":'Rohit', "Roll_no":7}, | |
"102":{"class":'V', "Name":'David', "Roll_no":8}, | |
"103":{"class":'V', "Name":'Samiya', "Roll_no":12}} | |
print(json.dumps(student)); | |
Output: | |
{"103": {"class": "V", "Name": "Samiya", "Roll_no": 12}, | |
"102": {"class": "V", "Name": "David", "Roll_no": 8}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.youtube.com/watch?v=4ht22ReBjno | |
https://www.youtube.com/watch?v=TvnZTi_gaNc | |
https://www.youtube.com/watch?v=lcQfQRDAMpQ |
NewerOlder