Skip to content

Automatically Run Python Profile Script at Startup #6376

Answered by austin3dickey
dani-f asked this question in Q&A
Discussion options

You must be logged in to vote

Hey Daniel,

I can't quite reproduce what you're saying but I have some ideas.

First off, I have a startup script that looks like the following:

austin@austindickey-C7XT ~ % cat ~/.ipython/profile_default/startup/test.py

import pandas as pd
pd.options.display.max_columns = 43
print("asd")
x = 5

When I start up Positron, I don't see anything in the Variables pane, but I can see the changes I made in the Console:

>>> print(x)
5
>>> import pandas as pd
>>> pd.get_option("display.max_columns")
43

There is actually an IPython config option that allows you to see the values of variables loaded at startup. I was able to activate this behavior by adding a config file:

austin@austindickey-C7XT ~ % c…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@testlabauto
Comment options

@dani-f
Comment options

@dani-f
Comment options

@austin3dickey
Comment options

Answer selected by dani-f
@dani-f
Comment options

@austin3dickey
Comment options

@dani-f
Comment options

@austin3dickey
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants