Created
October 31, 2020 13:57
-
-
Save Kienyew/3ee127308185099806680c2bcb185a34 to your computer and use it in GitHub Desktop.
My Interactive Python startup script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import itertools | |
import collections | |
import subprocess | |
import random | |
import bisect | |
from math import * | |
from fractions import Fraction | |
from pathlib import Path | |
import pprint | |
import re | |
import cmath | |
import struct | |
import time | |
import datetime | |
import decimal | |
from decimal import Decimal | |
from os import chdir as cd | |
import functools | |
import math | |
import pathlib | |
import string | |
import typing | |
from typing import * | |
import statistics | |
from collections import Counter | |
import unicodedata | |
import json | |
class __: | |
def __iter__(self): | |
yield from sorted(os.listdir('.')) | |
def __str__(self): | |
return str(list(self)) | |
def __repr__(self): | |
return pprint.pformat(list(self)) | |
def __getitem__(self, index): | |
return pathlib.Path(list(self)[index]) | |
def __call__(self, path): | |
if Path(path).is_dir(): | |
return list(Path(path).glob('*')) | |
else: | |
return [Path(path)] | |
l = ll = ls = __() | |
P = Path | |
del __ | |
lmap = lambda f, it: list(map(f, it)) | |
lfilter = lambda f, it: list(filter(f, it)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment