| Server IP : 118.27.122.248 / Your IP : 216.73.217.37 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python37/lib64/python3.7/json/__pycache__/ |
Upload File : |
B
YI~d% �
@ sf d dl Z d dlZd dlZdd� Zedkrby
e� W n. ek
r` Z ze�ej� W ddZ[X Y nX dS )� Nc C s� d} d}t j| |d�}|jddt jdd�dd � |jd
dt jddd�dd � |jd
dddd� |�� }|jpptj}|jp|tj }|j
}|�@ yt�|�}W n* t
k
r� } zt|��W d d }~X Y nX W d Q R X |�" tj|||dd� |�d� W d Q R X d S )Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)�prog�description�infile�?zutf-8)�encodingz-a JSON file to be validated or pretty-printed)�nargs�type�help�outfile�wz%write the output of infile to outfilez--sort-keys�
store_trueFz5sort the output of dictionaries alphabetically by key)�action�defaultr � )� sort_keys�indent�
)�argparse�ArgumentParser�add_argument�FileType�
parse_argsr �sys�stdinr
�stdoutr �json�load�
ValueError�
SystemExit�dump�write) r r �parser�optionsr r
r �obj�e� r% �./opt/alt/python37/lib64/python3.7/json/tool.py�main s*
$r'