Read about telephone directory program in python, The latest news, videos, and discussion topics about telephone directory program in python from alibabacloud.com
#!/usr/bin/env python# coding:utf-8# xcopy Lib directory and rename all files to *d.libimport osfrom os.path import join,e Xistsimport shutilfrom Win32com.shell Import shell, shellconfrom msvcrt Import Getchroot_path = r "E:\WORKSPACE\SRC" Origlibpath = Root_path + R "\vc\lib\lib18x64" Newlibpath = Root_path + R "\libd\lib18x64" if not EXISTS (Origlibpath): Prin T ("Can ' t find original libs!") Else:if os.
This article describes how to use python to generate executable windows.ProgramAnd port it to other environments without python.
The previous article briefly introduced how to package the command line program: Windows environment, Python package the command line program.
I was going to write something. You can call TortoiseSVN to save the current code under a branch.
Unfortunately the part of calling SVN is still being researched. You write the part of the directory copy first.
If you have children's shoes that like to study python and would like to provide ideas or suggestions,
Here, thank you first. :)
As for the part of the catalog copy, the idea is simple. Read the con
工欲善其事, its prerequisite. Python is an interpreted language, but it's too cumbersome to add a python shell to execute a program under Windows. And here's what it means to convert a Python program to an EXE file. Here are some common tools , but it seems that py2exe is more wi
Run the python program and the python Program
1. Run the python program in windows
1) run the python script from the doscommand line
Use the pythoninterpreter to execute the pythonscrip
Overview of the directory structure of the HelloWorld programWe can see in the folder, the directory of the HelloWorld program mainly includes: Src folder, gen folder, Android folder, assets, res folder, Androidmanifest.xml, Default.properties. Expand the HelloWorld project on the left side of Eclipse to see a directory
custom class Allfile to save the file information, in the program only use the full path of the file, if you need to record the size of the file, time, type and other information, you can imitate code to expand.Copy the Code code as follows:
Class MyFile:
def __init__ (self):
Self.name = ""
Once you have an array of stored file information, you can also save it in XML format, the code below, which you need to import from document when you use it xm
:
if __name__ = = ' __main__ ':
folder = "/usr/local/apache/htdocs"
Filter = [". html", ". htm", ". php"]
Allfile = []
Allfile = Search (folder, filter, Allfile)
Len = Len (allfile)
Print "Found:" + str (len) + "Files"
XML = "Folder.xml"Generate (Allfile, XML)
In the Linux command line state, a file named Folder.xml can be generated by executing the Python filesearch.py.
If you want to run the
a connection error occurs, try to start IDLE in the mode of a single process. Switch to the idle directory in command line cmd and start it with idle. py-n (C: \ Python27 \ Lib \ idlelib> idle. py-n)
§ 4. IDLE debugging13. debugging in IDLE:Set a breakpoint in a line in the text: Right-click the line and choose Set breakpoint.Debug-> Debugger in the Main WindowRun the command line by Step in Debug Control. For the variables, see the following.
=====
Python programs call another Python program, and there are probably several ways to invoke it:
Here are two Python programs, assuming a.py and b.py two programs, respectively.
1, in the a.py inside call b.py inside function, have the following two kinds of situation
(1) In the same file
This blog series contains Python basics, front-end development, web frameworks, caches, and queues, hoping to provide a little help for kids who are learning to program!!!
Python Automation Basics "First article": Directory
Python Automation Basics "S
Off Topic:Python version: Latest 3.6Installation Note: Tick add path to customize the first level of installation to the hard drive directory, such as my installation path: F:\PythonCause: You can automatically add Python environment variables, automatically associate. py files, the rest of the advantages are many, such as learning Selenium, using the PIP install Selenium command to install Selenium 3, alth
Software Catalog Structure specificationDesign Directory Structure Advantages:1. High readability, can quickly understand the project2. With high maintainability and defined organizational rules, the maintainer will be able to clearly know which file and code should be placed under what directory.How directory is organizedfoo/|--bin/| |--Foo||--foo/| |--tests/| | |--__init__.py| | |--test_main.py| || |--__i
1. Principle:This program can achieve bulk access to a CSDN blog's personal information, directory and link to the corresponding, and coexist in a directory of the Mulu.txt file2. Specific code:#-*-coding:cp936-*-import urllib.request#import re#import sys#import time#import Randomimport stringheaders = {# ' U Ser-agent ': ' mozilla/5.0 (Windows; U Windows NT 6.1;
[1.os]1. Renaming: Os.rename (old, new)2. Delete: Os.remove (file)3. List the directories underFile: Os.listdir (PATH)4. Get current working directory: OS.GETCWD ()5. Change of working directory: Os.chdir (newdir)6. Create a multilevel directory: Os.makedirs (r "c:/Python/test ")7. Create a single
Because there is no root permission to use the company server, only Python can be installed in the personal folder, using the source package method of installation, here to record.1.python DownloadsCD to directory/users/w, install Python in this directory. Download the
directory print '-' * (int (dirlist[0])), DL # Print all folders and files under Directory, directory level +1
More interested in Python related content readers can view the topic: "Python File and directory Operation skills
following two points:
High readability: People who are unfamiliar with the code for this project can read the directory structure at a glance, know which program startup script is, where the test directory is, where the configuration file is, and so on. To get to know this project very quickly.
High maintainability: Once you have defined your organi
following two points:
High readability: People who are unfamiliar with the code for this project can read the directory structure at a glance, know which program startup script is, where the test directory is, where the configuration file is, and so on. To get to know this project very quickly.
High maintainability: Once you have defined your organi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.