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

te.insert #131

Open
skywood123 opened this issue Aug 21, 2024 · 2 comments
Open

te.insert #131

skywood123 opened this issue Aug 21, 2024 · 2 comments

Comments

@skywood123
Copy link

Hi, I'm new to the tool.
im trying to use as per the README.md
I found that te.insert is not working. BMV2 table is not receiving the table entry.
Whereas te.insert() is correctly calling out the function.
Thank you.

@antoninbas
Copy link
Member

If you are using the ipython-based shell, then we set the "autocall" property to ensure that functions can be called without parentheses:

c.TerminalInteractiveShell.autocall = 2

If you are using this project as a library in scripts (https://github.com/p4lang/p4runtime-shell?tab=readme-ov-file#using-p4runtime-shell-in-scripts), then there is no such thing as "autocall" and you need the parentheses.

Assuming you are using the ipython-based shell, then you may want to validate that autocall has been set properly:

c = get_config()
c.InteractiveShell.autocall

@jafingerhut
Copy link
Collaborator

If you are interested in examples of using p4runtime-shell from a Python program (not interactively), there are several examples in my p4-guide repository, including these:

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

3 participants