通常来说一个模块对应一个python源码文件,可通过sys.modules查看当前python解释器可导入的模块。
In [16]: sys.modules
{...
'sys': <module 'sys' (built-in)>,
'sysconfig': ,| package set | |
| import ( | |
| "bytes" | |
| "fmt" | |
| ) | |
| type HashSet struct { | |
| m map[interface{}]bool | |
| } |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import fcntl | |
| import sys | |
| import time | |
| def lockFile(f): | |
| try: |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <definitions name="SquareService" | |
| targetNamespace="http://services.zsiserver.net:8080/SquareService" | |
| xmlns:tns="http://services.zsiserver.net:8080/SquareService" | |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
| xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | |
| xmlns="http://schemas.xmlsoap.org/wsdl/"> | |
| <message name="getSquareRequest"> | |
| <part name="x" type="xsd:double"/> | |
| </message> |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from paramiko import SSHClient, AutoAddPolicy | |
| class RemoteCMD(object): | |
| def __init__(self): | |
| self.client = None |
| <% had_seen = [] %> | |
| % for i in data: | |
| <% | |
| if i["method"] in had_seen: | |
| continue | |
| else: | |
| had_seen.append(i["method"]) | |
| %>Valid ${i["method"]} | |
| [Documentation] | |
| %for j in i["cmd"]: |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import requests | |
| from bs4 import BeautifulSoup | |
| soup = BeautifulSoup(requests.get("http://live.caipiao.163.com/jcbf/").text) | |
| # soup = BeautifulSoup(requests.get("http://live.caipiao.163.com/dcbf/").text) | |
| dd = soup.find_all("dd") |
| def read_xls(filepath, encoding="cp1251"): | |
| book = xlrd.open_workbook(filepath) | |
| for sheetid in xrange(book.nsheets): | |
| sheet = book.sheet_by_index(sheetid) | |
| if not sheet: | |
| raise RuntimeError("Sheet %i Not Found" % sheetid) | |
| continue | |
| for i in xrange(sheet.nrows): | |
| row = [""] * sheet.ncols | |
| ctys = sheet.row_types(i) |
| # Copyright 2008-2014 Nokia Solutions and Networks | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |