12 basic knowledge commonly used in Python programming: regular expression substitution, traversal of directory methods, list sorting by column, de-weight, dictionary ordering, dictionary, list, string reciprocal, time object manipulation, command-line argument parsing (getopt), print format output, binary conversion, Python calls system commands or scripts, and Python reads and writes files. 1. Regular expression substitution target: Replace overview.gif in string line with other string >>> line = ' >>&G T Mo=re.compile (R ' (? <=src=) "([\w+\.] +) "', Re.
1. Summary of 12 basic knowledge commonly used in Python programming
Summary: 12 basic knowledge commonly used in Python programming: regular expression substitution, traversal of directory methods, list sort by column, de-weight, dictionary sort, dictionary, list, string cross, time object operation, command line argument parsing (getopt), print format output, binary conversion, Python calls system commands or scripts, and Python reads and writes files.
2. Whether I really have nothing lyrics PHP loop to detect if a directory exists and create a loop to create a directory
Introduction: Whether I really have nothing lyrics: whether I really have nothing lyrics PHP loop to detect whether a directory exists and create a loop to create a directory: Loop Create directory method this generates the Image.gif directory copy code code as follows: $filepath = "test/upload/2010/ Image.gif "; Mk_dir ($filepath); Loop Create directory function Mk_dir ($dir, $mode = 0755) {if (Is_dir ($dir) | | @mkdir ($DIR, $mode)) return true; if
3. init.php file PHP Get the parent directory method summary for the current file
Introduction: init.php File: init.php file PHP Gets the parent directory method Summary of the current file: Method One: First get the length of the folder where the current file is located, and then use the substr to intercept the length: Copy the Code as follows: $dirName = Str_replace (" \ ","/", DirName (__file__)); $dirNameLength = strlen ($dirName); $currentDirNameLength = $dirNameLength-strrpos ($dirName, "/");
4. PHP loop to detect if the directory exists and create (Loop Create directory) _php tutorial
Summary: The PHP loop detects if a directory exists and is created (looping through the creation of directories). Loop Create Directory method this generates the Image.gif directory copy code code as follows: $filepath = "Test/upload/2010/image.gif"; Mk_dir ($filepath); Looping Create directory function Mk_di
5. PHP Batch Create file directory method _php tutorial
Introduction: PHP Batch Create file directory method. PHP Tutorial Bulk Create file directory method class newfold{var $upload _dir=date (y/m/d), if (!is_dir ($this-upload_dir)) {$this-mkdir_r ($ this-upload_dir,0777); } function Mkdir_r ($dirNam
6. PHP Traversal Directory _php Tutorial
Introduction: PHP Traversal directory. 1. [Code]php Traverse Directory Method 1. PHP myscandir function ($pathname) {glob ($pathname) as $filename) {( _dir ($filename)) {Myscandir ($filename./
7. PHP Traversal Directory method Summary, PHP calendar Summary _php Tutorial
Introduction: PHP Traversal Directory Method Summary, a summary of the PHP calendar directory. PHP Traversal Directory method Summary, PHP Calendar Summary This article summarizes the PHP traversal directory method. Share to everyone for your reference. Specific as follows: 1. Method 1 php function Myscandir ($pa
8. PHP Traversal Directory method Summary _php tutorial
Introduction: PHP Traversal Directory method Summary. PHP Traversal Directory Method Summary This article mainly introduces the PHP traversal directory method, the example summarizes two commonly used implementation techniques, has a certain reference value, needs the friend can refer to the next
9. Back to yesterday's Delete directory method
Introduction: Back to Yesterday's Delete directory method
PHP Create multi-level directory method
Introduction: We all know that using PHP mkdir to create a "a/b/c" such as a multi-level directory folder will be prompted because the directory does not exist and create a failure, but the project often encountered this need to create a multilevel directory, how to do it? Anyway mkdir is not workable, there are other ways? Of course, there are several ways to use PHP to create a multilevel directory solution. (1) In fact, you can create a multilevel directory using mkdir, but you must use this function to create a multilevel directory under PHP5. Because PHP5 to create
"Related question and answer recommendation":