How to convert demo code to standlone code?

hi, recently i’ve been looking through the demos, and found several cool snippets i thought i could base my ideas off of. Though, after looking through the code, i found that the following code is causing all my headache:
if name == ‘main’:
import sys,os
import run
run.main([’’, os.path.basename(sys.argv[0])] + sys.argv[1:])

how do i convert this code into a standalone program? thanks alot :smiley:

···


www.programer.name - my own personal blog : )

The mind is its own place, and in itself can make a heav’n of hell, a hell of heav’n. What matter where, if I be still the same, and what I should be, all but less than he whom thunder hath made greater? Here at least we shall be free; th’ Almighty hath not built here for his envy, will not drive us hence: Here we may reign secure, and in my choice to reign is worth ambition though in hell: Better to reign in hell, than serve in heav’n.

— John Milton, in his epic poem Paradise Lost

Saturday, December 17, 2005, 9:50:48 PM, Jason Wang wrote:

hi, recently i've been looking through the demos, and found several
cool snippets i thought i could base my ideas off of. Though, after
looking through the code, i found that the following code is causing
all my headache:

if __name__ == '__main__':
    import sys,os
    import run
    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])

how do i convert this code into a standalone program? thanks alot :smiley:

All demos _are_ standalone programs thanks to the code you mentioned.
Just make sure the file "run.py" is in the same directory you're
trying to run the demo.

-- tacao

No bits were harmed during the making of this e-mail.

Has there been any success embedding the Shell.FolderView ActiveX object?

I used this same method to succesfully embed the Flash ActiveX object, but in the case of Shell.FolderView EnsureModule is returning nothing

class_id = "{9BA05971-F6A8-11CF-A442-00A0C90A8F39}"
shell = win32com.client.gencache.EnsureModule(class_id,0x0,1,1)

Any ideas for debugging the problem?

Thanks,
Matt