| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.7/json/__pycache__/ |
Upload File : |
B
/-�a% �
@ 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% �/usr/lib/python3.7/json/tool.py�main s*
$r'