当前位置: 动力学知识库 > 问答 > 编程问答 >

scheme - Is there a racket equivalent of 'python -i filename.py'?

问题描述:

When I develop python, I often use python -i filename.py to run the file, and then go into interactive mode in the namespace of the given file, so e.g. if I had defined C=3, I could then access it from the prompt as

>>> C

3

I'm trying to find a way to use the racket command line program in a similar way, but the closest I've gotten is

$ racket -i -e "(require \"filename.rkt\")"

> C

3

网友答案:

I figured it out

racket -it filename.rkt
> C
3

or

racket -iu filename.rkt
> C
3

Not really sure what the differences are, but the command line help says the following

-t <file>, --require <file> : Like -e '(require (file "<file>"))' [*]
-u <file>, --require-script <file> : Same as -t <file> -N <file> --
-N <file>, --name <file> : Sets `(find-system-path 'run-file)' to <file>
分享给朋友:
您可能感兴趣的文章:
随机阅读: