×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Looking for some direction with a python project

Looking for some direction with a python project

Looking for some direction with a python project

(OP)
Have Python source code in Unix that runs automatically from rc.local at startup which continually
- monitors several Analog and Digital inputs
- displays any changes based on these inputs

Looking to make a rudimentary external CLI interface that would provide virtual inputs in parallel with the existing inputs

Basically using a Unix Shell Scripts I am wanting to do something like:

CODE

Description                              Shell Script            Python
read current value of Input 1            Digital 1               get current value of Digital 1 
override current value of Input 1        Digital 1 On            override Digital 1 Value
override current value of Input 1        Digital 1 Off           override Digital 1 Value
read current value of Input A            Analog A                get current value of Analog A
override current value of Input A        Analog A 100            override current value of Analog A
override current value of Input A        Analog A 0              override current value of Analog A 

Not sure if there is any way to interact and or interchange data directly with a running program due to scoping and OS protections

The simplest way would be to just change a text file and have the main program read the values looking for any changes ... windows internally uses messaging to pass in and out data to/from other running processes ... briefly looked over Threading in Python and wondering if it might have some mechanism that might provide some way to interchange/share data?

Basically I am expecting the Main Process needs to have a TRUE set of Global/Shared variables such that both the running and an external program can affect the values

The Main logic would then monitor both the real input and the virtual input and update the display for the input that changed

Thoughts?

RE: Looking for some direction with a python project

First check if you can talk to the program started by rc.local. Just a simple TCP or UDP socket - don't bother with pipes: too much trouble to get them working. You may have to set sticky bits.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close