12 Şubat 2013 Salı

strnum 3.1

To contact us Click HERE

strnum Functions for conversions involving strings; interactive text input; miscellaneous operations

strnum is a Python library that fills a number of 'holes' in pure Python by defining a series of regular expressions and functions organized as follows:

Section 1: Regular Expressions for testing whether a string contains the representation of a number of any of several types.

Section 2: Functions for testing and classifying the contents of strings.

Section 3: A series of functions for reading interactive input. These functions read integers, floats, and strings, and bools from standard input, with error checking being performed on the input and substitution of an optional default value if the input is null. These functions check for the special input strings 'q', 'quit', and 'exit', terminating the program if the input is an exact match to any of these.

Section 4: Two functions for doing pretty formatting of text output.

Section 5: Functions for performing conversions:

str2int, str2lint, and str2ints convert a string to an int or list of ints.
str2num, str2lnum, and str2nums convert a string to a float or list of floats.

These functions differ from Python's built-in int and float in several ways:

They treat all non-numeric characters as delimiters.

str2int and str2lint allow an integer to be terminated with a decimal point, and allow exponents (e.g., str2int('3e3') returns 3000).

When given invalid input, these functions return None instead of throwing an exception.

str2ints and str2nums accept a string containing a Matlab-style row-vector description to a list of ints or list of floats.

str2num and str2lnum accept the input values 'NaN' and 'nan'.

The function num2str convert a number (int or float) to a string with a specified number of digits of precision.

The function `tokenize` is similar to Python's builtin string `split` method, but respects quoted strings.

The function `str2dict` converts a string containing key-value pairs to a Python dictionary.

Section 6: Functions for getting the current date in string format, the current time in string format, the second of the day as an integer, and the second of the month as an integer.


Product's homepage

Requirements:



· Python


Download strnum 3.1 Free
Tags: interactive text input   , miscellaneous operations   , Python library   , string   , conversions   , interactive   ,
functions, string, input, number, python, list, convert, float, function, int, accept, integer, regular expressions, convert string, string containing, containing, input functions, strings, str2lint, str2nums, current, allow, format, second, accept string containing

Hiç yorum yok:

Yorum Gönder