Which Action Does This Paramiko Python Script Perform?

Network Automation & Python Scripting

Refer to the exhibit. Which action does the Python script accomplish? - image

  1. connects to the device using Telnet and exports the routing table information
  2. connects to the device using SSH and exports the routing table information
  3. displays the output of the show command in an unformatted way Source Reference Answer
  4. displays the output of the show command in a formatted way

Community Votes

C
64%
B
36%

64% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

This question tests your ability to distinguish between direct stream printing and actual data extraction, with the common trap being the misinterpretation of 'export' as synonymous with any SSH command execution.

This question evaluates how Python’s paramiko library handles remote device communication and standard output streams. The community consensus confirms that the script simply prints the raw, unformatted output object rather than exporting or structuring the data.

Option B is the most frequently selected incorrect answer. Candidates often equate SSH command execution with data 'exportation,' overlooking that true exportation requires explicit file-writing operations and that print(stdout) alone does not render clean CLI text.

Community Discussion (15 comments)

slacker_at_work 👍 5 Selected: B
It's either B or C, I would go for B: scripts establishes an SSH connection to the device and executes "show ip bgp 192.168.101.0 bestpath" to retrieve information about the BGP routing table.
zbeugene7 👍 2
Gotta be B it connects to the device first using SSH , it must be B. C describes the second part only.
chiacche 👍 1 Selected: C
output = stdout.read() # Read the raw output from stdout print(output) # This will print the formatted output as a string
4121e3c 👍 2 Selected: B
B is correct. the output of print is just object and does not show anything. to show the inside of object it needs readlines method, like print(stdout.readlines()). the routing table is exporting to the stdout object. the output without readlines() is like this : <paramiko.ChannelFile from <paramiko.Channel 0 (open) window=2097152 -> <paramiko.Transport at 0x8fbccb50 (cipher aes128-ctr, 128 bits) (active; 1 open channel(s))>>>
ebulating 👍 1 Selected: C
This questions hinges on the semantic difference between export and display.
a197cbf 👍 4 Selected: C
Choosing C going by this logic: A: Obviously wrong because Telnet is not port 22 B: Although correct where it says it's using SSH, "exports" the routing table sounds wrong because the code just does a standard print(stdout) command. That just outputs to the command line. If the code was to export the file, there should be some file.open() and file.close() commands to actually pump the stdout data into a file, or at least to another object type C: Correct answer going by this logic. The output is displayed with no formatting. If it was to be displayed in a formatted way, I'd expect to see something similar to a "for" loop where it can read each line of the stdout and write it accordingly, or at least some string formatting commands. There are none to hint at that in the code. D: Wrong because there doesn't seem to be any formatting commands on the stdout before or while printing it to the command line.
[Removed] 👍 3 Selected: C
it´s C The script prints the raw stdout object, which means it simply prints the raw command output without any formatting to the output. B is incorrect, because it dosen´t export the routing table information, it just retrieves and prints specific BGP information.
ds0321 👍 3 Selected: C
i will go with C
[Removed] 👍 1
A and B are wrong i will go with C
RickAO76 👍 4 Selected: C
it's not exporting 'stdout' anywhere - it's just printing it. I'm going to have to say it's C. Now if Cisco wants to non-nonchalantly change what they mean by 'export', that might be the case - but I'm sticking with C.
Claudiu1 👍 1
same question but different answers here: https://www.examtopics.com/discussions/cisco/view/52431-exam-350-401-topic-1-question-309-discussion/ Based on that question A and B are wrong. It is either C or D
gorillaenhanced 👍 1
printing stdout will give smth like : "<paramiko.ChannelFile from <paramiko.Channel 0 (open) window=8192 -> <paramiko.Transport at 0x3e51dd8 (cipher aes128-cbc, 128 bits) (active; 1 open channel(s))>>>" need to read lines through "stdout.readlines()" then you can print in the terminal. c/c : nothing is print to the screen and B seems to be the best option.
Mizuchan 👍 2 Selected: B
I think B is correct if you can agree that exports information=prints the information on the terminal.
teems5uk 👍 4
This part ("exports the routing table information") of the option B makes it wrong in my opinion.
ciscoccie20 👍 2
should be D!

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Core Concept: Paramiko Execution and Stream Handling

The provided Python script utilizes the paramiko library to establish an SSH connection (indicated by port 22) to a network device. It executes a show command (e.g., show ip bgp) and captures the standard output into a stdout variable.

Why Option C is Correct

When you execute print(stdout) without calling .read() or .readlines(), Python outputs the raw memory reference or unformatted stream object representation rather than the actual CLI text. As noted by community members, this results in an unformatted display of the command output, making C the technically accurate choice.

Why Options A, B, and D Are Incorrect

  • Option A is immediately invalid because the script uses port 22, which is exclusively assigned to SSH, not Telnet.
  • Option B incorrectly uses the term "exports." In networking and programming contexts, exporting implies transferring or saving data to an external file or system. Since the code lacks open(), write(), or close() statements, no actual export occurs. The community heavily debated this semantic distinction, confirming that mere terminal printing does not constitute exporting.
  • Option D is incorrect because no formatting functions (like regex parsing, CSV conversion, or pretty-print libraries) are applied to the output. The script leaves the data in its raw, unstructured state.

Community Validation

Multiple candidates highlighted that print(stdout) yields an object string like <paramiko.ChannelFile...> unless explicitly read, reinforcing why the output is considered unformatted. The consensus firmly rejects "export" due to the absence of file I/O operations.

Official Reference

Exam Strategy

When analyzing automation scripts, always scan for explicit file I/O methods before selecting answers containing the word "export." Additionally, remember that printing a raw stream or channel object in Python typically yields an unformatted object representation rather than clean, structured CLI text.

Related Analysis

Practice All 350-401 Questions

Access 218 questions with complete answers and detailed explanations.

View Full 350-401 Practice Test →

← Back to 350-401 Study Guide