RX7 Module
Project description
rx7 Module - Written By Ramin RX7
rx7 Module is here to help you make your code shorter!
(Most) Usefull function and methods are collected.
List of Functions:
p() | print() function. (Read Doc String) |
re(F_Name,n) | Repeat F_Name function for n times. |
rev(v) | Reverse v and returns it. (Everything like str,list,int) |
read(file) | Return content of the file. |
write(file,mode,text) | Write things you want in file content. (Read Doc String) |
wait(n) | Stop code executing for n seconds |
cls() | It Clears the Terminal |
progressbar() | In-App Progressbar. (Read Doc String) |
string(Frst_L,Lst_L) | Return string from Frst_L to Lst_L (Read Doc String) |
force(tpl,*var) | Return tpl with adding var(s) to it. |
erase(tpl,*var) | Return tpl with removing var(s) from it. |
replace(tpl,var,ind) | Replace tpl[ind] with var |
insert(tpl,var,ind) | Set tpl[ind] to var. (Note that tpl[ind] will be tpl[ind+1]) |
List of Classes:
Class rand: Random Variable Generator Class.
choice(iter) | Choose random item from iterable or string. |
integer(Frst,Lst) | Choose integer in range [Frst,Lst] |
O1(decimal_nom=17) | Return x in interval [0,1) |
number(Frst,Lst) | Return x in interval [Frst,Lst] |
Class system: Some system actions.
accname() |
return account username you have logged in.
|
pid() |
Get pid number of terminal and return it.
|
disk_usage(path) | ######## |
chdir | Change directory of terminal. |
SHUT_DOWN() | Shut Down the PC. |
RESTART() | Restart the PC. |
Class file: Actions and information about files.
__init__(self,path) | if path exists: self.size - self.abspath - self.acstime - self.mdftime - self.content |
size(path) |
Return size of the file in byte(s). Also work on directories.
|
delete(path) |
Use this to delete a file (Not folder).
|
delete_dir(path) |
Use this to delete folders.
|
rename(path) |
Rename files with this function.
|
abspath(path) |
Return absolute path of given path.
|
exists(path) | Return Boolean. If exists True, else: False |
mdftime(path) |
Get last modify time of the file.
|
acstime(path) |
Get last access time of the file.
|
move(src,dst) | Move file from src to dst. (Read Doc String of copy func) |
copy(src,dst) | Copy file from src to dst. (Also you can use it as rename) |
copydir(src,dst) |
Same as copy function except that it's for folders.
|
hide(path) | Hide given path. (It can be file or directory.) |
read_only(path,mode=True) | Make file or folder read-only. (Read Doc String) |
read(path) (v1.3) | Return content of the path |
write(path,text='',...) (v1.3) | Same as write function. |
Class style: Changing text Color,BG & Style. (Read Doc String)
print(txt,clr,BG,style,end) |
Print txt with selected color,BG,style.(Read Doc String) |
integer(Frst,Lst) | Choose integer in range [Frst,Lst] |
Class record: Record time of a certain actions. (Read Doc String)
__init__() | Set Start Time. |
self.stop() (v1.5.0) | Stops Recording (You can not lap anymore) |
self.lap() (v1.5.0) | Rreturn time between start time and self.lap()Also add that time to self.laps |
self.laps (v1.5.0) | A list that contains all laps you have done |
Recommended to:
- Using an IDE that shows Function and Class Help is highly recommended. (VS Code)
- Using "from rx7 import ."
- Using "import rx7 as rx"
Upgrade:
pip install --upgrade rx7 |
Versions Information:
Releases are like this: 1.0.0
1.1.1
â‹®
1.2.0
First number is very important bacause it's for Big new features and changes.
Second number is not important as first but it contains small changes.
But 3rd number is not important because it's for changing packege codes order and you won't lose anything if you don't install it.
Numbers are not always in order like: 1,2,3,4,... , Some times they are different like: 1.2.4.8,...
Releases:
(+ for new features, * for changes)
Version | Release Date | New Features & Changes |
1.0.0 | 03/18/2020 | #### |
1.3.0 | 04/08/2020 |
* Prgoressbar default args
+ __init__ & read & write & content func of file class
|
1.5.0 | 04/21/2020 |
'replace' and insert 'functions' for tuples
* style.text => style.print
+ 'end' arg for style.print()
* record.stop => record.lap
now 'record.stop()' will stop recording.
+ 'self.laps' in record class will display all laps
|
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.