1. UnsureSherlock

    UnsureSherlock Advanced Member
    Newcomer

    Joined:
    Aug 20, 2015
    Messages:
    85
    Country:
    United States
    Excellent work!

    Do you have any plans to bring over some of the more popular packages, such as numpy or matplotlib?
     
    TotalInsanity4 likes this.
  2. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    Yes, both are planned, but many scientific packages (e.g. the ones you named) require a Fortran compiler. This is in the works, though, so fear not. :)

    Also, after taking a short break (sorry 'bout that :P), I just finished implementing Savedata read/write, which means you can now start writing savedata editors for Switch games in Python. Here is some example code:

    import nx
    BOTW_TITLE_ID = 0x01007ef00011e000 # title IDs are just hexadecimal numbers
    botw = nx.titles[BOTW_TITLE_ID]
    with botw.savedata.open('0/save_game.sav') as savegame_file:
    # do something with savegame_file, it's just a regular file object​

    As you can see, I used the new nx package to get a botw Title object from nx.titles. Then I opened a file in botw's savedata, which provides me with a regular file object. It's that simple. (The open method takes the same arguments as pathlib.Path.open, in addition to the file_path as its first positional argument.)

    If you want to experiment a bit, there's also a TCP REPL example script which you can use as a replacement to your main.py. It allows you to enter Python code via your PC and let your Switch run it.

    Warning: Do not edit your savedata without backing it up, or you will risk losing it! As stated in the license of PyNX, nx and _nx, we cannot be held liable for any damage caused by the usage of the software. Be careful and create a backup before you edit a game's savedata.


    10 hours later...

    I just released v0.3.0-alpha (and I forgot to actually submit this post before, oops). It adds the aforementioned functions plus controller input:

    import nx
    while True:
    if nx.p1.a_button.is_pressed:
    print("a", end="")​

    Enjoy! :)
     
    Last edited by AileenLumina, Apr 22, 2018 - Reason: Updated TCP REPL script link
    jakibaki, lordelan and Brawl345 like this.
  3. pwsincd

    pwsincd Garage Flower
    Developer

    Joined:
    Dec 4, 2011
    Messages:
    3,611
    Masterwin, lordelan and AileenLumina like this.
  4. lordelan

    lordelan GBAtemp Psycho!
    Member

    Joined:
    Jan 4, 2015
    Messages:
    4,467
    Country:
    Germany
    That's such a great update! Can't believe no one is commenting on this. Really appreciate your work! PyNX is one of the most fun things to follow on the Switch these days. Please keep it up! :)
     
    AileenLumina likes this.
  5. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    Thank you!

    On that note, I'd like to announce that our first small community project will be a BotW savedata editor. This will be an opportunity for you to dive right into learning how to write Python homebrew for the Switch, so don't miss out! If you would like to join us, please check out our Discord community. No prior experience with Python required, as long as you're willing to learn, we'll be happy to get you started!

    Edit: I forgot to mention that v0.3.1-alpha was released a few days ago. It fixes multiple bugs and adds virtual buttons:

    abxy = (nx.p1.a_button, nx.p1.b_button, nx.p1.x_button, nx.p1.y_button)
    abxy_button = nx.Button.from_buttons(*abxy)

    abxy_button.is_pressed will be true if either A, B, X or Y is pressed. Enjoy! ^^
     
    Last edited by AileenLumina, Apr 4, 2018
    vgmoose, TotalInsanity4 and lordelan like this.
  6. MemeMachine

    MemeMachine Member
    Newcomer

    Joined:
    Jan 30, 2017
    Messages:
    16
    Country:
    United States
    That example script's link is broken

    EDIT: Found the new one
     
    Last edited by MemeMachine, Apr 6, 2018
    AileenLumina likes this.
  7. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    Thanks, I updated the link :)

    I had to take a short break due to final exams, but I've got a few weeks of time to work on this again. ^^
     
  8. Shrike

    Shrike GBAtemp Regular
    Member

    Joined:
    Mar 10, 2018
    Messages:
    120
    Country:
    Germany
    I feel you @____@ same here
     
  9. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    Added full multitouch support and fixed issues with savedata writing. A new release will be out tomorrow, hopefully.

    In the meantime,
    please take a few minutes to participate in this quick survey. Your answers will help shape the future of nx-python.

    Thank you for your time!
     
    lordelan likes this.
  10. lordelan

    lordelan GBAtemp Psycho!
    Member

    Joined:
    Jan 4, 2015
    Messages:
    4,467
    Country:
    Germany
    Great news. Did the survey. :)
     
    AileenLumina likes this.
  11. Ohex4455

    Ohex4455 Advanced Member
    Newcomer

    Joined:
    May 1, 2018
    Messages:
    78
    Country:
    Germany
    Why is Nintendo not releasing Netflix for Switch already!!1 :lol:
     
  12. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    I should probably mention that we now have a documentation, and there is a new release that fixes lots of bugs. Enjoy! :)
     
    lordelan and wicksand420 like this.
  13. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    This isn't really something new, but I'll post it here regardless for increased visibility. You can type Python code on your PC to be executed on your Switch using the TCP REPL example as your main.py.

    After you launch PyNX, connect to your Switch via a TCP client (Port 1337; you can find your Switch's IP address in the settings, under the "Internet" tab). On Linux, the command to do that is rlwrap cat | tee log.py | nc switch.ip 1337 (replace `switch.ip` with the IP address of your Switch). This also logs the input to log.py, which might be useful. You can exit the TCP REPL by typing exit().
     
    Cyan, lordelan, senas8 and 1 other person like this.
  14. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    New release: v0.4.1-alpha

    Fixes a bunch of bugs related to the controller input of player 1 as well as nx.utils.AnsiMenu
     
    lordelan likes this.
  15. cots

    cots Banned
    Banned

    Joined:
    Dec 29, 2014
    Messages:
    1,533
    Country:
    United States
    Amazing work! I see a bright future for Switch homebrew. I'm glad developers are interested in the console as the homebrew scene for the PS3/WiiU/3DS hasn't really produced anything other then a few game ports, emulators and utilities. It would be nice to see some original content popping up like in the NDS/Wii scene.
     
    AileenLumina likes this.
  16. YamiZee

    YamiZee GBAtemp Regular
    Member

    Joined:
    Aug 18, 2013
    Messages:
    241
    Country:
    Finland
    This should just be integrated to the actual homebrew launcher so fiddling around wouldn't be necessary.
     
    AileenLumina and TotalInsanity4 like this.
  17. Dontwait00

    Dontwait00 Unknown
    Member

    Joined:
    Sep 3, 2017
    Messages:
    272
    Country:
    Italy
    this leads to python developers to break out they own limits, putting the best apps on Switch now!
     
    AileenLumina likes this.
  18. Cyan

    Cyan GBATemp's lurking knight
    Former Staff

    Joined:
    Oct 27, 2002
    Messages:
    22,718
    Country:
    France
    You can only have one main.py in the same folder?
    you have to replace the file every time and only have one project at a time?

    I guess a launcher could be written in python?
    main.py to list sub-folders and other main.py projects?

    I didn't try yet, but thank you for making and maintaining this :)
     
    Last edited by Cyan, May 19, 2018
    AileenLumina likes this.
  19. Ritsuki

    Ritsuki ORAORAORAORA
    Member

    Joined:
    Mar 15, 2008
    Messages:
    1,554
    Country:
    Switzerland
    Why is this on the homepage only now ? Great news!
     
    AileenLumina likes this.
  20. AileenLumina

    OP AileenLumina Python main, software engineer and API designer
    Member

    Joined:
    Sep 27, 2015
    Messages:
    628
    Country:
    Germany
    You can give this loader a try. Use it as your main.py; it should display a simple file browser that allows you to select a Python program to run. It is intended to be a temporary workaround until this upstream issue is resolved. (Please report back if it works. :P )

    You can also use this TCP REPL script as your main.py for testing purposes.

    I wasn't confident enough about the stability of nx-python until today. That's why I decided to contact T-hug today, not earlier. :)
     
    Last edited by AileenLumina, May 19, 2018
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Homebrew, python, Create