FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonvm-rust/src/bin.rs at wordcode · progval/pythonvm-rust · GitHub
progval
pythonvm-rust
Repository navigation
Code
Issues
2
(2)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonvm-rust
/
src
/
bin.rs
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (29 loc) · 990 Bytes
Breadcrumbs
pythonvm-rust
/
src
/
bin.rs
Copy path
File metadata and controls
33 lines (29 loc) · 990 Bytes
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
extern
crate
pythonvm
;
use
std
::
env
::
args
;
use
std
::
fs
::
File
;
use
std
::
path
::
PathBuf
;
fn
parse_args
(
)
->
(
String
,
Option
<
(
String
,
String
)
>
)
{
let
mut
args =
args
(
)
;
let
executable = args
.
next
(
)
.
unwrap
(
)
;
let
libdir = args
.
next
(
)
;
let
filename = args
.
next
(
)
;
let
extra = args
.
next
(
)
;
match
(
libdir
,
filename
,
extra
)
{
(
Some
(
libdir
)
,
Some
(
filename
)
,
None
)
=>
(
executable
,
Some
(
(
libdir
,
filename
)
)
)
,
_ =>
(
executable
,
None
)
,
}
}
pub
fn
main
(
)
{
let
(
libdir
,
filename
)
=
match
parse_args
(
)
{
(
_
,
Some
(
(
libdir
,
filename
)
)
)
=>
(
libdir
,
filename
)
,
(
executable
,
None
)
=>
{
println
!
(
"Syntax: {} pythonlib/ filename.pyc"
,
executable
)
;
return
}
}
;
let
mut
file =
File
::
open
(
filename
)
.
unwrap
(
)
;
let
mut
path =
PathBuf
::
new
(
)
;
path
.
push
(
&
libdir
)
;
let
env_proxy = pythonvm
::
RealEnvProxy
::
new
(
path
)
;
let
(
_processor
,
_result
)
= pythonvm
::
run_file
(
&
mut
file
,
env_proxy
)
.
unwrap
(
)
;
}
Back
|
FazBrowse Home
|
New Git URL