Problems with accessing Python programs

Source: Internet
Author: User

The related technologies based on this language are developing rapidly, the number of users is expanding dramatically, and there are a lot of resources. I hope to help you develop simple python programs with vim, once you write the beginning of the program, you can proceed in sequence.

Download python, gvim, python. vim to python I installed 2.5, gvim is an editor, python. vim is an extension of vim. with vim, you can use it to edit python to highlight the syntax. If you want to automatically complete the syntax, search for it online. google is recommended ).

Install pythoh first, then vim, and gvim in Chinese after installation. I don't know why, but I am in sf.net. copy vim to the pluins directory and open the _ vimrc file in the directory. Add map <F5> at the bottom :! Next, set the system environment variable in my computer, and add the path of python.exe in the pathvariable, which is the path for installing python.

Then open gvim and enter the code. Then, enter print 'hello, wawa 'and save it as mypy. py, Press esc to exit the insert mode or Press esc. Press f5 to insert "f5" to the code. Press F5 to run your first python program. For other vim operations, google seems to have a Chinese manual.

The download path of the above three files can be found by google. I am afraid that the path will change later. My current gvim is 7.1, python is 2.5, and python. vim is searched for the python keyword in the vim project of sf.net.

 
  1. E:\cmd>pcap.py   
  2. Traceback (most recent call last):   
  3.   File "E:\cmd\pcap.py", line 3, in <module>   
  4.     import pcap   
  5.   File "E:\cmd\pcap.py", line 10, in <module>   
  6.     pc = pcap.pcap();   
  7. TypeError: 'module' object is not callable 

A socket is like a telephone plug-in. a host and a port are like a zone number and a phone number. A host: Where are you going to connect to? A port is connected from that port, just like most languages, python supports connection-oriented and connectionless connection. Connection-oriented requires connection and communication. The main connection-oriented protocol is the Transmission Control Protocol (tcp). To create a tcp socket, you must specify the socket type as SOCK_STRAM, it expresses its features as a stream socket.

No connection. As the name suggests, communication can be performed without a connection. Data arrival sequence and reliability cannot be ensured. The user data packet protocol udp is used to achieve this connection ). When creating UDP, you must specify the socket type as SOCK_DGRAM. Sorry, if you haven't finished the above, just send it... silly. Let's continue. The image control is simply loaded with a Label. The page turning process is to destroy one and then recreate one.

It should be very simple and there is no problem. It has nothing to do with global variables. It is estimated that automatic scaling cannot be performed after dragging, because many applications do not need or should not be scaled down. I tried the geometry method as well. After turning pages, the window must be in the front size and be executed every time. The last error is that geometry ('') is automatically scaled once.

As expected. However, it is strange that if you pull the window size with the mouse, it will no longer auto-scale. How can I restore auto-scale? Check that winfo_reqheight and winfo_reqwidth are the expected sizes, but they do not apply automatically to the window. The geometry method must be used. Are there other switches?

  1. How to embed Python into C ++ applications?
  2. In-depth discussion of Ruby and Python syntax comparison
  3. Introduction to Python
  4. Python Learning Experience: version, IDE selection and coding Solutions
  5. Analysis of Python GIL and thread security

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.