davidteather / BackpackTf-API

Unoffical Backpack.tf wrapper in python
https://davidteather.github.io/BackpackTf-API/
MIT License
14 stars 7 forks source link

Did you know how to make this #6

Closed Enzotoy closed 4 years ago

Enzotoy commented 4 years ago

Hello @davidteather ,

i made this code and i want than the result of listings can be write on the listing.json but i don't know how to make this, I tried to dump the result but nothing work :/

the code : image

Ty for help

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.94. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

davidteather commented 4 years ago

Try to specify the tradable, craftable parameters and take out the other parameters that you are passing blank strings into.

Enzotoy commented 4 years ago

the fonction listings works, but he didn't write in the listings.json, i can see the result only by a "print(listings)"

davidteather commented 4 years ago

try

fischer = open("listings.json", "w")
json.dump(listings, fischer)
fischer.close()
Enzotoy commented 4 years ago

i tried and no, it's not worked :/

davidteather commented 4 years ago

maybe try

with open('listings.json', 'w') as outfile:
    json.dump(listings, outfile)

I'm closing this either way because it's not related to this api. Try googling "how to write json to file python"