Skip to main content

Changes from python3.5 to 3.7

From every version to version upgrade there are certain changes they will for better performance and for better results

Below are new things added in python3.7 :


1. Keywords:

        Reserved words (also called keywords) are defined with predefined meaning and syntax in the language, These keywords have to be used to develop programming instructions. These keywords can't be used as variables are function names or class names ..etc

These 2 new keywords are added in python3.7  are async and await  . These will be used in asynchronous programming you can heard these keys in using of library asyncio or using the python framework aiohttp

2. Breakpoint:

   Python breakpoint() is a new built-in function introduced in Python 3.7. Python code debugging has always been a painful process because of tight coupling between the actual code and the debugging module code

Previously in python3.5 you need to import from sys module ,but when it comes to python3.7 you need not import any module it is default imported directly you can do by call breakpoint() which will internally call pdb.set_trace()

3. Time:
   
   There 6 new functions are added to time module  .which represent the nanoseconds variants
     1. time.clock_gettime_ns()
     2. time.clock_settime_ns()
     3. time.monotonic_ns()
     4. time.perf_counter_ns()
     5. time,process_time_ns()
     6. time.time_ns()

Comments

Popular posts from this blog

CommandLine Args In Python

 Command line args in Python :      When the program comes to Python , it's all about libraries .Argparser is the library used for the taking inputs from the command line. Here you can validate the arguments which are entered by the user without writing the another function to validate from the if conditions. suppose give a filename like cmdprocess.py You can give the expecting arguments like below cmdprocess.py --help      it will give the total arguments with respective commands to represent Required =True :           When the required is true. You have to enter the argument.   Type = function name:          Type is very useful to validate the input entered by the user. so that you can send a message like user need to enter the defined arguments only. This function always expects the input argument . Custom-Exceptions In Python:    There are multiple exception...

ReplicaSet In Mongodb

Replica Set      A replica set is a group of mongod instances that host the same data set. In a replica, one node is primary node that receives all write operations. All other instances, such as secondaries, apply operations from the primary so that they have the same data set. Creating the mongod instances: First we need to create a mongod isntance using below command. before creating the instance make a directory with any name ex: db1 and give this path in the below command Use any port you want  mongod --port 20017 --dbpath C:\Users\michel\db1\ --replSet rs0 Create a another mongod isntance using the different terminal by using the same command but give different path and port number is diffferent mongod --port 20018 --dbpath C:\Users\michel\db2\ --replSet rs0 Creating the mongo shell terminals: Now use the new terminal to open mongo terminal using below command mongo --port 20017 then initiate the replica set using be...

MQTT set up Flask

 MQTT Introduction: It is message broker which holds the data when ever a consumer will connected to the topic then he will receive the data . mqtt is a machine to machine message broker, mainly used in IOT application, the default port is 1883   Installation: sudo apt-get update sudo apt-get install mosquitto Command line execution: Producer mosquitto_pub -h 127.0.0.1 -t 'topic_name' -m '{'name':'Sony'}' Subscriber mosquitto_sub -h 127.0.0.1 -t 'topic_name' -h : it is the host address -t : topic name -m : message payload QOS in MQTT: QOS(quality of services) there are mainly 3 services are available in mqtt  qos=0 qos=1 qos=2 QOS (0,0): At most once service, publisher will send a message to broker at most once, the broker passes a message to subscriber one time