GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - heartacker/CScripting: write c# script like python

BranchesTags
Open more actions menu

Latest commit

 

History

89 Commits
89 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
CScripting
CScripting
 
 
CScriptingDemo
CScriptingDemo
 
 
CScriptingTests
CScriptingTests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CScripting.Compare.py
CScripting.Compare.py
 
 
CScripting.Demo.csx
CScripting.Demo.csx
 
 
CScripting.Demo.dib
CScripting.Demo.dib
 
 
CScripting.sln
CScripting.sln
 
 
CSharp.Scripting.codetext.csx
CSharp.Scripting.codetext.csx
 
 
CSharp.Scripting.csx
CSharp.Scripting.csx
 
 
README.md
README.md
 
 
diagram.svg
diagram.svg
 
 
omnisharp.json
omnisharp.json
 
 

Repository files navigation

1. CScripting

Visualization of the codebase

GitHub stars Nuget Nuget GitHub release

  • Roslyn
  • CSharpScript
  • CSharpScript MemoryManager
  • Unity引擎与C#脚本
  • Scripting-API-Samples
  • 1. CScripting
    • 1.1. Instruction
    • 1.2. Recent Changelog
    • 1.3. Demo
    • 1.4. Dotnet script and repl
    • 1.5. Extended function list
    • 1.6. Extended function list like Matlab
    • 1.7. Python Built-in function list

1.1. Instruction

write c# script like python

!!! tip 思路 我们主要是想在 C# 实现 Python 的内置函数,并在C# 中可以直接使用, 以便提高简单脚本的编写效率。

!!! tip 欢迎 ❤️
    欢迎 任何 PR

!!! tip idea We aim to implement the built-in function of python in C# and direct use in C# to improve the effect.

!!! tip **Welcome** ❤️
    welcome any pull request

1.2. Recent Changelog

  • time: 2023年5月15日
  • version: 1.0.6
  • log:
    1. change readme
    2. add help function
    3. add dir function
    4. fix trim print() last sep

more information, see CHANGELOG.md

1.3. Demo

  • Code

🔗 C#

#r "nuget: CScripting, *"
using static CScripting;

var addr = 0x12345678;
var addrr = hex(addr);

print(addr); // 305419896
print(addrr);

var val = 0x12345678;
var valr = bin(addr);

print(val); // 305419896
print(valr);

var c = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };

print(c);
print(c, sep:"\t");

🔗 Python

#r "nuget: CScripting, *"


addr = 0x12345678
addrr = hex(addr)

print(addr) # 305419896
print(addrr)

val = 0x12345678
valr = bin(addr)

print(val); # 305419896
print(valr)

c = [0, 1, 2, 3, 4, 5, 6, 7]

print(c)
print(c, sep="\t")
  • Output

C#

305419896
0x12345678
305419896
0b10010001101000101011001111000
{ 0, 1, 2, 3, 4, 5, 6, 7}
0	1	2	3	4	5	6	7

Python

305419896
0x12345678
305419896
0b10010001101000101011001111000
[0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]

1.4. Dotnet script and repl

~$ dotnet-script
> #r "nuget: CScripting, *"
> using static CScripting;
> hex(1024)
"0x400"
> print("Hello CScripting")
Hello CScripting

1.5. Extended function list

  • MyOwn
    • load()
    • unload()

1.6. Extended function list like Matlab

  • coming
    • ???
    • ????

1.7. Python Built-in function list

  • A

    • abs()
    • aiter()
    • all()
    • any()
    • anext()
    • ascii()
  • B

    • bin()
    • bool()
    • breakpoint()
    • bytearray()
    • bytes()
  • C

    • callable()
    • chr()
    • classmethod()
    • compile() **
    • complex() **
  • D

    • delattr()
    • dict()
    • dir() *
    • divmod()
  • E

    • enumerate()
    • eval()
    • exec()
  • F

    • filter()
    • float()
    • format()
    • frozenset()
  • G

    • getattr()
    • globals()
  • H

    • hasattr()
    • hash()
    • help()
    • hex()
  • I

    • id()
    • input()
    • int()
    • isinstance()
    • issubclass()
    • iter()
  • L

    • len()
    • list()
    • locals()
  • M

    • map()
    • max()
    • memoryview()
    • min()
  • N

    • next()
  • O

    • object()
    • oct()
    • open()
    • ord()
  • P

    • pow()
    • print()
    • property()
  • R

    • range()
    • repr()
    • reversed()
    • round()
  • S

    • set()
    • setattr()
    • slice()
    • sorted()
    • staticmethod()
    • str()
    • sum()
    • super()
  • T

    • tuple()
    • type()
  • V

    • [ ]vars()
  • Z

    • zip()
  • misc

    • _
    • __import__()
    • ???

About

write c# script like python

www.nuget.org/packages/CScripting

Topics

cs-scriptcsharp-scriptcsharp-sourcegeneratordotnet-interactivedotnet-scriptjupyternotebookpolygonpythonpythonnet

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.