5 Replies - 2748 Views - Last Post: 25 November 2012 - 01:15 AM Rate Topic: -----

#1 theace  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-November 12

how to open a program in idle from another program?

Posted 21 November 2012 - 06:43 PM

So i have been trying to make a program to open a ready made program from one central program which i could do except i want to open it in idle so i can edit and add.

Ps. I just recently started to program in python and i only know the basics
Is This A Good Question/Topic? 0
  • +

Replies To: how to open a program in idle from another program?

#2 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: how to open a program in idle from another program?

Posted 22 November 2012 - 01:07 PM

I can't find any documentation that suggests IDLE can have an editor window with a file loaded into it programatically.
Was This Post Helpful? 1
  • +
  • -

#3 Nallo  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 163
  • View blog
  • Posts: 255
  • Joined: 19-July 09

Re: how to open a program in idle from another program?

Posted 24 November 2012 - 11:42 AM

Idle editor can be started from a shell
idle-python2.6 -e someprogram.py


(idle-python2.6 is the name for idle on my machine, it might be different on yours)

So it can be opened from a python program.
import os
to_open = "someprogram.py"
os.system("idle-python2.6 -e %s" %to_open)



There are some subtle problems though(that I don't really understand) when there is already an Idle shell open.
Was This Post Helpful? 2
  • +
  • -

#4 theace  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-November 12

Re: how to open a program in idle from another program?

Posted 24 November 2012 - 05:08 PM

thank you it worked perfectly
Was This Post Helpful? 0
  • +
  • -

#5 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: how to open a program in idle from another program?

Posted 24 November 2012 - 11:48 PM

ahh I couldn't find the -e flag, good find.
Was This Post Helpful? 0
  • +
  • -

#6 Nallo  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 163
  • View blog
  • Posts: 255
  • Joined: 19-July 09

Re: how to open a program in idle from another program?

Posted 25 November 2012 - 01:15 AM

View Postatraub, on 25 November 2012 - 06:48 AM, said:

ahh I couldn't find the -e flag, good find.


That is actually in the online documentation at http://docs.python.o...brary/idle.html at the very bottom :)/>

Though I was helped by the fact that Ubuntu created their own man page for Idle (capital I) that probably doesn't exist on other *nix. Otherwise I might not have found it or not bothered to look it up.

This post has been edited by Nallo: 25 November 2012 - 01:18 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1