Skip to content

Instantly share code, notes, and snippets.

View acbetter's full-sized avatar
🈚
人已躺平 Salty Fish Everydayyyyyy

嘉心糖 acbetter

🈚
人已躺平 Salty Fish Everydayyyyyy
View GitHub Profile
@acbetter
acbetter / python.gitignore
Last active March 20, 2019 05:36
My Gitignore File for Python
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
@acbetter
acbetter / QImageViewSync.py
Created July 26, 2018 01:53
Two Image Synchronous Scrolling in the window by PyQt5 and Python 3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \
qApp, QFileDialog, QWidget, QHBoxLayout
@acbetter
acbetter / QImageViewer.py
Last active April 4, 2024 19:41
Image Viewer Example by PyQt5 and Python 3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \
qApp, QFileDialog
@acbetter
acbetter / batch-rename-files.py
Created July 23, 2018 01:50
Batch Rename Files by Python
import os
os.chdir('your-path-here')
print(os.listdir('.'))
for filename in os.listdir('.'):
os.rename(filename, filename.replace('src', 'opt'))
@acbetter
acbetter / read-json.py
Created July 23, 2018 01:48
Read Json File by Python
import json
import pprint
with open('data.json') as data_file:
data = json.load(data_file)
pprint.pprint(data)
@acbetter
acbetter / fix-homebrew-owner-permission.sh
Created July 13, 2018 14:43
Fix Homebrew owner permission in the macOS High Sierra
sudo chown -R $(whoami) $(brew --prefix)/*
@acbetter
acbetter / pip-install-develop-branch-of-pyinstaller.sh
Created July 13, 2018 14:41
Install the current development version of PyInstaller
pip install https://github.com/pyinstaller/pyinstaller/tarball/develop