Skip to content

Instantly share code, notes, and snippets.

View FlorianRhiem's full-sized avatar

Florian Rhiem FlorianRhiem

  • Jülich, Germany
View GitHub Profile
@FlorianRhiem
FlorianRhiem / LICENSE
Created October 12, 2019 15:31
This license applies to all public gists https://gist.github.com/FlorianRhiem
MIT License
Copyright (c) 2019 Florian Rhiem
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@FlorianRhiem
FlorianRhiem / callafter.py
Created December 11, 2014 12:34
PyQt5 callAfter method via QMetaObject::invokeMethod
import sys
from PyQt5.QtCore import QMetaObject, QObject, Qt, pyqtSlot
from PyQt5.QtWidgets import QApplication, QWidget
class CallAfter(QObject):
instances = []
def __init__(self, callable, *args, **kwargs):
super(CallAfter, self).__init__()
self._callable = callable
@FlorianRhiem
FlorianRhiem / png.py
Last active August 29, 2015 14:08
Export images to PNG files with Python
# coding: utf-8
"""
Export images to PNG files.
Based on the ActiveState Recipe
"Write a PNG image in native Python (Pythonrecipe)"
(http://code.activestate.com/recipes/577443-write-a-png-image-in-native-python/)
which Campbell Barton (http://code.activestate.com/recipes/users/4168177/)
posted in October '10 under MIT license.