RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Adding .py game to retropie ports

    Scheduled Pinned Locked Moved Help and Support
    retropiepyhtonraspbianretropiesetuppygame
    14 Posts 3 Posters 1.8k Views
    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.
    • S
      shou @sleve_mcdichael
      last edited by

      @sleve_mcdichael @mitu
      I am sorry for the very late response!

      My bash script looks like this:

      #!/bin/bash
      
      python3 /mnt/D/pycharm/Project/main.py
      

      I transfered the script via WINSCP to the ports location. I can access the file on my retropie but it gets executed and I immediately get back to the port location on my RetroPie.
      Anybody know the problem here?

      Thanks in advance!

      S 1 Reply Last reply Reply Quote 0
      • S
        sleve_mcdichael @shou
        last edited by

        @shou does the bash script work to launch your game, from the console?

        S 1 Reply Last reply Reply Quote 0
        • S
          shou @sleve_mcdichael
          last edited by

          @sleve_mcdichael

          Do you mean via the retroPie console with F4?
          I did not try it. What is the command for executing it via console?

          chmod +x /mnt/D/pycharm/Project/main.py
          

          Will this work out or do I need to use the location of the py. File which has been transferred on the retroPie under ports?

          S 1 Reply Last reply Reply Quote 0
          • S
            sleve_mcdichael @shou
            last edited by sleve_mcdichael

            @shou try executing the script with bash:

            bash ~/RetroPie/roms/ports/mygame.sh
            
            S 1 Reply Last reply Reply Quote 0
            • S
              shou @sleve_mcdichael
              last edited by

              @sleve_mcdichael
              It says there is no such file or directory.

              S 1 Reply Last reply Reply Quote 0
              • S
                sleve_mcdichael @shou
                last edited by sleve_mcdichael

                @shou replacing mygame.sh with the actual name of the scriptfile you made and placed into the "ports" folder, of course? Did you get the capital R and P in RetroPie?

                Let's back up.

                @shou said in Adding .py game to retropie ports:

                My bash script looks like this:

                #!/bin/bash
                
                python3 /mnt/D/pycharm/Project/main.py
                

                If you quit to console with F4 and use this command

                python3 /mnt/D/pycharm/Project/main.py
                

                ...does the game works? Or, how do you make it work, from outside of RetroPie? Have to make that part work, before we can make it work from inside.

                S 1 Reply Last reply Reply Quote 0
                • S
                  shou @sleve_mcdichael
                  last edited by

                  @sleve_mcdichael
                  yes, I considered the Capital R and P and I alos used the name of the originally file which i called "rungame.sh".

                  @sleve_mcdichael said in Adding .py game to retropie ports:

                  python3 /mnt/D/pycharm/Project/main.py

                  Using this command in console of retropie gives the same response as the previous one: No such file or directory.

                  Well to start the game outside of retropie I just open the python file which is saved on my Windows 10 Compter. Do I need to convert this file before uploading it to retropie?

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    sleve_mcdichael @shou
                    last edited by sleve_mcdichael

                    @shou said in Adding .py game to retropie ports:

                    python3 /mnt/D/pycharm/Project/main.py

                    Using this command in console of retropie gives the same response as the previous one: No such file or directory.

                    Well to start the game outside of retropie I just open the python file which is saved on my Windows 10 Compter. Do I need to convert this file before uploading it to retropie?

                    It looks like Python itself is unable to find the main.py file at that location. That looks like path to a mounted network drive; are you sure it is mounted right?

                    I think you need to either figure out your network mount, or actually copy the file onto the retropie instead of run it off the network mount.

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      shou @sleve_mcdichael
                      last edited by

                      @sleve_mcdichael
                      My bad, I explained it incorrectly.
                      The original file is located in my Hard drive D: on my windows 10.

                      I used WINSCP to connect from my windows 10 to my RetroPie. There I copied the file from my computer onto my RetroPie by drag and drop it in the Ports folder.

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        sleve_mcdichael @shou
                        last edited by

                        There I copied the file from my computer onto my RetroPie by drag and drop it in the Ports folder.

                        Then try:

                        python3 ~/RetroPie/roms/ports/main.py
                        

                        Or if you've put it in a subfolder,

                        python3 ~/RetroPie/roms/ports/subfolder/main.py
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.