• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Executing python in js - troublshooting/development

Scheduled Pinned Locked Moved Troubleshooting
18 Posts 2 Posters 1.4k Views 2 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.
  • S Offline
    sdetweil @beejay22
    last edited by sdetweil Aug 25, 2020, 11:22 PM Aug 25, 2020, 11:05 PM

    @beejay22 I don’t understand why u have trouble.

    the 3 files I posted work together as u designed.

    does your spawn(‘/use/bin/python’, [execname]) work to return the data.
    console log to see

    spawn and exec have different methods of returning the data. see the doc

    Google search nodejs process spawn

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • B Offline
      beejay22
      last edited by Aug 25, 2020, 11:21 PM

      Did you try it with the pyscript? Or are you talking about it the core module, node_helper and config?

      And okay

      S 1 Reply Last reply Aug 25, 2020, 11:24 PM Reply Quote 0
      • S Offline
        sdetweil @beejay22
        last edited by sdetweil Aug 25, 2020, 11:25 PM Aug 25, 2020, 11:24 PM

        @beejay22 I am only working on inside MagicMirror

        the spawn on.data() gets called when the pgm launched outputs to stdout. my print hello

        of course I made sure the python script worked both ways, before showing that

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • B Offline
          beejay22
          last edited by Aug 25, 2020, 11:30 PM

          Okay. And yes it does return the data as output I believe

          S 1 Reply Last reply Aug 26, 2020, 12:07 AM Reply Quote 0
          • S Offline
            sdetweil @beejay22
            last edited by sdetweil Aug 26, 2020, 12:11 AM Aug 26, 2020, 12:07 AM

            @beejay22 do you see this output from the node_helper in the terminal window where you do npm start?

            console.log(data.toString())

            from your python script

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • 1
            • 2
            • 1 / 2
            1 / 2
            • First post
              18/18
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy