我正在学习Python,作为练习,我试图编写一个在比特币市场上进行交易的程序:https://bitcurex.com。这是一个API引用:https://bitcurex.com/reading-room/API。有一个PHP客户机示例,因此我尝试将其转换为Python,因此我得到了:
import math
import time
import simplejson
import urllib
import urllib2
import hmac,hashlib
def microtime():
return '%f %d' % math.modf(time.time())
def query( path, key, secret, data={} ):
mt = microtime().split()
nonce = mt[1] + mt[0][2:]
data['nonce'] = nonce
post_data = urllib.urlencode( data )
sign = hmac.new( secret.decode('base64'), post_data, hashlib.sha512 ).digest()
headers = {'Rest-Key' : key,
'Rest-Sign': sign.encode('base64').strip(),
'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)',
'Content-type': 'application/x-www-form-urlencoded'}
print headers
url = 'https://bitcurex.com/api/0/' + path
req = urllib2.Request( url, post_data, headers )
response = urllib2.urlopen(req)
return simplejson.loads(response.read())
print query('getFunds', '29a28e8fe234537056a8b256c0df50413f50da9c49ca61991ea8b8f108a88e09', 'y2NDxKGa/xvhtXrDP+3oscbBUFSac9+T8jzu2nRmt0vBdHbbl8NRqdmxKFr2IwwY5LAskTQZGyy2XONaNN6Jrg==')
这些API密钥正在工作-您只能使用它们进行getFunds查询。
它一直返回错误“必须我登录”。我试图通过Fiddler Proxy Debugger查看该请求,下面是该尝试的标题:
^{pr2}$小提琴手给我看了一个错误:
Incorrectly formed request headers.
Missing colon in header #3, WIc7bH56sQ==
有什么想法吗?我的休息标志好像太长了什么的。我认为我的代码应该与PHP示例完全相同。我做错什么了?在
从磁盘删除项目后,Eclipse无法恢复它。但是,根据您的操作系统,它可能仍在您的垃圾箱文件夹中。如果不是,那么这确实是一个数据恢复的问题
Eclipse - Managing Files and Projects说:
所以,您可能刚刚从eclipse中删除了它,但它仍然在您的硬盘上。否则,您必须使用Data Recovery Softwares
如果您只是碰巧在eclipse中删除了该项目,但未选中“删除磁盘上的项目内容(无法撤消)”,则可以恢复该项目。这是通过使用文件/导入、选择“将现有项目导入工作区”并浏览硬盘上的位置来完成的,在那里您已经精确地存储了项目
相关问题 更多 >
编程相关推荐