Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Add code formatting to README #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ shell script called grumprun that takes Python code on stdin and builds and runs
the code under Grumpy. All of the commands below are assumed to be run from the
root directory of the Grumpy source code distribution:

```
```sh
echo "print 'hello, world'" | make run
```

Expand All @@ -80,7 +80,7 @@ source code, making it similar to the PYTHONPATH.
The first step is to set up the shell so that the Grumpy toolchain and libraries
can be found. From the root directory of the Grumpy source distribution run:

```
```sh
make
export PATH=$PWD/build/bin:$PATH
export GOPATH=$PWD/build
Expand All @@ -90,19 +90,19 @@ export PYTHONPATH=$PWD/build/lib/python2.7/site-packages
You will know things are working if you see the expected output from this
command:

```
```sh
echo 'import sys; print sys.version' | grumprun
```

Next, we will write our simple Python module into the \_\_python\_\_ directory:

```
```sh
echo 'def hello(): print "hello, world"' > $GOPATH/src/__python__/hello.py
```

To build a Go package from our Python script, run the following:

```
```sh
mkdir -p $GOPATH/src/__python__/hello
grumpc -modname=hello $GOPATH/src/__python__/hello.py > \
$GOPATH/src/__python__/hello/module.go
Expand All @@ -112,7 +112,7 @@ You should now be able to build a Go program that imports the package
"\_\_python\_\_/hello". We can also import this module into Python programs
that are built using grumprun:

```
```sh
echo 'from hello import hello; hello()' | grumprun
```

Expand Down