Skip to content

Instantly share code, notes, and snippets.

View kenessajr's full-sized avatar
:octocat:
Working from home

Remy Muhire kenessajr

:octocat:
Working from home
View GitHub Profile
@kenessajr
kenessajr / replies.py
Created April 3, 2020 12:21 — forked from edsu/replies.py
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
@kenessajr
kenessajr / simple_calculator.py
Created September 10, 2019 09:52
Program make a simple calculator that can add, subtract, multiply and divide using functions
# Program make a simple calculator that can add, subtract, multiply and divide using functions
""" Output
Select operation.
1.Add
2.Subtract
3.Multiply
4.Divide
Enter choice(1/2/3/4): 3
@kenessajr
kenessajr / split_into_2_files.py
Created December 5, 2018 16:02 — forked from lbillingham/split_into_2_files.py
python click + pytest example
# hello.py
import click
@click.command()
@click.option(
'--name', default='world',
prompt='greet whom?',
help='who should i greet?'
)
def main(name):
@kenessajr
kenessajr / prime.py
Created June 12, 2018 09:59
Return all prime number in a given range
""" function to return if it's a prime number """
def is_prime(n):
for i in range(3, n):
if n % i == 0:
return False
return True
n_range = int(input('Enter your range '))
for n in range(2, n_range):
if is_prime(n):