├── CNAME
├── AddToSendTo
├── requirements.txt
├── README.md
└── add_to_sendTo.py
├── _config.yml
├── favicon.ico
├── open_folder.py
├── folder-maker.py
├── shortcut.py
├── RPSLS
├── README.md
└── RPSLS.py
├── LICENSE
├── README.md
├── SetToStartup
├── README.md
└── set_to_startup.py
├── AddToTaskabr
└── AddToTaskbar.py
├── _layouts
└── default.html
└── CONTRIBUTE.md
/CNAME:
--------------------------------------------------------------------------------
1 | pyscripts.aashutosh.dev
--------------------------------------------------------------------------------
/AddToSendTo/requirements.txt:
--------------------------------------------------------------------------------
1 | winshell
2 | pypiwin32
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
2 | title: Python Scripts and Games
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aashutoshrathi/py-scripts/HEAD/favicon.ico
--------------------------------------------------------------------------------
/open_folder.py:
--------------------------------------------------------------------------------
1 | import os
2 | import time
3 | newpath = os.path.join('D:', 'Study', 'Codes', time.strftime("%B %y"))
4 | os.startfile(newpath)
--------------------------------------------------------------------------------
/folder-maker.py:
--------------------------------------------------------------------------------
1 | import os
2 | import time
3 | newpath = os.path.join('D:', 'Study', 'Codes', time.strftime("%B %y"))
4 | print(newpath)
5 | if not os.path.exists(newpath):
6 | os.makedirs(newpath)
7 |
--------------------------------------------------------------------------------
/shortcut.py:
--------------------------------------------------------------------------------
1 | import os, winshell
2 | from win32com.client import Dispatch
3 |
4 | desktop = winshell.desktop()
5 | path = os.path.join(desktop, "Media Player Classic.lnk")
6 | target = r"D:\Study\Codes\July 17\Battleship.py"
7 | wDir = r"D:\Study\Codes\July 17"
8 | icon = r"D:\Study\Codes\July 17\Battleship.py"
9 |
10 | shell = Dispatch('WScript.Shell')
11 | shortcut = shell.CreateShortCut(path)
12 | shortcut.Targetpath = target
13 | shortcut.WorkingDirectory = wDir
14 | shortcut.IconLocation = icon
15 | shortcut.save()
--------------------------------------------------------------------------------
/RPSLS/README.md:
--------------------------------------------------------------------------------
1 | ## RPSLS
2 | [
](#)
3 | [](https://forthebadge.com)
4 |
5 | Rock, Paper, Scissor, Lizard, Spock for you, now in you Terminal / Bash.
6 |
7 |
8 | ## How it Works ?
9 | 
10 |
11 |
12 |
Made with ❤ by Aashutosh Rathi
13 | -------------------------------------------------------------------------------- /AddToSendTo/README.md: -------------------------------------------------------------------------------- 1 | ## AddToSendTo 2 | [Made with ❤ by Aashutosh Rathi
23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Aashutosh Rathi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Python Scripts 📜 and Games 🎲 2 | [Made with ❤ by Aashutosh Rathi
17 | -------------------------------------------------------------------------------- /SetToStartup/README.md: -------------------------------------------------------------------------------- 1 | ## SetToStartup 2 | [Made with ❤ by Aashutosh Rathi
30 | -------------------------------------------------------------------------------- /AddToSendTo/add_to_sendTo.py: -------------------------------------------------------------------------------- 1 | """ 2 | Scripts written By : Aashutosh Rathi 3 | Credits : Stack Overflow and Me. 4 | """ 5 | 6 | 7 | import os 8 | import time 9 | import winshell 10 | import shutil 11 | from win32com.client import Dispatch 12 | 13 | 14 | def remove_quotes(string): 15 | """ 16 | This function is used here to remove quotes from 17 | paths used in this script. 18 | 19 | :param string: Path with quotes. 20 | :return: Path without quotes. 21 | """ 22 | if string.startswith('"'): 23 | string = string[1:] 24 | 25 | if string.endswith('"'): 26 | string = string[:-1] 27 | return string 28 | 29 | 30 | def find_symbol(path): 31 | for x in range(len(path)-1): 32 | if path[x] == "\\": 33 | result = x 34 | return result 35 | 36 | 37 | def make_working_dir(file_path): 38 | sym = find_symbol(file_path) 39 | return file_path[:sym] 40 | 41 | 42 | def make_shortcut(file_path, dir_path, name): 43 | you = os.getlogin() 44 | startup = os.path.join('C:\\Users', you, 'AppData', 'Roaming', 45 | 'Microsoft', 'Windows', 'SendTo') 46 | name = name + '.lnk' 47 | path = os.path.join(startup, name) 48 | shell = Dispatch('WScript.Shell') 49 | shortcut = shell.CreateShortCut(path) 50 | shortcut.Targetpath = file_path 51 | shortcut.WorkingDirectory = dir_path 52 | shortcut.IconLocation = file_path 53 | shortcut.save() 54 | 55 | 56 | def main(): 57 | print("\n===== Add Your files or Folders to SendTo in easy way =====") 58 | you = os.getlogin() 59 | print('Hey!', you) 60 | file = input('Path of folder to be added to SendTo : ') 61 | workingDir = make_working_dir(file) 62 | file = remove_quotes(file) 63 | workingDir = remove_quotes(workingDir) 64 | name = input('Folder Name : ') 65 | make_shortcut(file, workingDir, name) 66 | print(name, 'added to SendTo Successfully !!') 67 | 68 | 69 | if __name__ == '__main__': 70 | main() 71 | -------------------------------------------------------------------------------- /SetToStartup/set_to_startup.py: -------------------------------------------------------------------------------- 1 | """ 2 | Scripts written By : Aashutosh Rathi 3 | Credits : Stack Overflow and Me . 4 | 5 | """ 6 | 7 | 8 | import os 9 | import time 10 | import winshell 11 | import shutil 12 | from win32com.client import Dispatch 13 | 14 | 15 | def remove_quotes(string): 16 | """ 17 | This function is used here to remove quotes from 18 | paths used in this script. 19 | 20 | :param string: Path with quotes. 21 | :return: Path without quotes. 22 | """ 23 | if string.startswith('"'): 24 | string = string[1:] 25 | 26 | if string.endswith('"'): 27 | string = string[:-1] 28 | return string 29 | 30 | 31 | def find_symbol(path): 32 | for x in range(len(path)-1): 33 | if path[x] == "\\": 34 | result = x 35 | return result 36 | 37 | 38 | def make_working_dir(file_path): 39 | sym = find_symbol(file_path) 40 | return file_path[:sym] 41 | 42 | 43 | def make_shortcut(file_path, dir_path, name): 44 | you = os.getlogin() 45 | startup = os.path.join('C:\\Users', you, 'AppData', 'Roaming', 46 | 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup') 47 | name = name + '.lnk' 48 | path = os.path.join(startup, name) 49 | shell = Dispatch('WScript.Shell') 50 | shortcut = shell.CreateShortCut(path) 51 | shortcut.Targetpath = file_path 52 | shortcut.WorkingDirectory = dir_path 53 | shortcut.IconLocation = file_path 54 | shortcut.save() 55 | 56 | 57 | def main(): 58 | print("\n===== Add Your files or Folders to startup in easy way =====") 59 | you = os.getlogin() 60 | print('Hey!', you) 61 | file = input('Path of file to be added to startup : ') 62 | workingDir = make_working_dir(file) 63 | file = remove_quotes(file) 64 | workingDir = remove_quotes(workingDir) 65 | name = input('Name your Shortcut : ') 66 | make_shortcut(file, workingDir, name) 67 | print(name, 'added to Startup Successfully !!') 68 | 69 | 70 | if __name__ == '__main__': 71 | main() 72 | -------------------------------------------------------------------------------- /AddToTaskabr/AddToTaskbar.py: -------------------------------------------------------------------------------- 1 | """ 2 | Scripts written By : Aashutosh Rathi 3 | Credits : Stack Overflow and Me. 4 | """ 5 | 6 | 7 | import os 8 | import time 9 | import winshell 10 | import shutil 11 | from win32com.client import Dispatch 12 | 13 | 14 | def remove_quotes(string): 15 | """ 16 | This function is used here to remove quotes from 17 | paths used in this script. 18 | 19 | :param string: Path with quotes. 20 | :return: Path without quotes. 21 | """ 22 | if string.startswith('"'): 23 | string = string[1:] 24 | 25 | if string.endswith('"'): 26 | string = string[:-1] 27 | return string 28 | 29 | 30 | def find_symbol(path): 31 | for x in range(len(path)-1): 32 | if path[x] == "\\": 33 | result = x 34 | return result 35 | 36 | 37 | def make_working_dir(file_path): 38 | sym = find_symbol(file_path) 39 | return file_path[:sym] 40 | 41 | 42 | def addToTaskbar(file_path, dir_path, name): 43 | you = os.getlogin() 44 | startup = os.path.join('C:\\Users', you, 'AppData', 'Roaming', 45 | 'Microsoft', 'Internet Explorer', 'Quick Launch', 46 | 'User Pinned', 'TaskBar') 47 | name = name + '.lnk' 48 | path = os.path.join(startup, name) 49 | shell = Dispatch('WScript.Shell') 50 | shortcut = shell.CreateShortCut(path) 51 | shortcut.Targetpath = file_path 52 | shortcut.WorkingDirectory = dir_path 53 | shortcut.IconLocation = file_path 54 | shortcut.save() 55 | 56 | 57 | def main(): 58 | print("\n===== Add Your files or Folders to Taskbar in easy way =====") 59 | you = os.getlogin() 60 | print('Hey!', you) 61 | file = input('Path of folder to be added to SendTo : ') 62 | workingDir = make_working_dir(file) 63 | file = remove_quotes(file) 64 | workingDir = remove_quotes(workingDir) 65 | name = input('File/Folder Name : ') 66 | addToTaskbar(file, workingDir, name) 67 | print(name, 'added to SendTo Successfully !!') 68 | 69 | 70 | if __name__ == '__main__': 71 | main() 72 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {% seo %} 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 |{{ site.description | default: site.github.project_tagline }}
21 | 22 | {% if site.github.is_project_page %} 23 |View the Project on GitHub {{ github_name }}
24 | {% endif %} 25 | 26 | {% if site.github.is_user_page %} 27 | 28 | {% endif %} 29 | 30 | {% if site.show_downloads %} 31 |