<p>Try this:</p>

<pre><code>access.move(name, name2, balance)
</code></pre>

CC BY-SA 3.0
2015-04-21T19:03:15.923Z
2015-04-21T19:03:15.923Z
Nick ODell
<p>Steps to transfer bitcoin from Sam to Bob:</p>

<p><li>
Create a python script to connect to Sam's RPC server. Suppose Sam's IP is 172.28.128.4</p>

<pre><code>from jsonrpc import ServiceProxy
access = ServiceProxy("http://user:password@172.28.128.4:8332")
print(access.sendtoaddress(Bob's_Bitcoin_Address, Transfer_Balance))
</code></pre>

<p></li></p>

CC BY-SA 3.0
2015-04-21T02:42:41.543Z
I have an environmental variable called `BTCRPCURL` which allows `ServiceProxy(os.environ.get("BTCRCURL"))`
Wizard Of Ozzie
CC BY-SA 3.0
2015-04-20T14:40:15.293Z
2015-04-20T14:40:15.293Z
moshaholo
<p>I have got the api working and i can run commands like</p>

<pre><code>access = AuthServiceProxy("http://root:123@127.0.0.1:8332")
access.getinfo()
</code></pre>

<p>However not sure how to use more complicated commands such as:
move "fromaccount" "toaccount" amount ( minconf "comment" )</p>

<p>Tried something like this, but i get a syntax error in python.</p>

<pre><code>name = "bob"
name2 = "sam"
balance = 0.0001
access.move(name name2 balance)
</code></pre>

<p>Doing it like this i get JSONRPCException:</p>

<pre><code>name = "bob"
name2 = "sam"
balance = 0.0001
access.move('%s' '%s' '%s'), (name, name2, balance)
</code></pre>

<p>Any help appreciated.</p>

CC BY-SA 3.0
2015-04-20T12:46:20.243Z
yes, those accounts exist.
hash tables
CC BY-SA 3.0
2015-04-20T14:25:04.663Z
try this one: `acess.move(name, name2, balance)`, Sam and Bob should be bitcoin address.
moshaholo
<json-rpc><python>
Help me use python-bitcoinrpc
hash tables
# Help me use python-bitcoinrpc

(Asked by: username_0 on 2015-04-20)

I have got the api working and i can run commands like

```
access = AuthServiceProxy("http://root:123@127.0.0.1:8332")
access.getinfo()

```

However not sure how to use more complicated commands such as:
move "fromaccount" "toaccount" amount ( minconf "comment" )

Tried something like this, but i get a syntax error in python.

```
name = "bob"
name2 = "sam"
balance = 0.0001
access.move(name name2 balance)

```

Doing it like this i get JSONRPCException:

```
name = "bob"
name2 = "sam"
balance = 0.0001
access.move('%s' '%s' '%s'), (name, name2, balance)

```

Any help appreciated.

**Tags:** json-rpc, python

> **Comments:**
> **username_0**: yes, those accounts exist.  
> **username_1**: try this one: `acess.move(name, name2, balance)`, Sam and Bob should be bitcoin address.  

---

## 2 answers

### Answer by username_2 on 2015-04-21. Score: 2

Try this:

```
access.move(name, name2, balance)

```


---

### Answer by username_1 on 2015-04-20. Score: 1

Steps to transfer bitcoin from Sam to Bob:

- Create a python script to connect to Sam's RPC server. Suppose Sam's IP is 172.28.128.4

  ```
  from jsonrpc import ServiceProxy
  access = ServiceProxy("http://user:password@172.28.128.4:8332")
  print(access.sendtoaddress(Bob's_Bitcoin_Address, Transfer_Balance))

  ```

> **Comments:**
> **username_3**: I have an environmental variable called `BTCRPCURL` which allows `ServiceProxy(os.environ.get("BTCRCURL"))`  

---

