diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 4c41aad..2272a81 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -8,11 +8,11 @@ In the interest of fostering an open and welcoming environment, we as contributo Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +* Using welcoming and inclusive language. +* Being respectful of differing viewpoints and experiences. +* Gracefully accepting constructive criticism. +* Focusing on what is best for the community. +* Showing empathy towards other community members. Examples of unacceptable behavior by participants include: @@ -28,19 +28,20 @@ Project maintainers are responsible for clarifying the standards of acceptable b Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. -## Scope +##Our Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. -## Enforcement +##Our Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at progrmoiz@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. -## Attribution +##Our Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]. [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ +Read carefully diff --git a/README.md b/README.md index f9f4ca8..aa9ea9c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # ![Python Snippets](./logo.png "Python Snippets") - -:snake: Python snippets of examples, to learn things and to make task easier. +These Snippets can make your life a lot easier than expected, use it wisely. --- -## Snippets +## Snippets TO LEARN - [string_import.py](string_import.py) example to show import module from string - [classtools.py](classtools.py) assorted class utilities and tools @@ -27,6 +26,7 @@ - [mapattrs.py](mapattrs.py) Map all attributes on or inherited by an instance to the instance or class from which they are inherited. + --- ## Contributing diff --git a/classtools.py b/classtools.py index f3d8a79..5ee0436 100644 --- a/classtools.py +++ b/classtools.py @@ -32,5 +32,4 @@ class SubTest(TopTest): pass X, Y = TopTest(), SubTest() - print(X) - print(Y) + print(X,"\n",y) diff --git a/listtree.py b/listtree.py index b1874b4..48507b1 100644 --- a/listtree.py +++ b/listtree.py @@ -51,22 +51,17 @@ def __str__(self): def tester(listerclass, sept=False): - class Super: - - def __init__(self): + def __init__(self): self.data1 = 'spam' - - def ham(self): + def ham(self): pass class Sub(Super, listerclass): - def __init__(self): Super.__init__(self) self.data2 = 'eggs' self.data3 = 42 - def spam(self): pass diff --git a/mydir.py b/mydir.py index 26f70f8..0ddd9ae 100644 --- a/mydir.py +++ b/mydir.py @@ -1,6 +1,6 @@ #!python """ -mydir.py: a module that lists the namespaces of other module +mydir.py: a module that list the namespaces of other modules """ from __future__ import print_function @@ -25,7 +25,7 @@ def listing(module, verbose=True): if verbose: print(sepline) - print(module.__name__, 'has %d names' % count) + print(module.__name__, 'has following %d names' % count) print(sepline) if __name__ == '__main__': diff --git a/string_import.py b/string_import.py index b70439d..fdd3d87 100644 --- a/string_import.py +++ b/string_import.py @@ -1,12 +1,12 @@ # you can use builtin __import__ function -modname = 'string' +modname = 'strings' string = __import__(modname) -print(string) +print(strings) # Python official prefferred way import importlib -modname = 'string' -string = importlib.import_module(modname) -print(string) +modname = 'strings' +strings = importlib.import_module(modname) +print(strings)