• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Python coding from libertine ?

Scheduled Pinned Locked Moved Libertine
9 Posts 3 Posters 885 Views 1 Watching
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.
    • M Offline
      marek_python
      last edited by 21 Jul 2021, 18:02

      Hi community,
      I'd appreciated your thoughts on Python scripting on UT.
      It's no surprise (now) to me that I can't install python packages via pip using terminal app since apt install python3-pip won't work.

      Libertine is the way to go. I could install pip from what I remember but now I wonder how I go about scripts that use Python's socket module ? Will I be able to use scapy from within the container ? I'm getting tablet running UT so I'm thinking about my options.

      Have you done any scripting using socket module ? How did you go about it ?

      1 Reply Last reply Reply Quote 0
      • D Offline
        dobey
        last edited by 21 Jul 2021, 18:06

        Yes, you should be able to install any Python module you need (so long as it is available to install on your device's architecture), with pip inside a Libertine container.

        You may have an issue if you are trying to run something in perpetuity within the container as a server for example, or in some certain other situations, but in general most things should just work as normal. Just remember that there is no sudo in the container, and you should not install it in the container as it will cause things to break.

        M 1 Reply Last reply 21 Jul 2021, 18:22 Reply Quote 1
        • M Offline
          marek_python @dobey
          last edited by 21 Jul 2021, 18:22

          @dobey
          I'll probably run into some issues then. Because scapy won't run without superuser privileges. I gotta find a way.

          D 1 Reply Last reply 21 Jul 2021, 18:40 Reply Quote 0
          • D Offline
            dobey @marek_python
            last edited by 21 Jul 2021, 18:40

            @marek_python Why would scapy need that? But you can also run libertine-container-manager exec -i xenial -c bash for example to get a "root" (it's an unprivileged container, but in fakeroot mode in this case).

            M 2 Replies Last reply 21 Jul 2021, 18:46 Reply Quote 0
            • M Offline
              marek_python @dobey
              last edited by 21 Jul 2021, 18:46

              @dobey
              I'll defo try that. Thank you @dobey

              Perhaps someone else will chime in with different experience.

              1 Reply Last reply Reply Quote 0
              • M Offline
                marek_python @dobey
                last edited by marek_python 21 Jul 2021, 19:36

                @dobey
                Great news. I've just tried the fake root on my UT phone and scapy worked fine. No permission errors. Exciting times ahead. 🙂

                Is it just on my phone or Terminal app crashes under screen lock ? It crashed twice after unlocking screen.

                D 1 Reply Last reply 21 Jul 2021, 19:41 Reply Quote 0
                • D Offline
                  dobey @marek_python
                  last edited by 21 Jul 2021, 19:41

                  @marek_python The terminal app, and any child processes running in it, get paused when the screen locks. It shouldn't be crashing.

                  M 1 Reply Last reply 21 Jul 2021, 20:14 Reply Quote 0
                  • M Offline
                    marek_python @dobey
                    last edited by 21 Jul 2021, 20:14

                    @dobey
                    I'll be testing it and if it keeps crashing on my devices I'll report it as an issue so the community knows.

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      kugiigi
                      last edited by 22 Jul 2021, 09:28

                      Disable app suspension for the terminal app on the tweak tool if you want.
                      Also, if you plan to create apps, you can try Seabass. It's a great code editor and supports creating a libertine container for building via clickable.

                      1 Reply Last reply Reply Quote 0
                      9 out of 9
                      • First post
                        9/9
                        Last post