Skip to content

Instantly share code, notes, and snippets.

View dalejfer's full-sized avatar

Daniel A. Fernández dalejfer

  • Salta, Argentina
View GitHub Profile
@dalejfer
dalejfer / doc2pdf_with_COM.py
Created May 17, 2022 02:25
Using COM interop with pywin32 to open files (and edit and save, save as...) with MS Word (and other office apps). Here we'll open a docx file and save it as pdf.
"""
Using COM interop with pywin32 to open files (and edit and save, save as...)
with MS Word (and other office apps). Here we'll open a docx file and save
it as pdf.
You need to have office installed.
Source: http://timgolden.me.uk/python/win32_how_do_i/generate-a-static-com-proxy.html
static - dynamic proxy to office COM obj.
@dalejfer
dalejfer / pyside2_qrunnable_signal_test.py
Created March 11, 2019 03:12
Run a QTheadPool with signal emitting QRunnable workers. Capture the signals in the main thread and update the UI.
#!python3.7
import random
import time
import PySide2
from PySide2 import QtCore, QtWidgets
from PySide2.QtCore import Slot, Signal, QObject, QThreadPool, QRunnable
class MyEmitter(QObject):
@dalejfer
dalejfer / gui.py
Last active January 27, 2018 20:59
Pyinstaller bug
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class ButtonWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Button Demo")
self.set_border_width(10)