Skip to content

Instantly share code, notes, and snippets.

@AlexArcPy
Last active November 25, 2017 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexArcPy/acf6cef798d55a326664b2fbca80e418 to your computer and use it in GitHub Desktop.
Save AlexArcPy/acf6cef798d55a326664b2fbca80e418 to your computer and use it in GitHub Desktop.
Basic PyQt5 application to run in ArcGIS Pro custom script tool: running in the thread of Pro
import sys
import arcpy
from PyQt5.QtWidgets import (QMainWindow, QLabel, QApplication)
from PyQt5.QtCore import Qt
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setWindowTitle("Basic App")
project = arcpy.mp.ArcGISProject('current')
label = QLabel("The document version of the open project is {}".format(
project.documentVersion))
label.setAlignment(Qt.AlignCenter)
self.setCentralWidget(label)
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = MainWindow()
ex.show()
sys.exit(app.exec_())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment