I like Pthon scripts very much, and I also like to sum up the lessons learned about Pthon scripts in my work. Next I will discuss in detail how to compile the first Pthon script in Pthon scripts, the following is a detailed description of the article.
Some scripts are written in python. These scripts are very practical, so I want to know the basic syntax of these scripts. When I first read the python script code, I felt that its syntax is similar to javascript, and it is also very good to write web scripts. In fact, his designers are also working at google. Python is also the first choice for many programmers. It should be very extensive and useful.
Here we will share with you the first program you have learned and written, hoping that it may be helpful to netizens who want to learn python. This program is used to estimate the Inductance Value of the integrated spiral inductor. Three estimation formulas are provided: wheeler, mohan, and monomial. Three inductance formats are displayed: Square, hexagonal, and octagonal inductance.
The program prototype is from the www-smirc.stanford.edu, the formula can refer to Mohan etc, "Simple Accurate ExpressionsPlanar Spiral Inductances ". The most unique aspect of a Pthon script is that it uses indentation, unlike other programs that use parentheses to identify the beginning and end of a block. "#" Is used as the annotation identifier. Import is used to call function modules. For example, commonly used sys, OS, string, and so on, such:
- import string
- import sys
-
Or
- import strng,sys
-
You can also:
- from string import split
-
For example, if you want to use the split function, use the string. split () format if you use the import string function. If you use from string import split, you must use split () to apply it.
In addition, you can use import to call custom classes. For example, if you create a class in the test. py file, you can use import test to call classes in the file. After reading the above content, I hope you will understand the Pthon script.