Assigned scaffolding macro in Python script file to F12 key

Define macros for scaffolding Python scripts

(fset 'py-script-scaffold
   "\C-[<#! /sr\C-?\C-?usr/bin/env python\C-j# -*- coding: utf-8 -:-\C-b\C-b\C-d*\C-e\C-jimport\C-a\C-k\"\"\"\C-j\C-e\C-j\C-jimport sys\C-jimport argparse\C-j\C-j\C-jdef main(argv=sys.argv[1\C-e\C-b\C-b\C-b\C-f:\C-e:\C-mparser = argparse.ArgumentParser(\C-e\C-j\C-iargs = parser.parse_args(argv\C-e\C-j\C-j\C-j\C-aif __name__ == ''\C-b\C-d\C-d__main__\C-e:\C-[b\C-[f\C-f\C-k:\C-mj\C-?main(\C-e\C-j")

Assign to F12 key

(define-key global-map [f12] 'py-script-scaffold)

Recommended Posts

Assigned scaffolding macro in Python script file to F12 key
A memorandum to run a python script in a bat file
Pin current directory to script directory in Python
Convert psd file to png in Python
Sample script to trap signals in Python
Script python file
From file to graph drawing in Python. Elementary elementary
How to create a JSON file in Python
Sample to put Python Kivy in one file
File operations in Python
Key input in Python
File processing in Python
File operations in Python
Key input in Python
Parse a JSON string written to a file in Python
Template of python script to read the contents of the file
I want to randomly sample a file in Python
Preparing to script control Rhino objects in Grasshopper / Python
[Work efficiency] How to change file names in Python
Python script to create a JSON file from a CSV file
[python] How to check if the Key exists in the dictionary
To flush stdout in Python
I made a script in Python to convert a text file for JSON (for vscode user snippet)
Download the file in Python
A Python script that saves a clipboard (GTK) image to a file.
Change the standard output destination to a file in Python
Login to website in Python
How to import a file anywhere you like in Python
Display numbers and letters assigned to variables in python print
Speech to speech in python [text to speech]
Get macro constants from C (++) header file (.h) in Python
[Python] How to change EXCEL file saved in xlsb to xlsx
How to develop in Python
Post to Slack in Python
Convert Excel file to text in Python for diff purposes
Output the key list included in S3 Bucket to a file
How to pass arguments to a Python script in SPSS Modeler Batch
Create a shell script to run the python file multiple times
How to judge that the cross key is input in Python3
[Python] When you want to use all variables in another file
I wrote a function to load a Git extension script in Python
I wrote a script to extract a web page link in Python
Articles to read when Blender Python script code doesn't work in 2.80
Python script written in PyTorch is converted to exe with PyInstaller
[Python] How to do PCA in Python
File / folder path manipulation in Python
Convert markdown to PDF in Python
[Python] Write to csv file with Python
Save the binary file in Python
How to collect images in Python
Linebot creation & file sharing in Python
How to use SQLite in Python
Output to csv file with Python
Get the script path in Python
In the python command python points to python3.8
Create a binary file in Python
[python] Copy script to generate copy log
Try to calculate Trace in Python
How to use Mysql in python
How to wrap C in Python
How to use ChemSpider in Python