0

I have made a program that takes infrared values serially, transmits them them to another program(the one im having trouble with), and uses the win32 python api to react to a matched value. It all works, but I need this program to run on the startup of my computer.

It uses the IDLE python shell to run, and I need to open/run the file directly from that program. Is there any way to do this? I can't just put a shortcut into the startup directory because its an unrecognized file, and it needs to be run, not just opened. Any help would be great, thanks!

  • 1
    Why does it need to IDLE shell to run? If it can't run from the command line, then you're going to have to run IDLE at startup, and that won't do you any good. But I'll bet it doesn't _actually_ need the IDLE shell to run, so if you can tell us why you _think_ it does, there might be a programming problem to solve buried under your SU problem. – abarnert Dec 11 '13 at 00:13
  • Thanks. I found this, http://stackoverflow.com/questions/15736898/running-shell-script-through-cygwin-on-windows , which is similar to my problem, would i just rewrite it like this? C:\python27\test.file? – Adam the Mediocre Dec 11 '13 at 00:14
  • @AdamtheMediocre NO. Check Monkeyanator's answer. – Apache Dec 11 '13 at 00:15
  • I think it needs the idle shell to run because it is not able to be opened by any program but it. I'm sure that's a terrible presumption to make, but the only information i can get from it, is that it is a file. – Adam the Mediocre Dec 11 '13 at 00:16
  • @abarnert: thanks, flagged it. (you can remove your comments, I'll remove mines as well.) – Apache Dec 11 '13 at 00:25

2 Answers2

4

Create a batch file with the line start C:\python27\python.exe D:your_program_location\your_program.py'

Drag the batch file from desktop to "Start - All Programs - Startup". That should do the trick.

Monkeyanator
  • 1,346
  • 2
  • 14
  • 29
0

It sounds like your actual problem is just that you didn't put the right extension on the file.

Just rename it to, e.g., script.py, or script.pyw, and, unless you've changed the settings from the default, that should open the file with the command-line or windowed Python launcher, which will just run it.

If you've changed your settings so .py files open in IDLE instead of in the Python launcher… is there a reason you want those weird settings? If not, just undo it.

abarnert
  • 354,177
  • 51
  • 601
  • 671