I did not do anything clever. I just copied user-config.py from the pywikibot directory[1] to my own directory. I did that twice, using different names like user-config-one.py and user-config-two.py. Then I edited the two files to how I wanted. Each had a different user configured for the same family and language. Then I put a very simple script (shell/batch/Python, whatever is easy) in a PATH directory. Before running my pywikibot script, I would run the simple script to copy the appropriate config file to the pywikibot directory. I would then run the pywikibot login script to login, then run my bot program. I did not need to do that often, and I did not need to change users often, so it was not difficult to take those extra steps.
[1] https://www.mediawiki.org/wiki/Manual:Pywikibot/user-config.py
On Thu, Sep 8, 2022 at 5:58 PM info@gno.de wrote:
Sorry I cannot follow this approach. Can you explain?
Best
xqt Von: Johnuniq wp.johnuniq@gmail.com Gesendet: 08.09.2022 09:23 An: Pywikibot discussion list pywikibot@lists.wikimedia.org Betreff: [pywikibot] Re: authenticate as bot and sysop
how You use different configs in the same script?
In my case, I would first run a script to select which user I needed and that script copied the appropriate user-config file. After that, I would run a second script that used pywikibot. I have not tried YiFei Zhu's solution. _______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org