• Kluesi

    Hi

    I just bought Pythonista 3 for syncing Pythonista files between iPhone 6S and iPhone 4S. I am connected to iCloud on both devices to the same iCloud account. On both devices I see an iCloud folder and I can put files in it but it seems that both devices have a different iCloud folder. I don't see any files in the iCloud folder on the other device.

    Whats wrong?

    Thanks Jens

    posted in Pythonista read more
  • Kluesi

    Thats funny. I worked on this code many hours and right after I posted the problem I found the solution. After v.close() I put v.wait_modal() and then it works. It seems that the close process is not completely done when the next command is interpreted. Wait modal waits until the view is completely closed. May be a workaround but for me it is ok.

    posted in Pythonista read more
  • Kluesi

    Hi

    I want to present a view with a tiny little ui design. I use a dialogs.list_dialog to choose between options at the beginning. Everything works fine. Now I want to put this in a loop. The ui is visible, I choose the option, I do anything and when I finish this part I want to show the list_dialog again. But at the second time I get the Message: The view is already beeing presented. I analyzed some combinations and I see that everytime the ui.on_screen is true, the dialog comes up with the error message. If it is false everything is fine. It is false when I press the cross button of the ui. Then I come to the dialog again and the view ist not ui.on_screen.

    Now the question. How can I close the ui in the script so that ui.on_screen is false? ui.close and ui.View.close(v) does it not. When I close the view, ui.on_screen is already true.

    Thanks Jens

    posted in Pythonista read more
  • Kluesi

    Hi

    I want to add a greyscale image (a logo) to a picture. I wrote a little ios pythonista app in which I open a picture from an album and show it on the view in an ui.imageview. This works.

    And the other magic is missing. I want to show the logo (I have the black logo on a white background as an jpg or png image) on the loaded picture. I want to change the size of the logo by using two fingers and I want to move the logo by using one finger. The last step is to combine both pictures and save the result in an album.

    1. How to show only the non white parts of the logo on my picture
    2. How to move it with one finger
    3. How to chsnge the size with two fingers

    Many thanks

    Kluesi

    posted in Pythonista read more
  • Kluesi

    Thanks for the answers. Now I know what is wrong. I didn't mentioned that animated() ist a kind of separate thread and the following codelines ar interpreted while animate() is running.

    Thank you

    posted in Pythonista read more
  • Kluesi

    Hi

    I use Pythonista in Version 2.1.1 (211008) on my iPhone 6 and I want to fade in and fade out a Label on a UI view. I found many examples but none of them works for me.

    The scenario: The User of my app presses a button and in the background somthing happens. But the user gets no feedback. So I placed a Label on the screen center and after the button press event I want to show the label a secound and hide it.

    I found the animate() function and tried it this way:


    def showInfo(Infotext, aView):
    def doAnimation():
    aView['MyLabel'].alpha=1

    aView['MyLabel'].text='This is my message'
    ui.animate(doAnimation)


    If i call the showInfo function the Label fades in on the screen. This works. But after a second I want to fade out the label. I tried many ways to implement a fade out but none of them works. I tried to define an second function called doAnimation2 with aView['MyLabel'].alpha=0 and called it the same way like doAnimate. I also tried to set the alpha value to 0 after the ui.animate call. But the label dosen't show. No fade in, no fade out. I also serached for a definition of the animate function but I only found a very small doku about this.

    So, please help me.

    1. How can I fade in and after a secound fade out my label in the example above?

    2. What does the ui.animate function do exactly and what are the parameters of this function.

    Many thanks

    kluesi

    posted in Pythonista read more
  • Kluesi

    Hi

    1. How can I print from the iPad using a AirPrint printer?

    2. How to print on a standard (old) parallel LPT Interface Printer? E.g. over a printserver. But how to print images and so on?

    Thanks

    posted in Pythonista read more
  • Kluesi

    Hi

    I have something like

    x = [ [1, 2, 'Car'], [ [3, 4, 'House'], ... ]

    Is there an easy way to write it to a file and read it from a file? E.g. something like

    x.tostring() = ' [ [1, 2, 'Car'], [ [3, 4, 'House'], ... ]'

    or something else.

    Thanks Jens

    posted in Pythonista read more
  • Kluesi

    Hi

    I load an image on Class Definition:

    ---SNIP---
    Class XYZ (Scene)
    board=load_image_file('animage.jpg')
    ...

    def draw(self):
    image(self.board,1,1,426,320)
    ---SNIP---

    Here I get a white rect, but no image. I also tried to load the image in "def setup(self):" but I get the same white rect. Only if I load the image directly in the draw procedure just before the image(...) then I get the image.

    But is this the right way. I think this draw procedure runs 60 times a second. And so I also load this image 60 times.

    How do I load the image the right way.

    Thanks Jens

    posted in Pythonista read more
  • Kluesi

    Thats it. Thank you.

    posted in Pythonista read more
  • Kluesi

    Hi

    I am using Pythonista for iOS and I am new in the Python language. I wrote some scripts with "ui" and some with "scene" and I tested the compile modules (compile, compileall, py_compile). After that, changes in scripts did not effect in runtime. For example: I have a script "abc.py". And I compiled this script and I get an "abc.pyc". So every change in the "abc.py" did not effect in runtime. So I delete the "abc.pyc" but I have the same problem. Actually I have nor ".pyc" files but nothing happens.

    The exact problem is that I have a Python Script with an UI. If I press a button I start another Script with a scene module. If I change something in the script with the scene module I see no effect while running the App. Meanwhile I delete the complete content of my draw procedure but nothing happens.

    Can anybody help me?

    Thanks Jens

    posted in Pythonista read more
  • Kluesi

    Hi

    Thanks for your answer. Yes, I create my UIs in the ios Pythonista Editor. If I want to create a new UI I press the "+" Sign in the upper left corner. After that I have to choose one of these options: "Script with UI", "Plain Text File", "Scene with Layers", "Basic Scene" and "Empty Script". So I think I have to create the 3 UIs with "Script with UI". After creating my 3 UIs i have:

    configure.py
    configure.pyui
    login.py
    login.pyui
    play.py
    play.pyui

    Now I need a Script to manage these three UIs. So I create an "Empty Script" with the name "MyGame.py". At first I want to show the login UI and (as an example) if I press the Button "Login" I see the play UI.

    1. How can I show the login UI out of MyGame.py?

    2. The Login Button in login.py has its own action in login.py. How can I change from login.py to play.py ?

    3. Do I have to import the three UIs into MyGame.py?

    Thanks Kluesi

    posted in Pythonista read more
  • Kluesi

    How can I transfer Scripts (.py) and UIs (.pyui) between differen devices like an iPhone and an iPad?

    posted in Pythonista read more
  • Kluesi

    Ok, i tried to use the view element. And I already create a subview but how do I create another subview. Maybe I do not see the right Button to create another subview. Could you help me?
    Thanks

    posted in Pythonista read more
  • Kluesi

    Hi

    I am new in Python especially in Pythonista for iOS. But it looks very interesting. I want to create a little private game for me and my friends. I need to build more then one UI. A Login Screen, a config screen and so on. But which is the right way to create all UIs I need and how can I show these UIs?

    Many thanks

    Kluesi

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!