python、pycharm使用

一、Python教程

官网:https://www.python.org/
w3cSchool
菜鸟教程
Python 入门指南
Python 入门基础
Python视频教程(bilibi-小甲鱼)

二、pycharm安装

pycharm、Idea 安装关键步骤
1、pycharm快捷键

三、PySide6、PyQt5

1、pyside2

PySide2视频教程—打包程序

//安装
pip install pyside2

2、PyQt5

PyQt5从入门到实践
《Python GUI设计PyQt5从入门到实践》书籍配套视频
PyQt5界面美化教程
(1)安装

pip install PyQt5
pip install pyqt5-tools
pip install PyQt5Designer

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

(2)pycharm设置外部程序

External Libraries->Lib->site-packages->QtDesigner->designer.exe 右键复制绝对路径
File->Settings->Tools->External Tools 点击+号

Name:Qt Designer
Program:刚才复制的designer.exe的绝对路径
Working directory:$ProjectFileDir$

点击+号

Name:PyUic
Program:工程使用的python.exe的路径
Arguments:-m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
Working directory:$FileDir$
Name:PyUic
Program:工程使用的pyuic5.exe的路径
Arguments:$FileName$ -o $FileNameWithoutExtension$.py
Working directory:$FileDir$
Name:PyRcc
Program:工程使用的pyrcc5.exe的路径
Arguments:$FileName$ -o $FileNameWithoutExtension$_rc.py
Working directory:$FileDir$

右击工程区:External Tool->Qt Designer,创建一个窗体(MainWindow、Widget)
窗体名右击:External Tool->PyUic,生成py文件
编辑生成的窗体py文件:

if __name__ == '__main__':
    app=QtWidgets.QApplication(sys.argv)
    widget=QtWidgets.QWidget()
    ui=Ui_Form()
    ui.setupUi(widget)
    widget.show()
    sys.exit(app.exec_())

import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
import CMyMinWindow 						#窗体类名
if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)  #([])
    myMainWindow = QMainWindow()
    ui = CMyMainWindow.Ui_MainWindow()		#窗体类名
    ui.setupUi(myMainWindow)
    myMainWindow.show()
    sys.exit(app.exec_())

三、语法

1、查看内置函数

dir(__builtins__)

['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'ModuleNotFoundError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError', 'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'WindowsError', 'ZeroDivisionError', '__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__', '__package__', '__spec__', 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'breakpoint', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值