Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Os.startfile in Windows.
#9
Gribouilli Wrote:
Malt Wrote:it is actually running and it is not allowing to edit the code.
This is in contradiction with fishhook's reply above. Now the problem is to understand what's going on. Does it do the same if you do
import webbrowser
webbrowser.open(<absolute path to your python file>)
It will all depend on what file association .py is set to in Windows.
If i set file association in Windows for .py to Notepad++,then this code will open hello.py in Notepad++.
import webbrowser

webbrowser.open(r'E:\div_code\hello.py')
If i chance back to root\python.exe will try to run hello.py.


Gribouillis Wrote:Also what happens if you call
import os

os.startfile("spam.py", "edit")
edit is removed from most newer Windows version.
It will all fail with .py.
import os

# Work with know print formates  format like txt,pdf,images... 
os.startfile("test.txt", "print")

# Fail
os.startfile("hello.py", "print")
Reply


Messages In This Thread
Os.startfile in Windows. - by Gribouillis - Aug-01-2019, 07:35 AM
RE: Os.startfile in Windows. - by fishhook - Aug-01-2019, 07:50 AM
RE: Os.startfile in Windows. - by Gribouillis - Aug-01-2019, 07:59 AM
RE: Os.startfile in Windows. - by fishhook - Aug-01-2019, 08:35 AM
RE: Os.startfile in Windows. - by snippsat - Aug-01-2019, 02:35 PM
RE: Os.startfile in Windows. - by Gribouillis - Aug-02-2019, 05:39 AM
RE: Os.startfile in Windows. - by Malt - Aug-02-2019, 06:55 AM
RE: Os.startfile in Windows. - by Gribouillis - Aug-02-2019, 07:28 AM
RE: Os.startfile in Windows. - by snippsat - Aug-02-2019, 08:20 PM
RE: Os.startfile in Windows. - by Gribouillis - Aug-02-2019, 09:06 PM
RE: Os.startfile in Windows. - by snippsat - Aug-02-2019, 09:20 PM
RE: Os.startfile in Windows. - by Gribouillis - Aug-03-2019, 07:35 AM
RE: Os.startfile in Windows. - by Malt - Aug-08-2019, 05:15 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020