VEX IQ Python API
Classes | Functions
__bi Namespace Reference

Classes

class  AssertionError
 
class  bytearray
 
class  Exception
 
class  object
 

Functions

def abs (n)
 Return the absolute value of a number. More...
 
def float (n)
 Return a floating point number constructed from a number n. More...
 
def round (n, ndigits=0)
 Return the floating point value number rounded to ndigits digits after the decimal point. More...
 
def chr (n)
 Return a string of one character whose ASCII code is the integer i. More...
 
def int (n)
 Convert a float, bool or string to an int. More...
 
def str (n)
 Return a string containing a nicely printable representation of an object. More...
 
def filter (f, s)
 Constructs a new list from those elements for which function returns true. More...
 
def id (o)
 Return the “identity” integer of an object. More...
 
def len (s)
 Return the length (the number of items) of an object. More...
 
def map (f, s)
 Apply function to every item of iterable and return a list of the results. More...
 
def ord (s)
 Given a string of length one, return an integer representing the character code. More...
 
def pow (x, y)
 Return x to the power y; equivalent to using the power operator x ** y. More...
 
def range (a, b, c)
 Creates lists containing arithmetic progressions, most often used in for loops. More...
 
def type (o)
 Returns the type of an object (a number) More...
 
def ismain ()
 Returns True if called within a module being run as the main; False otherwise. More...
 

Function Documentation

◆ abs()

def __bi.abs (   n)

Return the absolute value of a number.

◆ float()

def __bi.float (   n)

Return a floating point number constructed from a number n.

Does NOT support parsing strings.

◆ round()

def __bi.round (   n,
  ndigits = 0 
)

Return the floating point value number rounded to ndigits digits after the decimal point.

If ndigits is omitted, it defaults to zero. The result is a floating point number. Values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close, rounding is done away from 0 (so. for example, round(0.5) is 1.0 and round(-0.5) is -1.0).

◆ chr()

def __bi.chr (   n)

Return a string of one character whose ASCII code is the integer i.

For example, chr(97) returns the string 'a'. This is the inverse of ord(). The argument must be in the range [0..255], inclusive; ValueError will be raised if i is outside that range.

◆ int()

def __bi.int (   n)

Convert a float, bool or string to an int.

◆ str()

def __bi.str (   n)

Return a string containing a nicely printable representation of an object.

For strings, this returns the string itself.

◆ filter()

def __bi.filter (   f,
  s 
)

Constructs a new list from those elements for which function returns true.

Parameters
ffunction returning true to include) or false to exclude an item
slist of items to filter

◆ id()

def __bi.id (   o)

Return the “identity” integer of an object.

This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value.

◆ len()

def __bi.len (   s)

Return the length (the number of items) of an object.

The argument may be a sequence (such as a string, tuple, or list) or a collection (such as a dictionary).

◆ map()

def __bi.map (   f,
  s 
)

Apply function to every item of iterable and return a list of the results.

Parameters
ffunction to apply
slist of items

◆ ord()

def __bi.ord (   s)

Given a string of length one, return an integer representing the character code.

For example, ord('a') returns the integer 97. This is the inverse of chr()

◆ pow()

def __bi.pow (   x,
  y 
)

Return x to the power y; equivalent to using the power operator x ** y.

◆ range()

def __bi.range (   a,
  b,
  c 
)

Creates lists containing arithmetic progressions, most often used in for loops.

The arguments must be plain integers. If the step argument is omitted, it defaults to 1. If the start argument is omitted, it defaults to 0. The full form returns a list of plain integers [start, start + step, start + 2 * step, ...]. If step is positive, the last element is the largest start + i * step less than stop; if step is negative, the last element is the smallest start + i * step greater than stop. step must not be zero (or else ValueError is raised). Example:

>>> range(10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> range(1, 11)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> range(0, 30, 5)
[0, 5, 10, 15, 20, 25]
>>> range(0, 10, 3)
[0, 3, 6, 9]
>>> range(0, -10, -1)
[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
>>> range(0)
[]
>>> range(1, 0)
[]

◆ type()

def __bi.type (   o)

Returns the type of an object (a number)

◆ ismain()

def __bi.ismain ( )

Returns True if called within a module being run as the main; False otherwise.