• Obelisk

    Theres a few apps with playing music that wont be stopped by ios in 3 minutes, i dont know why, do u mean iOS free up the RAM automatically?

    posted in Pythonista read more
  • Obelisk

    Its a good idea,what background stuff to do normally?If use loop?

    Other questions:how to play mp3 after turning off screen?why couldnt i put mp3 in a not current folder to play?

    posted in Pythonista read more
  • Obelisk

    Memory management, del object.

    posted in Pythonista read more
  • Obelisk

    Background music play.

    posted in Pythonista read more
  • Obelisk

    I'd love to study the Tutorials.

    posted in Pythonista read more
  • Obelisk

    One time i found that,but its my own fault,if i open one script while another script is still running and i use editor.replace,the script'contents will be replaced.

    posted in Pythonista read more
  • Obelisk

    1. I wanna try editor.replace_text, it works well in example, but if i add editor.make_new_file, it wont work after editor.make_new_file, is there any way to make it?
    2. Is there any way to make other language syntax highlight in editor and no need to run?

    posted in Pythonista read more
  • Obelisk

    Thanks very much,what to do next?use default theme or blackboard theme?

    posted in Pythonista read more
  • Obelisk

    Amazing, Mapview example.

    posted in Pythonista read more
  • Obelisk

    Many thanks. Could u give an example to make other language syntax highlight in editor and no need to run?

    posted in Pythonista read more
  • Obelisk

    Pretty cool,i would make effort to check it out.

    posted in Pythonista read more
  • Obelisk

    Sorry,i dont use 1.6 beta,please ignore below:

    #Comment/Uncomment selected lines
    
    import editor
    
    text = editor.get_text()
    selection = editor.get_line_selection()
    selected_text = text[selection[0]:selection[1]]
    is_comment = selected_text.strip().startswith('#')
    replacement = ''
    for line in selected_text.splitlines():
        if is_comment:
            if line.strip().startswith('#'):
                replacement += line[line.find('#') + 1:] + '\n'
            else:
                replacement += line + '\n'
        else:
            replacement += '#' + line + '\n'
    
    #import editor
    editor.make_new_file('tmp', 'test')  # quotes around tmp
    #editor.set_selection(0, 4)           # 4 instead of 5
    editor.replace_text(0, 4, 'good')    # 4 instead of 5
    
    editor.replace_text(selection[0], selection[1], replacement)
    editor.set_selection(selection[0], selection[0] + len(replacement) - 1)
    
    

    posted in Pythonista read more
  • Obelisk

    Thanks, i thought wrong, but as if replace_text dont work yet.

    posted in Pythonista read more
  • Obelisk

    I mean add

    editor.make_new_file(tmp, 'test')
    
    editor.set_selection(0, 5)
    
    editor.replace_text(0, 5, 'good')
    

    before replace_text, then all replace_text dont work, how to make it?

    posted in Pythonista read more
  • Obelisk

    In the latest beta,other languages highlight in editor?

    there's an example in editor module tourial,it works well,but if i add make_new_file before replace_text it wont work. I will try other functions.

    #Comment/Uncomment selected lines
    
    import editor
    
    text = editor.get_text()
    selection = editor.get_line_selection()
    selected_text = text[selection[0]:selection[1]]
    is_comment = selected_text.strip().startswith('#')
    replacement = ''
    for line in selected_text.splitlines():
        if is_comment:
            if line.strip().startswith('#'):
                replacement += line[line.find('#') + 1:] + '\n'
            else:
                replacement += line + '\n'
        else:
            replacement += '#' + line + '\n'
    
    editor.replace_text(selection[0], selection[1], replacement)
    editor.set_selection(selection[0], selection[0] + len(replacement) - 1)
    
    

    posted in Pythonista read more
  • Obelisk

    Worth collecting and study.

    posted in Pythonista read more
  • Obelisk

    Thanks in advance,
    sorry,i didnt say it clearly,so edit again:by using code

    1. how to not show keyboard when tapping in editor by using code?
    2. how to delete the file in the specific directory by using code?
    3. how to pause 1 second?
    4. how to use c language simple code?
    5. what is block comment?
    6. i want some math examples.

    posted in Pythonista read more
  • Obelisk

    Much obliged. sorry,i didnt say it clearly,so edit again:by using code

    1. how to not show keyboard when tapping in editor by using code?
    2. how to delete the file in the specific directory by using code?

    posted in Pythonista read more
  • Obelisk

    1.How to get Syntax-highlight Python code on screen while running, e.g. this:

    import random
    print 'hello'
    print random.randint(42)
    

    will turn into this Syntax-highlight Python code on screen while running?

    Another questions:

    1. Is it possible to control(copy&paste ect) editor with code's function?

    2. How to read a .py file into a string or list?

    posted in Pythonista read more
  • Obelisk

    A thousand thanks.

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!