<p>In python, you don't need to prefix a call to a function in the same module with the module's name. You can call it like <code>print privateCeiToWif(private_Cei)</code></p>

CC BY-SA 3.0
2016-10-16T02:06:04.287Z
[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/3RO0d.png I got this error after trying your solution
iivri  andre
CC BY-SA 3.0
2016-10-16T05:42:27.220Z
What do you expect that to call?
Nick ODell
CC BY-SA 3.0
2016-10-16T01:19:21.080Z
2016-10-16T01:19:21.080Z
Nick ODell
<pre><code>import random

def privateCeiToWif(Cei_hex) :
     return utils.base58CheckEncode(0x80, Cei_hex.decode('hex'))

def privateCeiTopublicCei(s) :
# secp256k1 : Standards for Efficient Cryptography (SEC)(Certicom Research) refers to the parameters of the ECDSA curve
    Signature = ecdsa.SigningCei.from_string(s.decode('hex'), curve = ecdsa.SECP256k1)
    verification = Signature.verifying_Cei
    return ('\04' + Signature.verifying_Cei.to_string()) .encode('hex')

def pubCeiToaddr(s) :
    ripemd160 = hashlib.new('ripemd160')
    ripemd160.update(hashlib.sha256(s.decode('hex')).digest())
    return utils.base58CheckEncode(0, ripemd160.digest())

def CeiToaddr (s) :
    return pubCeiToaddr(privateCeiTopublicCei(s))

#WARNING :  This random function is not secure
private_Cei = ' '.join(['%x ' %random.randrange(16) for x  in range(0, 64)])
print CeiUtils.privateCeiToWif(private_Cei)
print CeiUtils.CeiToaddr(private_Cei)
</code></pre>

<p><a href="https://i.sstatic.net/k2CLZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/k2CLZ.png" alt="error message ceiutils"></a></p>

<address><private-key><wallet-import-format>
Why does this code keeping giving me this error? I am just trying to understand the raw bitcoin protocol
iivri  andre
# Why does this code keeping giving me this error? I am just trying to understand the raw bitcoin protocol

(Asked by: username_0 on 2016-10-16)

import random

def privateCeiToWif(Cei_hex) :
     return utils.base58CheckEncode(0x80, Cei_hex.decode('hex'))

def privateCeiTopublicCei(s) :
# secp256k1 : Standards for Efficient Cryptography (SEC)(Certicom Research) refers to the parameters of the ECDSA curve
    Signature = ecdsa.SigningCei.from_string(s.decode('hex'), curve = ecdsa.SECP256k1)
    verification = Signature.verifying_Cei
    return ('\04' + Signature.verifying_Cei.to_string()) .encode('hex')

def pubCeiToaddr(s) :
    ripemd160 = hashlib.new('ripemd160')
    ripemd160.update(hashlib.sha256(s.decode('hex')).digest())
    return utils.base58CheckEncode(0, ripemd160.digest())

def CeiToaddr (s) :
    return pubCeiToaddr(privateCeiTopublicCei(s))

#WARNING :  This random function is not secure
private_Cei = ' '.join(['%x ' %random.randrange(16) for x  in range(0, 64)])
print CeiUtils.privateCeiToWif(private_Cei)
print CeiUtils.CeiToaddr(private_Cei)

**Tags:** address, private-key, wallet-import-format


---

## 1 answers

### Answer by username_1 on 2016-10-16. Score: 1

In python, you don't need to prefix a call to a function in the same module with the module's name. You can call it like `print privateCeiToWif(private_Cei)`

> **Comments:**
> **username_0**: [![enter image description here][1]][1]     [1]: https://i.sstatic.net/3RO0d.png I got this error after trying your solution  
> **username_1**: What do you expect that to call?  

---

