From 5555a9323c84723786746fcfac80eb635a57bccb Mon Sep 17 00:00:00 2001 From: Abdul Moiz <33980210+progrmoiz@users.noreply.github.com> Date: Thu, 22 Aug 2019 09:50:41 +0500 Subject: [PATCH 01/14] Create FUNDING.yml --- .github/FUNDING.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..1852419 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] + From d778b8f7610fd93602a6e79a38572ef00671986f Mon Sep 17 00:00:00 2001 From: Abdul Moiz <33980210+progrmoiz@users.noreply.github.com> Date: Thu, 22 Aug 2019 09:52:15 +0500 Subject: [PATCH 02/14] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 1852419..12d9a20 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ # These are supported funding model platforms -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +github: progrmoiz From fb97cb6da5c5db7f7aa964ddbaae6c6bb8bc4e50 Mon Sep 17 00:00:00 2001 From: Saket <52213128+saket04@users.noreply.github.com> Date: Wed, 30 Sep 2020 20:36:57 +0530 Subject: [PATCH 03/14] update timer.py --- timer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timer.py b/timer.py index d2be915..07f8c39 100644 --- a/timer.py +++ b/timer.py @@ -43,7 +43,7 @@ def bestof(reps, func, *pargs, **kargs): def bestoftotal(reps1, reps2, func, *pargs, **kargs): """ - Best of totals: + It will give best of total: (best of reps1 runs of (total of reps2 runs of func)) """ return bestof(reps1, total, reps2, func, *pargs, **kargs) From 26312db6bda0899a4ed29ac0ba67f2f40421909d Mon Sep 17 00:00:00 2001 From: Amitamit789 <72153736+Amitamit789@users.noreply.github.com> Date: Wed, 30 Sep 2020 22:13:57 +0530 Subject: [PATCH 04/14] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 From fc6c3bc297f2f714db9cb8556a5aeefb0099d615 Mon Sep 17 00:00:00 2001 From: vinayduggal7 <60979457+vinayduggal7@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:51:59 +0530 Subject: [PATCH 05/14] Update listtree.py --- listtree.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 From 0019eb7c05246ffb9951679a0ac866693e7f42b3 Mon Sep 17 00:00:00 2001 From: vinayduggal7 <60979457+vinayduggal7@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:53:28 +0530 Subject: [PATCH 06/14] Update mydir.py --- mydir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mydir.py b/mydir.py index 26f70f8..4868927 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 From a48068a5f5291f3fc9378731977b3cd9a6295cb5 Mon Sep 17 00:00:00 2001 From: akshatbhatter1 <72153930+akshatbhatter1@users.noreply.github.com> Date: Thu, 1 Oct 2020 10:15:12 +0530 Subject: [PATCH 07/14] Update classtools.py --- classtools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) From 4f8f21ebbad2c8f997ec2fd6ff60a07ca15db72f Mon Sep 17 00:00:00 2001 From: kshitizkk <43603070+kshitizkk@users.noreply.github.com> Date: Thu, 1 Oct 2020 12:56:00 +0530 Subject: [PATCH 08/14] Update mydir.py --- mydir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mydir.py b/mydir.py index 26f70f8..edfa4c0 100644 --- a/mydir.py +++ b/mydir.py @@ -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__': From 62340700011cf9e45fafe0edda75a4b0d201f3cb Mon Sep 17 00:00:00 2001 From: TanmayNagdeve <55934827+TanmayNagdeve@users.noreply.github.com> Date: Thu, 1 Oct 2020 16:03:35 +0530 Subject: [PATCH 09/14] Added 3 more snippets to the list title.py, list_comprehension.py, string_split.py --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f9f4ca8..ebc0259 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ - [listtree.py](listtree.py) Trace the entire class and all its object's attrs at and above self - [mapattrs.py](mapattrs.py) Map all attributes on or inherited by an instance to the instance or class from which they are inherited. +-[title.py](title.py) The following snippet can be used to convert a string to title case. This is done using the title() method of the string class. +-[list_comprehension.py](list_comprehension.py) List comprehension provides us with an elegant way of creating lists based on other lists. +-[string_split.py](string_split.py) We can split a string into a list of substrings using the .split() method in the string class. + --- From f26a2b2bda1d226c8c17f63c7be81af61b34617a Mon Sep 17 00:00:00 2001 From: tarunmishra007 <33347581+tarunmishra007@users.noreply.github.com> Date: Fri, 2 Oct 2020 00:03:57 +0530 Subject: [PATCH 10/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9f4ca8..44ef5b4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ --- -## 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 From 5a3edb521d0414fe7046ed68a733121371a695ef Mon Sep 17 00:00:00 2001 From: Gokul2406 <67820068+Gokul2406@users.noreply.github.com> Date: Fri, 2 Oct 2020 08:53:55 +0530 Subject: [PATCH 11/14] Improved Docs --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index f9f4ca8..e50e45b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # ![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. --- From ee45bf08d7bb828d9858a2411cebb89f934d6971 Mon Sep 17 00:00:00 2001 From: Arpit045-boop <56675826+Arpit045-boop@users.noreply.github.com> Date: Sat, 3 Oct 2020 20:43:57 +0530 Subject: [PATCH 12/14] Update string_import.py --- string_import.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) From 9cb5b3a0850312620f244bee87b5efe86bd09624 Mon Sep 17 00:00:00 2001 From: Abdul Moiz <33980210+progrmoiz@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:38:28 +0500 Subject: [PATCH 13/14] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 10a3ad7..fcaacc4 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ These Snippets can make your life a lot easier than expected, use it wisely. - [listtree.py](listtree.py) Trace the entire class and all its object's attrs at and above self - [mapattrs.py](mapattrs.py) Map all attributes on or inherited by an instance to the instance or class from which they are inherited. --[title.py](title.py) The following snippet can be used to convert a string to title case. This is done using the title() method of the string class. --[list_comprehension.py](list_comprehension.py) List comprehension provides us with an elegant way of creating lists based on other lists. --[string_split.py](string_split.py) We can split a string into a list of substrings using the .split() method in the string class. +- [title.py](title.py) The following snippet can be used to convert a string to title case. This is done using the title() method of the string class. +- [list_comprehension.py](list_comprehension.py) List comprehension provides us with an elegant way of creating lists based on other lists. +- [string_split.py](string_split.py) We can split a string into a list of substrings using the .split() method in the string class. --- From 0d782f966bb6d8197dab3fc541694db5c9123c90 Mon Sep 17 00:00:00 2001 From: Abdul Moiz <33980210+progrmoiz@users.noreply.github.com> Date: Fri, 9 Oct 2020 23:17:31 +0500 Subject: [PATCH 14/14] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index fcaacc4..aa9ea9c 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,6 @@ These Snippets can make your life a lot easier than expected, use it wisely. - [listtree.py](listtree.py) Trace the entire class and all its object's attrs at and above self - [mapattrs.py](mapattrs.py) Map all attributes on or inherited by an instance to the instance or class from which they are inherited. -- [title.py](title.py) The following snippet can be used to convert a string to title case. This is done using the title() method of the string class. -- [list_comprehension.py](list_comprehension.py) List comprehension provides us with an elegant way of creating lists based on other lists. -- [string_split.py](string_split.py) We can split a string into a list of substrings using the .split() method in the string class. ---