Embedded Python Real-Time FrameWork : API  Build 20250616.1
 All Classes Namespaces Files Functions Variables Pages
pyRT.native.Constants Namespace Reference

Hard-coded constant values and useful utilities used across all native embedded modules. More...

Functions

def BuildNum
 Return Build Number and Date. More...
 
def EOM
 Return string-ified YYYYMMDD of last day of last month. More...
 
def EOMunx
 Return Unix Time() of last day of last month. More...
 
def EOY
 Return string-ified YYYYMMDD of last day of last year. More...
 
def EOYunx
 Return Unix Time() of last day of last year. More...
 
def GetObjectCounts
 Return dict of { className : count, ... More...
 
def GetObjectCounts_OBSOLETE
 
def gmt_offset
 Return number of seconds betwween GMT and localtime. More...
 
def InRange
 Check if b is between a and c. More...
 
def IsPY3
 Return True if Python 3.x. More...
 
def IsWin
 Return True if Windows. More...
 
def Nanos2Unix
 Convert Nanos since Epoch to Unix Time (double) More...
 
def PyNumObjects
 Return Number of Python Objects. More...
 
def PyRefCount
 Return object reference count. More...
 
def PyTrashSize
 Collect Garbage; Return number of objects collected. More...
 
def Unix2Millis
 Convert Unix Time (double) to Millis since Epoch. More...
 
def Unix2Nanos
 Convert Unix Time (double) to Nanos since Epoch. More...
 
def WithinRange
 Bounds check : Ensure b is between a and c. More...
 

Variables

string _CLEAR = '\033[H\033[m\033[J'
 ANSI Clear. More...
 
string _HOME = '"\033[1;1H\033[K'
 ANSI Move Cursor to ( 1,1 ) More...
 
float _MIKE = 1000000.0
 Microsecond. More...
 
float _MILLI = 1000.0
 Millisecond. More...
 
tuple _MILLISPERDAY = int( _MILLI * _SECPERDAY )
 Millis per day. More...
 
tuple _MILLISPERHOUR = int( _MILLI * 3600 )
 Millis per hour. More...
 
float _NANO = 1000000000.0
 Nanosecond. More...
 
float _NANOd = 1.0
 1.0 / _NANO More...
 
int _SECPERDAY = 86400
 Seconds per day. More...
 
int _SECPERYEAR = _SECPERDAY*365
 Seconds per year. More...
 
string _UNDEF = 'undefined'
 Undefined Value. More...
 

Detailed Description

Hard-coded constant values and useful utilities used across all native embedded modules.

Function Documentation

def pyRT.native.Constants.BuildNum ( )

Return Build Number and Date.

Returns
Build Number and Date
def pyRT.native.Constants.EOM (   b1st = True)

Return string-ified YYYYMMDD of last day of last month.

Parameters
b1st: True for 1st day of this month; False for last day of last month
Returns
string-ified YYYYMMDD of last day of last month
def pyRT.native.Constants.EOMunx (   b1st = True)

Return Unix Time() of last day of last month.

Parameters
b1st: True for 1st day of this month; False for last day of last month
Returns
Unix Time() of last day of last month
def pyRT.native.Constants.EOY (   b1st = True)

Return string-ified YYYYMMDD of last day of last year.

Parameters
b1st: True for 1st day of this year; False for last day of last year
Returns
string-ified YYYYMMDD of last day of last year
def pyRT.native.Constants.EOYunx (   b1st = True)

Return Unix Time() of last day of last year.

Parameters
b1st: True for 1st day of this year; False for last day of last year
Returns
Unix Time() of last day of last year
def pyRT.native.Constants.GetObjectCounts ( )

Return dict of { className : count, ...

}

Returns
dict of { className : count, ... }
number of objects collected
def pyRT.native.Constants.GetObjectCounts_OBSOLETE ( )
def pyRT.native.Constants.gmt_offset (   tm = None)

Return number of seconds betwween GMT and localtime.

Parameters
tm- Unix Time; None == now (Default)
Returns
Number of seconds betwween GMT and localtime
def pyRT.native.Constants.InRange (   a,
  b,
  c 
)

Check if b is between a and c.

Parameters
a- Min value
b- Value to Check
c- Max value
Returns
True if ( ( a <= b ) and ( b <= c ) )
def pyRT.native.Constants.IsPY3 ( )

Return True if Python 3.x.

Returns
True if Python 3.x
def pyRT.native.Constants.IsWin ( )

Return True if Windows.

Returns
True if Windows
def pyRT.native.Constants.Nanos2Unix (   nanos)

Convert Nanos since Epoch to Unix Time (double)

Parameters
nanos- Nanos since Epoch
Returns
Unix Time (double)
def pyRT.native.Constants.PyNumObjects ( )

Return Number of Python Objects.

Returns
Number of Python Objects
def pyRT.native.Constants.PyRefCount (   obj)

Return object reference count.

Parameters
obj- Object to interrogate
Returns
Object reference count
def pyRT.native.Constants.PyTrashSize ( )

Collect Garbage; Return number of objects collected.

Returns
number of objects collected
def pyRT.native.Constants.Unix2Millis (   unx)

Convert Unix Time (double) to Millis since Epoch.

Parameters
unx- Unix Time (double)
Returns
Millis since epoch
def pyRT.native.Constants.Unix2Nanos (   unx)

Convert Unix Time (double) to Nanos since Epoch.

Parameters
unx- Unix Time (double)
Returns
Nanos since epoch
def pyRT.native.Constants.WithinRange (   a,
  b,
  c 
)

Bounds check : Ensure b is between a and c.

Parameters
a- Min limit
b- Value to Check
c- Max limit
Returns
b between a and c

Variable Documentation

string pyRT.native.Constants._CLEAR = '\033[H\033[m\033[J'

ANSI Clear.

string pyRT.native.Constants._HOME = '"\033[1;1H\033[K'

ANSI Move Cursor to ( 1,1 )

float pyRT.native.Constants._MIKE = 1000000.0

Microsecond.

float pyRT.native.Constants._MILLI = 1000.0

Millisecond.

tuple pyRT.native.Constants._MILLISPERDAY = int( _MILLI * _SECPERDAY )

Millis per day.

tuple pyRT.native.Constants._MILLISPERHOUR = int( _MILLI * 3600 )

Millis per hour.

float pyRT.native.Constants._NANO = 1000000000.0

Nanosecond.

float pyRT.native.Constants._NANOd = 1.0

1.0 / _NANO

int pyRT.native.Constants._SECPERDAY = 86400

Seconds per day.

int pyRT.native.Constants._SECPERYEAR = _SECPERDAY*365

Seconds per year.

string pyRT.native.Constants._UNDEF = 'undefined'

Undefined Value.