X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions 01_hello/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
"""
Author : Kerim Yurtbay
Purpose: Say hello
"""

import argparse


# -------------------------------------------------
def get_args():
"""Get the command-line argument"""

parser = argparse.ArgumentParser(description="Say Hello")
parser.add_argument(
"-n", "--name", metavar="name", default="World", help="Name to greet"
)
return parser.parse_args()


# -------------------------------------------------
def main():
"""Make jazz noice here """

args = get_args()
print("Hello, " + args.name + "!")


# -------------------------------------------------
if __name__ == "__main__":
main()
72 changes: 72 additions & 0 deletions 01_hello/hello2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env python3
"""
Author : koy <koy@localhost>
Date : 2020-09-19
Purpose: Rock the Casbah
"""

import argparse


# --------------------------------------------------
def get_args():
"""Get command-line arguments"""

parser = argparse.ArgumentParser(
description='Rock the Casbah',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)

parser.add_argument('positional',
metavar='str',
help='A positional argument')

parser.add_argument('-a',
'--arg',
help='A named string argument',
metavar='str',
type=str,
default='')

parser.add_argument('-i',
'--int',
help='A named integer argument',
metavar='int',
type=int,
default=0)

parser.add_argument('-f',
'--file',
help='A readable file',
metavar='FILE',
type=argparse.FileType('rt'),
default=None)

parser.add_argument('-o',
'--on',
help='A boolean flag',
action='store_true')

return parser.parse_args()


# --------------------------------------------------
def main():
"""Make a jazz noise here"""

args = get_args()
str_arg = args.arg
int_arg = args.int
file_arg = args.file
flag_arg = args.on
pos_arg = args.positional

print(f'str_arg = "{str_arg}"')
print(f'int_arg = "{int_arg}"')
print('file_arg = "{}"'.format(file_arg.name if file_arg else ''))
print(f'flag_arg = "{flag_arg}"')
print(f'positional = "{pos_arg}"')


# --------------------------------------------------
if __name__ == '__main__':
main()
35 changes: 35 additions & 0 deletions dailygit
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# This is a daily git push request
branch=$(date +%m_%d_%Y_%M)

# change directory

echo -e "cd ~/koy/environments/\n"

# create a new branch
echo -e "git branch $branch\n"

# switch to new branch
echo -e "git checkout $branch\n"

# add recent changes to the git staing area
echo -e "git add .\n"

# provide email/name
echo -e 'git config user.email "kerimyurtbay@gmail.com"\n'
echo -e 'git config user.name "kyurt"\n'

# commit changes
echo -e "git commit\n"
echo -e "ry\n"
echo -e ":wq\n"

# push changes to remote fork
echo -e "git push origin $branch\n"

# password




X Tutup