Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. jartigag (jartigag@mastodon.social)'s status on Saturday, 03-Mar-2018 14:31:44 EST jartigag jartigag

    ???? coding in #python, a question has ocurred to me:

    while True:
    ...while True:
    ......try:
    .........if args.arg1:
    ............if not condition1: break
    .........if args.arg2:
    ............if not condition2: break
    .........doThings()
    .........sleep(100)
    ......except Exception as e:
    .........print(e)
    .........pass
    ...sleep(100)

    how can i avoid these two inelegant 'while True' while checking conditions before doThings()?

    (don't want to use endless if-elif-..-else, please)

    In conversation Saturday, 03-Mar-2018 14:31:44 EST from mastodon.social permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.