Admire twisted's zookeeper

Source: Internet
Author: User
Admire twisted's zookeeper


Twisted contains a server that can be written in Python as the tool for running daemon, which has encountered some problems in recent debugging. Although it cannot be clearly described at the moment, it is for your reference.

In a system containing gcc4.x, this twistd runs normally. However, if gcc3.x is contained (for example, gcc3.4.6), the failure of importing other modules in the same path will occur and an importerror exception will be reported. This is very common in many centos, but there is no problem in comparing the new versions of Ubuntu and debian4.0.

Of course, there is a solution to the fault of zookeeper. That is, add the on-card path to SYS. Path to force the system to find other modules in the current path.CodeAs follows:

Import sys

Curpath = OS. Path. normpath (OS. Path. Join (OS. getcwd (), OS. Path. dirname (_ file __)))
SYS. Path. append (curpath)

After the code, you can import other modules in the current path.

Meeting.
 

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.