Package gui :: Module string_conv
[hide private]
[frames] | no frames]

Module string_conv

source code

Conversion functions for python objects to GUI strings and back.

Functions [hide private]
unicode
bool_to_gui(bool)
Convert the bool into the GUI string.
source code
float
convert_to_float(string)
Method to convert a string like '1.02*1e-10' to a float variable.
source code
unicode
float_to_gui(num)
Convert the float into the GUI string.
source code
bool
gui_to_bool(string)
Convert the GUI obtained string to a bool.
source code
float or None
gui_to_float(string)
Convert the GUI obtained string to an float.
source code
int or None
gui_to_int(string)
Convert the GUI obtained string to an int.
source code
int or int list
gui_to_int_or_list(string)
Convert the GUI obtained string to a list.
source code
list
gui_to_list(string)
Convert the GUI obtained string to a list.
source code
python object
gui_to_py(string)
Super function for converting the GUI string to a Python object.
source code
str
gui_to_str(string)
Convert the GUI obtained string to a string.
source code
int or int list
gui_to_str_or_list(string)
Convert the GUI obtained string to a list.
source code
list
gui_to_tuple(string)
Convert the GUI obtained string to a tuple.
source code
unicode
int_to_gui(num)
Convert the int into the GUI string.
source code
unicode
list_to_gui(list)
Convert the list into the GUI string.
source code
float or int or str
nothing(value)
Do not convert the value.
source code
unicode
py_to_gui(value)
Super function for converting a Python object to a GUI string.
source code
unicode
str_to_gui(string)
Convert the string into the GUI string.
source code
unicode
tuple_to_gui(tuple)
Convert the tuple into the GUI string.
source code
Variables [hide private]
  status = Status()

Imports: pow, ndarray, split, Status


Function Details [hide private]

bool_to_gui(bool)

source code 

Convert the bool into the GUI string.

Parameters:
  • bool (bool) - The boolean value of True or False.
Returns: unicode
The GUI string.

convert_to_float(string)

source code 

Method to convert a string like '1.02*1e-10' to a float variable.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: float
The floating point number.

float_to_gui(num)

source code 

Convert the float into the GUI string.

Parameters:
  • num (float or None) - The number in float or None form.
Returns: unicode
The GUI string.

gui_to_bool(string)

source code 

Convert the GUI obtained string to a bool.

Parameters:
  • string (str or unicode) - The bool in string form.
Returns: bool
The bool.

gui_to_float(string)

source code 

Convert the GUI obtained string to an float.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: float or None
The float

gui_to_int(string)

source code 

Convert the GUI obtained string to an int.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: int or None
The integer

gui_to_int_or_list(string)

source code 

Convert the GUI obtained string to a list.

Parameters:
  • string (str or unicode) - The list in string form.
Returns: int or int list
The integer or list of integers.

gui_to_list(string)

source code 

Convert the GUI obtained string to a list.

Parameters:
  • string (str or unicode) - The list in string form.
Returns: list
The list.

gui_to_py(string)

source code 

Super function for converting the GUI string to a Python object.

Parameters:
  • string (str or unicode) - The Python object in string form.
Returns: python object
The value.

gui_to_str(string)

source code 

Convert the GUI obtained string to a string.

Parameters:
  • string (str or unicode) - The number in string form.
Returns: str
The string.

gui_to_str_or_list(string)

source code 

Convert the GUI obtained string to a list.

Parameters:
  • string (str or unicode) - The list in string form.
Returns: int or int list
The integer or list of integers.

gui_to_tuple(string)

source code 

Convert the GUI obtained string to a tuple.

Parameters:
  • string (str or unicode) - The list in string form.
Returns: list
The list.

int_to_gui(num)

source code 

Convert the int into the GUI string.

Parameters:
  • num (int or None) - The number in int or None form.
Returns: unicode
The GUI string.

list_to_gui(list)

source code 

Convert the list into the GUI string.

Parameters:
  • list (list or None) - The Python list.
Returns: unicode
The GUI string.

nothing(value)

source code 

Do not convert the value.

Parameters:
  • value (float or int or str) - A Python value.
Returns: float or int or str
The unmodified value.

py_to_gui(value)

source code 

Super function for converting a Python object to a GUI string.

Parameters:
  • value (anything) - The value.
Returns: unicode
The Python object in GUI string form.

str_to_gui(string)

source code 

Convert the string into the GUI string.

Parameters:
  • string (str or None) - The string or None to convert.
Returns: unicode
The GUI string.

tuple_to_gui(tuple)

source code 

Convert the tuple into the GUI string.

Parameters:
  • tuple (tuple or None) - The Python tuple.
Returns: unicode
The GUI string.