How to run python script from local machine to netbox nbshell ? #3092

Closed
opened 2025-12-29 18:25:33 +01:00 by adam · 1 comment
Owner

Originally created by @ranjeetjangra on GitHub (Dec 27, 2019).

Hi Experts ,
I have installed Netbox docker in my Centos server .
I want to execute my python script from local machine into nbshell , how can i do that .
I prepared the python script for bulk import (data from csv file to netbox nbshell )

Method 1:
I tried ./manage.py < script.py
This method reads script.py line by line and fires at nbshell irrespective of its a class or a function (unlike python interpreter)

Method 2
I tried by saving my script in PYTHONPATH folder and importing my main function into nbshell
that way also doesn't work .

Snapshots attached for reference .

Regards
Ranjeet

image

image

Originally created by @ranjeetjangra on GitHub (Dec 27, 2019). Hi Experts , I have installed Netbox docker in my Centos server . I want to execute my python script from local machine into nbshell , how can i do that . I prepared the python script for bulk import (data from csv file to netbox nbshell ) Method 1: I tried ./manage.py < script.py This method reads script.py line by line and fires at nbshell irrespective of its a class or a function (unlike python interpreter) Method 2 I tried by saving my script in PYTHONPATH folder and importing my main function into nbshell that way also doesn't work . Snapshots attached for reference . Regards Ranjeet ![image](https://user-images.githubusercontent.com/50072052/71514703-fc03d780-28c5-11ea-8994-025e6b719161.png) ![image](https://user-images.githubusercontent.com/50072052/71514724-07570300-28c6-11ea-928e-c7180be77799.png)
adam closed this issue 2025-12-29 18:25:33 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 27, 2019):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list instead.

@jeremystretch commented on GitHub (Dec 27, 2019): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided [here](https://github.com/digitalocean/netbox/issues/new/choose). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3092