Skip to content

Commit

Permalink
0.9.55 start coding
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Jul 2, 2024
1 parent 3681728 commit cb5a2ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Python package

on:
push:
branches: [ master, V0.9.54 ]
branches: [ master, V0.9.55 ]
pull_request:
branches: [ master ]

Expand Down
3 changes: 2 additions & 1 deletion czsc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
ExitsOptimize,
)
from czsc.utils import (
mac_address,
overlap,

format_standard_kline,
Expand Down Expand Up @@ -187,7 +188,7 @@
)


__version__ = "0.9.54"
__version__ = "0.9.55"
__author__ = "zengbin93"
__email__ = "[email protected]"
__date__ = "20240616"
Expand Down
17 changes: 17 additions & 0 deletions czsc/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,20 @@ def print_df_sample(df, n=5):
from tabulate import tabulate

print(tabulate(df.head(n).values, headers=df.columns, tablefmt="rst"))


def mac_address():
"""获取本机 MAC 地址
MAC地址(英语:Media Access Control Address),直译为媒体访问控制地址,也称为局域网地址(LAN Address),
以太网地址(Ethernet Address)或物理地址(Physical Address),它是一个用来确认网络设备位置的地址。在OSI模
型中,第三层网络层负责IP地址,第二层数据链接层则负责MAC地址。MAC地址用于在网络中唯一标示一个网卡,一台设备若有一
或多个网卡,则每个网卡都需要并会有一个唯一的MAC地址。
:return: 本机 MAC 地址
"""
import uuid

x = uuid.UUID(int=uuid.getnode()).hex[-12:].upper()
x = "-".join([x[i : i + 2] for i in range(0, 11, 2)])
return x

0 comments on commit cb5a2ad

Please sign in to comment.