Skip to main content

pylhbr4csharp

PyPI version Downloads star Fork License

pylhbr4csharp 是我在工作过程中陆续整理的一个 Python C# 工具包,里面就放在一个关于C#操作的类及相关函数。与其说是一个正式的开源项目,不如说是我自己的“代码杂物间”——只不过把它打包了一下,方便在不同项目之间复用。

由于是个人使用为主,很多设计可能带着比较强的个人习惯,也未必是最优解。
如果您发现了问题或有更好的建议,非常欢迎指正。
申明:操作前请作好备份,本人对所有操作结果拥有所有解释权。

安装

pip install pylhbr4csharp

🌺mycsharp模块

执行C#源码

使用示例:

from pylhbr4csharp.mycsharp import MyCSharp

if __name__ == '__main__':
    code = """
    using System;
    namespace MyTest
    {
        public class SayHelp
        {
            public string SayHello(string name)
            {
                return "Hello " + name;
            }
        }
    }
    """
    dlls=["System.dll","mscorlib.dll"]
    mycsharp=MyCSharp(code,dlls)
    if mycsharp.compiler():
        result=mycsharp.callMethod("SayHelp","SayHello",['李生',])
        print(result)
    else:
        count,errMsg=mycsharp.getErrors()
        print(count)
        print(errMsg)

🌺Star History

Star History Chart

🌺License

本项目基于 MIT 许可证开源。MIT 是一种宽松的开源许可证,允许任何人免费使用、修改、分发本软件,包括用于商业用途。详见 LICENSE 文件。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylhb4csharp-1.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylhb4csharp-1.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pylhb4csharp-1.1.0.tar.gz.

File metadata

  • Download URL: pylhb4csharp-1.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pylhb4csharp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 35b65518ff7c7c50e9c69631e3ac4876e750b4c3fa95314b9f4493ef44ea0457
MD5 031d2f26cb190d89d49e8eba89239733
BLAKE2b-256 04e1d67de03b63b1799ca9acdf9af7e9484e7b262a4223fa3d2bfc268a1124fd

See more details on using hashes here.

File details

Details for the file pylhb4csharp-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pylhb4csharp-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pylhb4csharp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02fe7c4f4d3494b6675e918980d627b3735065d3e1c9bc1956d4027060215d55
MD5 59316f5ce2a32591936e2ced2b9299b5
BLAKE2b-256 cb2834bb973e5a12590b78bfce26fce4d3ead14fa5dd271113115f8b50561f19

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page