From 3e57f435ca535f8c1be1fc5cf2cc255a6a9d41b8 Mon Sep 17 00:00:00 2001 From: thanapoom21 Date: Sun, 9 Jan 2022 15:15:08 -0800 Subject: [PATCH] Remove old .py files and add tweepy-bots project --- LICENSE | 21 --------------- binary_search.py | 32 ----------------------- dictionary.py | 30 ---------------------- linear_search.py | 23 ----------------- lists.py | 50 ------------------------------------ tuples.py | 41 ----------------------------- tweepy-bots/requirements.txt | 8 ++++++ 7 files changed, 8 insertions(+), 197 deletions(-) delete mode 100644 LICENSE delete mode 100644 binary_search.py delete mode 100644 dictionary.py delete mode 100644 linear_search.py delete mode 100644 lists.py delete mode 100644 tuples.py create mode 100644 tweepy-bots/requirements.txt diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 46382ee..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Music - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/binary_search.py b/binary_search.py deleted file mode 100644 index c163392..0000000 --- a/binary_search.py +++ /dev/null @@ -1,32 +0,0 @@ -def binary_search(list, target): - first = 0 - last = len(list) - 1 - - while first <= last: - midpoint = (first + last) // 2 - - if list[midpoint] == target: - return midpoint - elif list[midpoint] < target: - first = midpoint + 1 - else: - last = midpoint - 1 - return None - - -def verify(index, target): - if index is not None: - print(target, " is found at index: ", index) - else: - print(target, " is not found in the list") - - -one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -result = binary_search(one_to_ten, 12) - -verify(result, 12) - -existed_result = binary_search(one_to_ten, 2) - -verify(existed_result, 2) diff --git a/dictionary.py b/dictionary.py deleted file mode 100644 index 27a5223..0000000 --- a/dictionary.py +++ /dev/null @@ -1,30 +0,0 @@ -# Dictionary: Key-value pairs, unordered, mutable. - -person = {"name": "Payet", "age": 30, "city": "Marseille"} -# print(person) - -# if "name" in person: -# print(person["name"]) - -# try: -# print(person["age"]) -# except: -# print("Error") - -# for key in person: -# print(key) - -# for key, value in person.items(): -# print(key, value) - -person_copy = person - -person_copy2 = person.copy() - -person_copy3 = dict(person) - -person_copy["email"] = "payetdimitri@gmail.com" -print(person_copy) -print(person_copy2) -print(person_copy3) -print(person) diff --git a/linear_search.py b/linear_search.py deleted file mode 100644 index e098470..0000000 --- a/linear_search.py +++ /dev/null @@ -1,23 +0,0 @@ -def linear_search(list, target): - """ - Returns the index position of the target if found, else returns None - """ - - for i in range(0, len(list)): - if list[i] == target: - return i - return None - - -def verify(index): - if index is not None: - print("Target is found at index: ", index) - else: - print("Target is not found in the list") - - -one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -result = linear_search(one_to_ten, 2) - -verify(result) diff --git a/lists.py b/lists.py deleted file mode 100644 index 0fcdd9a..0000000 --- a/lists.py +++ /dev/null @@ -1,50 +0,0 @@ -# Lists: ordered, mutable, allows duplicate elements -fruits = ["banana", "cherry", "apple"] - -print(fruits) - -fruits_copy1 = fruits # this refers to the same list - -# when the copied list is mutated, the original will also be changed. -fruits_copy1.append("durian") - -fruits_copy2 = fruits.copy() - -fruits_copy2.append("elderberry") - -fruits_copy3 = list(fruits) - -print(fruits) -print(fruits_copy1) -print(fruits_copy2) -print(fruits_copy3) - -for fruit in fruits: - print(fruit) - -if "banana" in fruits: - print("yes") -else: - print("no") - - -nums = [1, 2, 3, 4, 5, 6, 7, 8, 9] - -print(nums[1:5]) # start index and stop index // [2, 3, 4, 5] - -print(nums[5::1]) # double colon means optional index - -print(nums[0::1]) # this will start from the first item the last item - -print(nums[::1]) # this will start from the first item the last item - -print(nums[::2]) # this will take every second items [1,3,5,7,9] - -print(nums[::-1]) - -num_list = [3, 6, 9, 12, 15, 18, 21] - -squared_num_list = [x * x for x in num_list] - -print(num_list) -print(squared_num_list) diff --git a/tuples.py b/tuples.py deleted file mode 100644 index 8c43f45..0000000 --- a/tuples.py +++ /dev/null @@ -1,41 +0,0 @@ -import sys -import timeit -# Tuple: ordered, immutable, allows duplicate elements -mytuple = tuple(["Thanapoom", 32, "Las Vegas"]) -print(mytuple) - -item = mytuple[1] - -for x in mytuple: - print(x) - -if "Thanapoom" in mytuple: - print("Yes") -else: - print("No") - -tu = (1, 2, 3, 4, 5, 6, 7, 8, 9) - -ple = tu[3:8] -ple2 = tu[::-1] -ple3 = tu[::2] -# print(ple) -# print(ple2) -# print(ple3) - -numbers_in_tuple = (2, 4, 6, 8, 10) -# (*) with a variable will combine elements in between and put in a list. -n1, *n2, n3 = numbers_in_tuple -# print(n1) -# print(n2) -# print(n3) - -# One advantage of using a tuple is its size is smaller compared to a list with the same elements. -a_list = [0, 1, 2, 3, "google", True] -a_tuple = (0, 1, 2, 3, "google", True) - -print(sys.getsizeof(a_list), "bytes") -print(sys.getsizeof(a_tuple), "bytes") - -print(timeit.timeit(stmt="[0,1,2,3,4,5]", number=1000000)) -print(timeit.timeit(stmt="(0,1,2,3,4,5)", number=1000000)) diff --git a/tweepy-bots/requirements.txt b/tweepy-bots/requirements.txt new file mode 100644 index 0000000..5b34eed --- /dev/null +++ b/tweepy-bots/requirements.txt @@ -0,0 +1,8 @@ +certifi==2021.10.8 +charset-normalizer==2.0.10 +idna==3.3 +oauthlib==3.1.1 +requests==2.27.1 +requests-oauthlib==1.3.0 +tweepy==4.4.0 +urllib3==1.26.8