Author

Topic: runnign python (Read 805 times)

sr. member
Activity: 420
Merit: 250
May 16, 2013, 11:58:48 PM
#9
Man none of this stuff is working for me, I installed python33 and it keeps giving me errors. Can someone ELI5 how to pull data from btc-e. Willing to tip for your efforts.

I didn't link to python 3.3 above, so "none of this stuff is working" would not be stuff I posted. Most python programming is still done on 2.7, because libraries for 3+ are limited.

Gotcha, thanks for your time btw. Sorry I'm a bit frustrated because I always suck at learning a new programming language. Once I can get a somewhat complicated programs running I can usually figure everything else out. Only thing I've been able to do so far in python is "Hello World" Sad

Is there like a simple programs to just pull the last traded price from btc-e that I can try just for a test? I want to see if I can run an interactive program.
Well, you could scrape the web page using Beautiful Soup to get the data from btc-e and into your script.
EDIT: Actually, just use the API. No scraping required.
sr. member
Activity: 422
Merit: 250
April 29, 2013, 06:02:33 AM
#8
Man none of this stuff is working for me, I installed python33 and it keeps giving me errors. Can someone ELI5 how to pull data from btc-e. Willing to tip for your efforts.

I didn't link to python 3.3 above, so "none of this stuff is working" would not be stuff I posted. Most python programming is still done on 2.7, because libraries for 3+ are limited.

Gotcha, thanks for your time btw. Sorry I'm a bit frustrated because I always suck at learning a new programming language. Once I can get a somewhat complicated programs running I can usually figure everything else out. Only thing I've been able to do so far in python is "Hello World" Sad

Is there like a simple programs to just pull the last traded price from btc-e that I can try just for a test? I want to see if I can run an interactive program.
legendary
Activity: 1512
Merit: 1036
April 29, 2013, 05:44:21 AM
#7
Man none of this stuff is working for me, I installed python33 and it keeps giving me errors. Can someone ELI5 how to pull data from btc-e. Willing to tip for your efforts.

I didn't link to python 3.3 above, so "none of this stuff is working" would not be stuff I posted. Most python programming is still done on 2.7, because libraries for 3+ are limited.
sr. member
Activity: 422
Merit: 250
April 28, 2013, 06:19:44 PM
#6
I would suggest that if you don't have the skill to read arbitrary code from the Internet and understand it, especially if the author is targeting Bitcoin users, that you do not run such code on your computer - it could as easily have obfuscated "upload wallet.dat to hacker" code.

The code snippet you linked is for executing a trade on btc-e, you must do more than just click on it, it requires your api key and secret key be added to the code, and you must use command-line parameters to specify what currency and type of order you wish to execute. It says that on line four of the code. Original thread: https://bitcointalksearch.org/topic/m.1075244

All that is needed is to download and install Python. For Windows: http://www.python.org/ftp/python/2.7/python-2.7.msi

The code only requires standard libraries, but you may find other advanced code that require other common-but-not-included libraries, such as greenlet, twisted, zope, boost, etc.

Here is some code which takes command line options; try saving this as example.py and running it from the command line. Master this first:

import sys; print ' '.join(sys.argv)

Man none of this stuff is working for me, I installed python33 and it keeps giving me errors. Can someone ELI5 how to pull data from btc-e. Willing to tip for your efforts.
legendary
Activity: 1512
Merit: 1036
April 27, 2013, 08:30:14 AM
#5
I would suggest that if you don't have the skill to read arbitrary code from the Internet and understand it, especially if the author is targeting Bitcoin users, that you do not run such code on your computer - it could as easily have obfuscated "upload wallet.dat to hacker" code.

The code snippet you linked is for executing a trade on btc-e, you must do more than just click on it, it requires your api key and secret key be added to the code, and you must use command-line parameters to specify what currency and type of order you wish to execute. It says that on line four of the code. Original thread: https://bitcointalksearch.org/topic/m.1075244

All that is needed is to download and install Python. For Windows: http://www.python.org/ftp/python/2.7/python-2.7.msi

The code only requires standard libraries, but you may find other advanced code that require other common-but-not-included libraries, such as greenlet, twisted, zope, boost, etc.

Here is some code which takes command line options; try saving this as example.py and running it from the command line. Master this first:

import sys; print ' '.join(sys.argv)
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
April 26, 2013, 05:01:18 PM
#4
You would need the Python interpreter, it comes as an installer or zip, I recommend the installer. There is a 32-bit version and a 64-bit one, use whichever suits you. That should be all, unless that script depends on modules not part of standard Python.

http://www.python.org/download/

The Python installer associates .py files with Python so double clicking will execute them, or you can do it the old fashion and recommended way

Code:
python mypythonfile.py

Ok I executed the code, and the black screen appears and disappears. How can I determine if something actually happened? Can you send me a sample code that actually does something that I can see? Even "Hello World" but something that pull back from btc would be nice. Thanks.
Try it from the console then. As in open a new command prompt, navigate to where the python script is and execute the code I gave above.
sr. member
Activity: 422
Merit: 250
April 26, 2013, 04:05:55 PM
#3
You would need the Python interpreter, it comes as an installer or zip, I recommend the installer. There is a 32-bit version and a 64-bit one, use whichever suits you. That should be all, unless that script depends on modules not part of standard Python.

http://www.python.org/download/

The Python installer associates .py files with Python so double clicking will execute them, or you can do it the old fashion and recommended way

Code:
python mypythonfile.py

Ok I executed the code, and the black screen appears and disappears. How can I determine if something actually happened? Can you send me a sample code that actually does something that I can see? Even "Hello World" but something that pull back from btc would be nice. Thanks.
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
April 26, 2013, 02:54:58 PM
#2
You would need the Python interpreter, it comes as an installer or zip, I recommend the installer. There is a 32-bit version and a 64-bit one, use whichever suits you. That should be all, unless that script depends on modules not part of standard Python.

http://www.python.org/download/

The Python installer associates .py files with Python so double clicking will execute them, or you can do it the old fashion and recommended way

Code:
python mypythonfile.py
sr. member
Activity: 422
Merit: 250
April 26, 2013, 02:06:56 PM
#1
Ok so lets say I just want to copy/paste and use this script: http://pastebin.com/Xu64wH1e

What do I need to install in order to execute python code? I'm working on a windows machine.
Jump to: