示例#1
0
from numpy import generic as npscalar
from numpy import ndarray as nparray
from sys import version_info as pyver
from sys import platform as sysplatform
from os import name as osname

isposix = osname == 'posix'
isnt = osname == 'nt'
islinux = sysplatform.startswith('linux')
iswin = sysplatform.startswith('win')

if isposix:
    tmpdir = "/tmp/"
else:
    from os import getenv as tmpdir
    tmpdir = tmpdir('TEMP') + '\\'

ispy3 = pyver > (3, )
ispy2 = pyver < (3, )

# __builtins__ is dict
try:
    has_long = 'long' in __builtins__  #.__dict__.keys()
    has_unicode = 'unicode' in __builtins__  #.__dict__.keys()
    has_basestring = 'basestring' in __builtins__  #.__dict__.keys()
    has_bytes = 'bytes' in __builtins__  #.__dict__.keys()
    has_buffer = 'buffer' in __builtins__  #.__dict__.keys()
    has_xrange = 'xrange' in __builtins__  #.__dict__.keys()
except:
    has_long = 'long' in __builtins__.__dict__.keys()
    has_unicode = 'unicode' in __builtins__.__dict__.keys()
示例#2
0
from numpy import ndarray as nparray
from sys import version_info as pyver
from sys import platform as platform
from os import name as osname


isposix = osname == 'posix'
isnt = osname == 'nt'
islinux = platform.startswith('linux')
iswin = platform.startswith('win')

if isposix:
    tmpdir = "/tmp/"
else:
    from os import getenv as tmpdir
    tmpdir = tmpdir('TEMP')+'\\'

ispy3 = pyver > (3,)
ispy2 = pyver < (3,)

# __builtins__ is dict
try:
    has_long = 'long' in __builtins__#.__dict__.keys()
    has_unicode = 'unicode' in __builtins__#.__dict__.keys()
    has_basestring = 'basestring' in __builtins__#.__dict__.keys()
    has_bytes = 'bytes' in __builtins__#.__dict__.keys()
    has_buffer = 'buffer' in __builtins__#.__dict__.keys()
    has_xrange = 'xrange' in __builtins__#.__dict__.keys()
except:
    has_long = 'long' in __builtins__.__dict__.keys()
    has_unicode = 'unicode' in __builtins__.__dict__.keys()