You are viewing a single comment's thread from:

RE: Python Libraries: Splinterlands SPS Auto-Staker v.1.2

in STEMGeekslast year

Code looks good.
I looked at it for a moment and could not improve anything substantial.

Just to be a smartass:

https://github.com/BrynRogersTHG/HIVE-Blockchain---Hive.Engine-SPS-AutoStake/blob/main/StakeSPS_1.2.py#L130

So, the line 131 is only to print a new line?
Add a \n for newline, maybe... saves 1 line of code :P

print(f' - Waiting {delaymins} minutes before staking again...\n')

As for the the values, that a user would need to configure, I use a config.py.
Then in the main you can import config and use for example config.username.

Makes the code longer but easier to use for an outsider.

Also maybe mention the requirements (beem, hiveengine, pycoingecko) in the description.

Anyways: If it works, it works.

Sort:  

Add a \n for newline, maybe... saves 1 line of code :P

Sad to say I have been doing an intensive Udemy course and have come across this, so I do know about. The printing a blank line is old conventions.

As for the the values, that a user would need to configure, I use a config.py.
Then in the main you can import config and use for example config.username.

Yes, am familiar with multi-files and importing. The next open source project I will be adding to GitHub is my RandomVoter project. This currently has all the accounts in a single script, but would be better formatted in what you describe above.

Also maybe mention the requirements (beem, hiveengine, pycoingecko) in the description.

Yes, need to add these to the Readme.MD file.