Download main.py from Starchik/test: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/spaces/Starchik/test/resolve/main/main.py
- Command line
-
hf download hf://spaces/Starchik/test/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Starchik/test/resolve/main/main.py
504 Bytes
| from flask import Flask, render_template | |
| import requests | |
| app = Flask(__name__) | |
| def get_crypto_prices(): | |
| url = "https://api.coingecko.com/api/v3/simple/price" | |
| params = { | |
| 'ids': 'bitcoin,ethereum,ripple', | |
| 'vs_currencies': 'usd' | |
| } | |
| response = requests.get(url, params=params) | |
| return response.json() | |
| def index(): | |
| prices = get_crypto_prices() | |
| return render_template('index.html', prices=prices) | |
| if __name__ == '__main__': | |
| app.run(debug=True) | |