You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
545 B

from steam.client import SteamClient, EMsg
from steam.enums import EResult, ECurrencyCode
client = SteamClient()
@client.on(EMsg.ClientWalletInfoUpdate)
def print_balance(msg):
bucks, cents = divmod(msg.body.balance64, 100)
print("Current balance is {:d}.{:02d} {:s}".format(bucks,
cents,
ECurrencyCode(msg.body.currency).name
))
client.cli_login()
client.disconnect()