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.


    Codeshare: (Animated View)

    Pythonista
    2
    3
    2605
    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.
    • TutorialDoctor
      TutorialDoctor last edited by TutorialDoctor

      The following code animates a custom view in and out with the press of a button.
      For now, the setup is automatic. Once I find a way to neatly distribute pyui files, I will update this code.

      I will try to make useful projects for beginners.

      Link to Code
      Link to Image

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

        With this script (in the same directory) you can copy your pyui file to the clipboard and then via webinterface in a new github file.

        import os
        import sys
        import clipboard
        
        path = os.getcwd()
        files = []
        for item in sorted(os.listdir(path)):
          if '.pyui' in item:
            print item,
            files.append(item)
        print
        print
        if len(files) == 1:
          filename = raw_input('Please choose pyui file or press return for [' + files[0] + ']: ') or files[0]
        elif len(files) > 1:
          filename = raw_input('Please choose pyui file: ')
        else:
          print 'Sorry no pyui file found!'
          sys.exit()
        
        if not '.pyui' in filename:
          filename += '.pyui'
        
        if os.path.exists(filename):
          path += '/' + filename
          file = open(path, 'r')
          clipboard.set(file.read())
          file.close()
          print filename + ' is in clipboard.'
        else:
          print "Can't find " + filename
        
        1 Reply Last reply Reply Quote 0
        • TutorialDoctor
          TutorialDoctor last edited by

          Thank you. I have found another way to do this also last night.

          I created two actions that can quickly convert from .pyui to .json and back again.

          Github link

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