Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for startup scripts #58

Open
jamdagni86 opened this issue May 2, 2018 · 3 comments
Open

Add support for startup scripts #58

jamdagni86 opened this issue May 2, 2018 · 3 comments

Comments

@jamdagni86
Copy link

jamdagni86 commented May 2, 2018

Jupyter (IPython) supports startup scripts. When the kernel starts, it loads all the files present in the startup directory (usually ~/.ipython/profile_default/startup or ~/.jupyter/startup) in lexicographical order.

Add support for loading any *.go files found in the directory during startup.

@jamdagni86
Copy link
Author

jamdagni86 commented May 3, 2018

@yunabe - I'm thinking we can change jupyter/gojupyterscaffold/gojupyterscaffold.go:NewServer function to load startup scripts before returning. I'm more inclined towards loading the scripts from ~/.jupyter/startup as Jupyter doesn't support IPython profiles. Let me know your thoughts!

jamdagni86 added a commit to jamdagni86/lgo that referenced this issue May 8, 2018
jamdagni86 added a commit to jamdagni86/lgo that referenced this issue May 9, 2018
…ng if we encounter an error while reading a startup file
@yunabe
Copy link
Owner

yunabe commented May 14, 2018

Sorry for the slow response. I think it's a good idea to support startup scripts. But before desining and implementing actual code, I would like to make clear what we really want to do with startup scripts.

jamdagni86, what do you really want to do with start-up scripts?
Do you want to import some common packages like "fmt"? Do you want to execute some initliazation code everytime we start the kernel?

I do not want to make the start-up time longer unnecessarily by supporting start-up scripts. So, I would like to make clear what we really want to achive with start-up scripts.

Thanks,
yunabe

@jamdagni86
Copy link
Author

@yunabe - the idea is to have common functions/imports which people usually import once they start up the lgo kernel (say a function to connect to a db or as you said, common packages like "fmt"). As you rightly said, giving this option to the user could potentially slow up starting the kernel. But I guess, it's upto the user to take that decision to add code which slows the startup down.

jamdagni86 added a commit to jamdagni86/lgo that referenced this issue May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants