• Dear visitors,

    The email issue has been finally solved.
    Thank you for your patience and happy browsing.

    Team ACM.

QUESTION Asetto Corsa import requests

ulkers

New Member
Hello everyone, I am new among you.

I'm developing my first AC app and I need help

The app will work like this :
1-)User will select the city they are in for the weather
2-)WeatherAPI request will be made
3-)Weather in the game will change according to the returned result

There is an error during import requests, but what could be the reason?


Import :

Code:
import ac
import acsys
import requests
#from  apps.python.system.acsys import *
from third_party.sim_info import *
App Source :

Code:
appName = ">Test<"
width, height = 800, 800  # width and height of the app's window
simInfo = SimInfo()


def acMain(ac_version):
    global appWindow

    appWindow = ac.newApp(appName)
    ac.setTitle(appWindow, appName)
    ac.setSize(appWindow, width, height)

    ac.console("Test")
    complete_url = "http://api.openweathermap.org/data/2.5/weather?q=ankara&appid=60b990c34864a0c37e088efdf1cdf9bd&units=metric"

    response = requests.get(complete_url)
    ac.console(response)

    ac.addRenderCallback(appWindow, appGL)
    return appName

Console Error :


Py_Log :





 

fughettaboutit

aka leBluem
Show folder structure of your app, its not finding "requests.py"...

acMain should return "Test", the name of the app folder!

Btw there is live weather already, in ContentManager enable "Real Conditions", and in the "three-dots-menu" select "Local weather"
upload_2024-6-23_8-53-56.png
 
Top