Exemple #1
0
            f.write(
                tabulate(rows, header, tablefmt=tablefmt, colalign=col_align))
        click.echo("File saved : " + click.style(output_filename, bold=True))


@click.command(name="casparser", context_settings=CONTEXT_SETTINGS)
@click.option(
    "-o",
    "--output",
    help="Output file path",
    type=click.Path(dir_okay=False, writable=True),
)
@click.option(
    "-s",
    "--summary",
    type=click.Choice(_table_formats.keys()),
    help="Print Summary of transactions parsed.",
)
@click.option(
    "-p",
    "password",
    metavar="PASSWORD",
    prompt="Enter PDF password",
    hide_input=True,
    confirmation_prompt=False,
    help="CAS password",
)
@click.option(
    "-a",
    "--include-all",
    is_flag=True,
 def table_formats(cls) -> Sequence[str]:
     """
     Returns the names of styles for `tabulate <https://pypi.org/project/tabulate/>`_.
     """
     return _table_formats.keys()
Exemple #3
0
    def payment(self):

        def otp():
            self.email = input('Enter your email Address: ')
            number = input('Enter your mobile number: ')
            while len(number) != 10 and number not in ['7702167946']:
                number = input('Input valid mobile number: ')
            number = '+91' + number
            otp = random.randrange(1000,9999,2)
            otp = str(otp)
            message = f'Book My Cinema never calls you asking for OTP. OTP is confidential. For security reasons, do not share this OTP with anyone. Your OTP is {otp} '
            client = SinchSMS('660367af-18ff-42ca-89d2-8856dcba78dd','fijjTkW5jkuaCARwJlGnKA==')

            print("Sending '%s' to %s" % ('OTP', number))
            response = client.send_message(number, message)
            message_id = response['messageId']

            response = client.check_status(message_id)
            while response['status'] != 'Successful':
                time.sleep(1)
                response = client.check_status(message_id)

            u_otp = input('Enter the 4 digit otp: ')

            while u_otp != otp:
                u_otp = input('Enter valid 4 digit otp!!: ')

            print('OTP matched!!')

        print("\033[1;31;40m")
        result1= pyfiglet.figlet_format("Booking summary".center(0))
        print(result1)
        print("\033[1;37;40m")
        format_list = list(_table_formats.keys())
        table = [["Movie", self.movie],["Theatre", self.theatre], ["Date",self.date],["Time",self.time],["seats",self.selected_seats], ["Total", self.total]]
        print(tabulate(table, tablefmt='grid'))
        print('\033[1;31;40mAmount Payable - ' + str(self.total) + '\033[1;37;40m')

        result1= pyfiglet.figlet_format("Payment Options".center(0))
        print(result1)

        format_list = list(_table_formats.keys())
        table = [["1", "Credit/Debit card"],["2", "Mobile wallet"],["3","UPI"]]
        headers = ['Press', 'Payment method']
        print(tabulate(table, headers,tablefmt='pipe'))

        choice = input()
        while choice not in ['1', '2', '3']:
            choice = input('Enter valid payment method: ')
        clear()

        # Credit card block:
        if choice == '1':
            today = date.today()
            result1= pyfiglet.figlet_format("Credit Card".center(0))
            print(result1)
            card_num = input('Enter card number: ')
            while len(card_num) != 16:
                card_num = input('Enter valid card number!!: ')
            card_name = input('Name on the card: ')
            print('Enter expiry date: ')
            check = list(range(1, 13))
            check = [str(i) for i in check]
            month = input('Enter month: ')

            while month not in check:
                month = input('Enter valid month: ')
            month  = int(month)

            check = ['2019', '2020', '2021', '2022', '2023', '2024']
            year = input('Enter year: ')
            while year not in check:
                year = input('Enter valid year: ')

            year = int(year)

            while month <= today.month and year == today.year:
                print('Enter valid expiry date: ')
                check = list(range(1, 13))
                check = [str(i) for i in check]
                month = input('Enter month: ')

                while month not in check:
                    month = input('Enter valid month: ')
                month  = int(month)

                check = ['2019', '2020', '2021', '2022', '2023', '2024']
                year = input('Enter year: ')
                while year not in check:
                    year = input('Enter valid year: ')

                year = int(year)

            cvv = input('Enter cvv: ')
            while len(cvv) != 3:
                cvv = input('Enter cvv: ')
            clear()
            otp()
            clear()
            print("Your transaction is underway, Don't refresh: ")
            time.sleep(5)
            print('Transaction Sucessfull!!')

        # Mobile wallet block
        elif choice == '2':
            result1= pyfiglet.figlet_format("Mobile Wallet".center(0))
            print(result1)
            format_list = list(_table_formats.keys())
            table = [["1", "PayTm"],["2", "PayPal"], ["3","FreeCharge"]]
            headers = ['Press', 'Mobile wallet']
            print(tabulate(table, headers,tablefmt='pipe'))
            choice = input()
            while choice not in ['1', '2', '3']:
                choice = input('Enter valid mobile wallet: ')

            print('Redirecting...')

            time.sleep(5)
            clear()

            if choice == '1':
                result1 = pyfiglet.figlet_format("PayTm".center(40))
                print(result1)
            elif choice == '2':
                result1 = pyfiglet.figlet_format("PayPal".center(40))
                print(result1)
            elif choice == '3':
                result1 = pyfiglet.figlet_format("FreeCharge".center(40))
                print(result1)

            print(f'Book my Cinema order                          Rs {self.total}')

            choice = input('Proceed? (y/n) ').lower()
            while choice not in ['y','n','yes','no']:
                choice = input('Enter valid choice: ').lower()
            if choice in ['n', 'no']:
                return choice
            otp()
            print('Your transaction is underway, Don\'t refresh')
            time.sleep(5)
            print('Your Transaction is Sucessfull!! ')

        # UPI Block
        elif choice == '3':
            result1= pyfiglet.figlet_format("UPI".center(40))
            print(result1)

            options = ['PayTm', 'Amazon Pay','PhonePe','BHIM']
            print('Enter upi payment option ')
            upi = Texttable()
            upi.add_rows([['ID', 'Options'],['1','PayTm'],['2','Amazon Pay'],['3','PhonePe'],['4','BHIM']])
            print(upi.draw())
            upi = input()
            while upi not in ['1','2','3','4']:
                upi = input('Enter valid choice: ')
            mode = options[int(upi) - 1]
            result1 = pyfiglet.figlet_format(mode.center(40))
            print(result1)
            UPI = input('Enter UPI pin: ')
            while len(UPI) != 6:
                UPI = input('Enter valid UPI pin: ')


            print('Enter Bank ID: ')
            Bank = Texttable()
            Bank.add_rows([['ID', 'Bank'],['1','HDFC Bank'],['2','Axis Bank'],['3','SBI Bank'],['4','Yes Bank'],['5','IDFC Bank']])
            print(Bank.draw())
            bank = input()
            while bank not in ['1','2','3','4','5']:
                bank = input('Enter valid choice: ')
            otp()
            print('Your transaction is underway, Don\'t refresh')
            time.sleep(5)
            print('Your Transaction is Sucessfull!! ')
Exemple #4
0
else:
    logger.setLevel(logging.INFO)

TABLE_HEADERS = {
    "name": "Name",
    "size": "Size",
    "depth": "Depth",
    "num_of_files": "Files",
    "atime": "Access Time",
    "mtime": "Modify Time",
    "ctime": "Change Time",
}

# cli = click.Group()
SORT_BY_OPTIONS = [str(s).lower() for s in SortBy]
TABULATE_OPTIONS = ("csv",) + tuple(_table_formats.keys())
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])


