FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/embed_tests/Program.cs at featured · asyncrun/pythonnet · GitHub
asyncrun
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
embed_tests
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (47 loc) · 1.74 KB
Breadcrumbs
pythonnet
/
src
/
embed_tests
/
Program.cs
Copy path
File metadata and controls
53 lines (47 loc) · 1.74 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using
System
;
using
System
.
Collections
;
using
System
.
Collections
.
Generic
;
using
System
.
Diagnostics
;
using
System
.
Linq
;
using
NUnit
.
Common
;
using
NUnitLite
;
using
Python
.
Runtime
;
namespace
Python
.
EmbeddingTest
{
public
class
Program
{
public
static
int
Main
(
string
[
]
args
)
{
if
(
args
.
Contains
(
"--loop"
)
)
{
args
=
args
.
Where
(
x
=>
x
!=
"--loop"
)
.
ToArray
(
)
;
int
result
;
int
runNumber
=
0
;
string
pathEnv
=
Environment
.
GetEnvironmentVariable
(
"PATH"
)
;
do
{
Console
.
ForegroundColor
=
ConsoleColor
.
Green
;
Console
.
Error
.
WriteLine
(
$
"----- Run =
{
++
runNumber
}
, MemUsage =
{
Process
.
GetCurrentProcess
(
)
.
WorkingSet64
/
1024
/
1024
}
Mb -----"
)
;
Console
.
ForegroundColor
=
ConsoleColor
.
Gray
;
result
=
new
AutoRun
(
typeof
(
Program
)
.
Assembly
)
.
Execute
(
args
,
new
ExtendedTextWrapper
(
Console
.
Out
)
,
Console
.
In
)
;
// Python does not see Environment.SetEnvironmentVariable changes.
// So we needs restore PATH variable in a pythonic way.
using
(
new
PythonEngine
(
)
)
{
dynamic
os
=
PythonEngine
.
ImportModule
(
"os"
)
;
os
.
environ
[
"PATH"
]
=
new
PyString
(
pathEnv
)
;
}
}
while
(
!
Console
.
KeyAvailable
)
;
return
result
;
}
return
new
AutoRun
(
typeof
(
Program
)
.
Assembly
)
.
Execute
(
args
,
new
ExtendedTextWrapper
(
Console
.
Out
)
,
Console
.
In
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL