No project description provided
Project description
Count unique characters
This package allows you to protect the unique characters that it receives at the entrance. Works with files and strings.
Getting started
The program receives files as input, processes them and passes them to the script.
parser.add_argument('--word', help='Enter the string')
parser.add_argument('--file', type=argparse.FileType('r'))
arguments = parser.parse_args()
Function run_function
The function receives an object as an input and determines the type, transfers the data to a specific function.
args - object witch is the result of parser.parse_args()
Returns the number of unique characters
Function count_letter
Counts unique letters from given string. To speed up the work, the function has a cache, which, in case of repetition of input data, returns a ready value.
_word - input string _
Returns the number of unique characters
Function count_letter_in_file
Function read string from file
_file -input file objects _
Returns the result of function count_letter or None, when file is not valid \ No newline at end of file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file unique_variable-1.1.tar.gz
.
File metadata
- Download URL: unique_variable-1.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee0e2172ce6515f16e554d14ece3aa2b648c835ab1527ffb339657e8d6bfce5b |
|
MD5 | 18c64cf038d923a0aeac0d546c7f7514 |
|
BLAKE2b-256 | 6a44a15c74cbeebc71115b4a0951fe573883a18f1ce82adf53c9785689b3b1ef |