def invoke_dirtools3(args):
    """Command line interface to the dirtools package."""
    # Get SortBy enum val
    try:
        sortby = next(s for s in SortBy if args.sortby.upper() == str(s))
    except StopIteration:
        sys.stderr.write("Invalid sort by option: {0}".format(sortby))
        return
    path = args.path
    precision = args.precision
    depth = args.depth
    nohuman = args.nohuman
Exemple #5
0
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np
import random
l1=range(5)
l2=range(25)
x_values=[random.choice(l1),random.choice(l1),random.choice(l1),random.choice(l1),random.choice(l1)]
y_values=[random.choice(l2),random.choice(l2),random.choice(l2),random.choice(l2),random.choice(l2)]
plt.scatter(x_values,y_values,s=10)
plt.title("",fontsize=24)
plt.xlabel("",fontsize=14)
plt.ylabel("e",fontsize=14)
plt.tick_params(axis='both',which='major',labelsize=14)
plt.show()

from tabulate import _table_formats, tabulate


format_list = list(_table_formats.keys())



table = [["spam",42], ["eggs", 451], ["bacon", 0]]
headers = ["item", "qty"]

for f in format_list:
    print("\nformat: {}\n".format(f))
    print(tabulate(table, headers, tablefmt=f))

print(chr(65))