Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

there are a usefull functions and classes.

Project Description
There are usefull classes and functions.

CLASSES::

01 : File
This class operate file object.
If you want to call this class, Please write file name at argument.
After call, this class make status attribute.
The keys in status attribute, "access","path","size" and "extention".

Methods:
01 : readonly() -- return file object with read mode.
02 : writeonly(string) -- write string to file.
03 : makefile() -- make file, and return a new status attribute.
04 : overwrite(string) -- overwrite string to file.
05 : othermode(mode=None) -- return file object with other mode.
06 : writeobj(object) -- write object to file.
07 : loadobj() -- return object that loaded.
08 : overwriteobj(object) -- overwrite object to file.

02 : DictSearch
This class supporte a search method for dictionary.
If you want to call this class, Please write dictionary at argument.

Methods:
01 : findkey(string) -- search key in dictionary and return True or False.
02 : findKeyString(string) -- search key name in dictionary.
03 : findValue(string) -- search value in dictionary.


FUNCTIONS::

01 : urlanalyze(url)
Analyze url string and return result at dictionary.
This function return data.
It is "protocol", "domain", "dirs", "filename","ext" and "parameter".

02 : headeranalyze(header)
Analyze hease string return result at dictionary.

03 : dropsame(list)
Delete same item of list.

04 : todict(variable,comment=None)
Convert dictionary from variable.
variable is string or list only.
The second argument is first letter of the list elements.

exsample:
>>> list = ["#sample","path=/usr/local/bin"]
>>> todict(list,"#")
({"path":"/usr/local/bin"},["#sample"])

05 : greplist(list,string):
Find element string from list.

example:
>>> list = ["abc","def","ghi"]
>>> greplist(list,"a")
"abc"

06 : dropN(var):
Delete a "¥n" string from variable.
variable is string or list only.

07 : checktype(var,argtype=None)
Check type of variable.
if you don't input argtype, this function print type of var.

argtypes:
01 : String
02 : List
03 : Dict
04 : Int
05 : Float
06 : Unicode
07 : Tuple
08 : Func
09 : Class
10 : Method
11 : Nonetype

08 : choice(num,mode=None):
make random string.
Please input number of the string that you want to make random string.
And, the second argument is mode of this funtion.

mode:
01 : Non_symbol -- Big and small rome string, number only.
02 : Non_number -- Big and small rome string, symbol only.
03 : Only_rome -- Big and small rome string only.
04 : Only_symbol -- Symbol only.
05 : Only_number -- Number only.
06 : ALL -- Big and small rome string, symbol, number.

09 : exp(dict)
Get keys and values from dictionary.

example:
>>> dict = {"key":"sample1","key2":"sample2"}
>>> exp(dict)
(["key","key2"],["sample1","sample2"])
Release History

Release History

This version
History Node

3.7.1

History Node

3.7.0

History Node

3.6.8

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
usable-3.7.1.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source Jan 18, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting