Groups
Groups
Sign in
Groups
Groups
DreamPie
Conversations
About
Send feedback
Help
What code do you execute on startup?
9 views
Skip to first unread message
Nikola
unread,
Oct 6, 2010, 4:12:34 AM
10/6/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DreamPie
Dreampie provides you a way to execute your own code on (re)start - in
the Shell tab of the Preferences dialog. What do you have there?
I wanted to load some code that depends on __file__ global that
execfile doesn't set. So I put there:
_execfile=execfile
def my_execfile(fn):
_execfile(fn, {'__file__':fn})
execfile=my_execfile
Nikola
unread,
Oct 6, 2010, 7:11:55 AM
10/6/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DreamPie
Actually, this works better because it doesn't lose the context where
the execution happens:
_execfile=execfile
def my_execfile(fn):
g = globals()
g['__file__']=fn
_execfile(fn, g)
execfile=my_execfile
Reply all
Reply to author
Forward
0 new messages