Which Action Does This Paramiko Python Script Perform?
Short answer
C displays the output of the show command in an unformatted way
Question

Key Takeaways
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.
Common mistake: 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.
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(), orclose()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
https://docs.paramiko.org/en/stable/api/client.html
This link opens the official vendor documentation in a new tab.
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.
Community Votes
64% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 15 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 15
-
slacker_at_work 👍 5 Answered BIt'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.
-
a197cbf 👍 4 Answered CChoosing 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.
-
RickAO76 👍 4 Answered Cit'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.
-
teems5uk 👍 4This part ("exports the routing table information") of the option B makes it wrong in my opinion.
-
[Removed] 👍 3 Answered Cit´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.
Show 10 more comments
-
4121e3c 👍 2 Answered BB 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))>>>
-
zbeugene7 👍 2Gotta be B it connects to the device first using SSH , it must be B. C describes the second part only.
-
Mizuchan 👍 2 Answered BI think B is correct if you can agree that exports information=prints the information on the terminal.
-
gorillaenhanced 👍 1printing 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.
-
Claudiu1 👍 1same question but different answers here: a public discussion thread on this question Based on that question A and B are wrong. It is either C or D
-
chiacche 👍 1 Answered Coutput = stdout.read() # Read the raw output from stdout print(output) # This will print the formatted output as a string
-
ebulating 👍 1 Answered CThis questions hinges on the semantic difference between export and display.
-
[Removed] 👍 1A and B are wrong i will go with C
-
ds0321 👍 3 Answered Ci will go with C
-
ciscoccie20 👍 2should be D!
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All 350-401 Questions
Access 218 questions with complete answers and detailed explanations.
View Full 350-401 Practice Test →