omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Prefill textfield with text and variables

    Pythonista
    prefill string & variab textview
    2
    2
    1293
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robStacks
      robStacks last edited by robStacks

      How can i prefill a textfield with strings and variables combined?
      This code gets me an expected string error:

      if delta.degrees < 0:
      			sometext = ('B:', int(delta.degrees + 360), 'D:', int(delta.magnitude))
      		else:
      			sometext = ('B:', int(delta.degrees), 'D:', int(delta.magnitude))
      
      		tv['textfield1'].text = sometext
      

      What am i doing wrong?

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by ccc

        Those values are tuples in the code above.

        sometext = str(('B:', int(delta.degrees), 'D:', int(delta.magnitude)))

        sometext = f'B: {delta.degrees}, D: {delta.magnitude}'

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Powered by NodeBB Forums | Contributors