Created
August 16, 2019 05:35
-
-
Save teionn/5cb7b2a543e83bfd49c3d76321b7421c to your computer and use it in GitHub Desktop.
readfile on maya (pyside2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide2.QtGui import QDesktopServices | |
from PySide2.QtCore import QUrl | |
QDesktopServices.openUrl(QUrl.fromLocalFile(r"C:\WINDOWS\win.ini")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide2.QtCore import QFile | |
from PySide2.QtWidgets import QTextEdit | |
textEdit = QTextEdit() | |
textEdit.setReadOnly(True) | |
text_file = QFile("{}/userPrefs.mel".format(cmds.internalVar(userPrefDir=True))) | |
text_file.open(QFile.ReadOnly | QFile.Text) | |
textEdit.setPlainText(text_file.readAll().data().decode("shift-jis")) | |
textEdit.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment