-
Notifications
You must be signed in to change notification settings - Fork 283
Closed
Labels
BugSomething isn't workingSomething isn't working
Description
描述问题
python代码着色处理。其它主题测试无此总是。
如何复现问题
将下列内容帖成md,然后用typora的drake-black主题打开. 其中'要换成`
### python类
#### 一个实例看会类
'''python
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
class Employee:
'所有员工的基类' # __doc__
empCount = 0 # 类属性
name = 0
salary = 0
def __init__(this, name, salary): # 构造方法
this.name = name # 实例属性
this.salary = salary
Employee.empCount += 1
def __del__(self): # 析构方法
Employee.empCount -= 1
def displayCount(this): # 类方法,this是必须的,在方法里引用实例使用。
print("Total Employee %d" % Employee.empCount)
def displayEmployee(this): # this不是关键字,也可以使用this
print("Name : ", this.name, ", Salary: ", this.salary)
emp1 = Employee("Zara", 2000) # 创建实例
emp2 = Employee("Manni", 5000)
emp1.displayEmployee()
emp2.displayEmployee() # 访问方法
print("Total Employee %d" % Employee.empCount) # 访问类属性
del emp2 # 消毁实例,触发析构
print("Total Employee %d" % Employee.empCount) # 访问类属性
'''
期望结果
下面截图里,正确的是drake主题。哎呀图上传不上来。你帖下代码试下就能重现了。
截图
系统 (建议使用最新Typora版本)
- OS
- Theme
- Typora Version
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working