[Python] How to import python file to be Object Oriented
1. Create a file was called a.py
# The local IP
LOCAL_IP = "192.168.1.17"
2. Create a main file was called main.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# html_converter version 1.0
import a
print a.LOCAL_HOSTNAME
3. Output will print 192.168.1.17
0 意見:
張貼留言