-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to run python script? #385
Comments
When on the Dashboard, go to Workspaces > Stack Library and create a new workspace with Python2.7 stack. Open it in the IDE and create a new project with py file, which contains your script, and requirements.txt file with the following content In the Terminal, cd your project directory and execute the following command to run your script: sudo virtualenv /env && sudo pip install --upgrade pip && sudo pip install -r requirements.txt && python main.py |
@iamnaok does this suggestion help? |
Closing the issue - do try the suggestion offered by @ddementieva |
This suggestion doesn't work. Can you open this issue? |
Hi, I cannot figure out how to run this script https://gist.github.com/mattvukas/9146611
Here it is:
import requests, json
from time import sleep
def getBitcoinPrice():
URL = 'https://www.bitstamp.net/api/ticker/'
try:
r = requests.get(URL)
priceFloat = float(json.loads(r.text)['last'])
return priceFloat
except requests.ConnectionError:
print "Error querying Bitstamp API"
while True:
print "Bitstamp last price: $" + str(getBitcoinPrice()) + "/BTC"
sleep(5)
The text was updated successfully, but these errors were encountered: