The shell script will find all .json files that do not have .min in the filename, and then pass the file contents to the python program.
The python program will accept the json through stdin.
| test |
| Another test |
| --------------------------------------------------------------------------- | |
| TypeError Traceback (most recent call last) | |
| c:\program files\python36\lib\site-packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) | |
| 376 try: # Python 2.7, use buffering of HTTP responses | |
| --> 377 httplib_response = conn.getresponse(buffering=True) | |
| 378 except TypeError: # Python 2.6 and older, Python 3 | |
| TypeError: getresponse() got an unexpected keyword argument 'buffering' | |
| During handling of the above exception, another exception occurred: |
| π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π©π© |
| from datetime import datetime | |
| from time import sleep | |
| def get_time(): | |
| time_left = datetime(2018,6,26,11,10,00) - datetime.now() | |
| if str(time_left)[0] == '-': | |
| print('School is over! Exiting now.') | |
| exit(0) | |
| else: | |
| return str(time_left).split('.')[0] |
| #!usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| """This program will scan through a subreddit, and check for new posts. It will check for a code combination of | |
| xxxxx-xxxxx-xxxxx-xxxxx-xxxxx, where x is a number from 0-9. It will make a comment with the post code.""" | |
| import praw # Reddit API | |
| import re # Regex API | |
| # Credit to u/admirelurk (https://www.reddit.com/user/admirelurk/) |
The shell script will find all .json files that do not have .min in the filename, and then pass the file contents to the python program.
The python program will accept the json through stdin.
| def pad_string(left: str, right: str, indent_level: int = 0, | |
| indent_characters: str = " ", line_length: int = 79, | |
| padding_character: str = " ", space_left: bool = False) -> str: | |
| """Pad a string into multiple lines. | |
| :param left: The characters to go in the first line at the left. | |
| Determines the amount of padding to add to the string. | |
| :param right: The string to go to the right. | |
| :param indent_level: The amount of levels of indent to add. (Default: 0) | |
| :param indent_characters: The characters that represent an indent |
| """Gets a formatted date-time string. Handles leap years but not leap seconds.""" | |
| def get_time_components(timestamp: int): | |
| year = 1970 | |
| month = "January" | |
| day = 1 | |
| day_of_week = "Thursday" | |
| hour = 0 | |
| hour_12 = 12 | |
| minute = 0 |
I hereby claim:
To claim this, I am signing this object: