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.


    Broken Logic?

    Pythonista
    2
    2
    1203
    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.
    • techteej
      techteej last edited by

      Not quite sure If I'm doing this right, as when I call the function, nothing gets printed.

      def search_files():
          dir_items = listdir(getcwd())
          query = v['searchbox'].text
          if query in dir_items:
              print 'IT WORKED'
          else:
              print 'IT DID NOT WORK'
      
      1 Reply Last reply Reply Quote 0
      • JadedTuna
        JadedTuna last edited by

        @techteej, probably your function gets interrupted somewhere. Add print statements after each line, like so:

        def search_files():
            print 'ENTERING FUNCTION'
            dir_items = listdir(getcwd()) # from os module?
            print 'GOT FILES'
            query = v['searchbox'].text
            print 'GOT SEARCH TEXT'
            if query in dir_items:
                print 'OH HEY IT WORKED'
            else:
                print 'IT DIDNT WORK'
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors