omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Amegon

    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.


    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    Amegon

    @Amegon

    0
    Reputation
    657
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Amegon Unfollow Follow

    Latest posts made by Amegon

    • RE: How to use « def f(...)

      I guess you speak about a beginner question, please correct me if I am wrong.
      def ... is used to define a method/function

      def <name>([<parameter_name>[, <parameter>]]):
      Command1
      Command2
      Command3
      ...

      Make sure to have a ':' at the end of your def and to add a defined number of spaces for all lines inside your method.

      def f(foo):
        return foo**2
      

      Either create a new file, enter those lines and press on the play button upper right, or swipe to the right until you are in Console and enter the lines there. Also there you can test your method by writing f(2)

      You can also add a print outside method define, this should make sure to make pythonista switch automatically to console view when you execute it (since it would generate an output there)

      posted in Pythonista
      Amegon
      Amegon
    • RE: syncing Pythonista / laptop

      I also took another approach: write a socket program, define some bytes to request files, checksums etc. something to send files, to receive files, and run the script on pc and pythonista device. add a dict to store timestamp and md5 +pickle to save to file.

      This way I ‚sync‘ files between iphone and Pc and can work on both.
      Only important thing: whenever you change code, run a sync before changing it on the other device as well. If both timestamps differ and md5 differs then sync creates a file version of your own and one of the remote file.

      Then just add that folder on your pc to your preferred version control and do the backup/committa there.

      posted in Pythonista
      Amegon
      Amegon