https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/__pycache__/roman.cpython-310.pyc
o

"*_P�@s�ddlmZ	dZdZdZdZddlZddlZddlZddl	Z	Gdd�de
�ZGd	d
�d
e�ZGdd�de�Z
Gd
d�de�ZdZdd�Ze�dej�Zdd�Zdd�Zdd�Zedkrde	�e��dSdS)�)�print_functionz&Mark Pilgrim (f8dy@diveintopython.org)z1.4z
8 August 2001agCopyright (c) 2001 Mark Pilgrim

This program is part of "Dive Into Python", a free Python tutorial for
experienced programmers.  Visit http://diveintopython.org/ for the
latest version.

This program is free software; you can redistribute it and/or modify
it under the terms of the Python 2.1.1 license, available at
http://www.python.org/2.1.1/license.html
Nc@�eZdZdS)�
RomanErrorN��__name__�
__module__�__qualname__�r	r	�'/usr/lib/python3/dist-packages/roman.pyr�rc@r)�OutOfRangeErrorNrr	r	r	r
rrrc@r)�NotIntegerErrorNrr	r	r	r
r
#rr
c@r)�InvalidRomanNumeralErrorNrr	r	r	r
r'rr)
)�Mi�)�CMi�)�Di�)�CDi�)�C�d)�XC�Z)�L�2)�XL�()�X�
)�IX�	)�V�)�IV�)�I�cCsxt|t�s	td��d|krdkstd��td��|dkr!dSd}tD]\}}||kr9||7}||8}||ks-q%|S)z convert integer to Roman numeralzdecimals can not be converted���i�z%number out of range (must be 0..4999)r�N�)�
isinstance�intr
r�romanNumeralMap)�n�result�numeral�integerr	r	r
�toRoman;s 
���r/a8
    ^                   # beginning of string
    M{0,4}              # thousands - 0 to 4 M's
    (CM|CD|D?C{0,3})    # hundreds - 900 (CM), 400 (CD), 0-300 (0 to 3 C's),
                        #            or 500-800 (D, followed by 0 to 3 C's)
    (XC|XL|L?X{0,3})    # tens - 90 (XC), 40 (XL), 0-30 (0 to 3 X's),
                        #        or 50-80 (L, followed by 0 to 3 X's)
    (IX|IV|V?I{0,3})    # ones - 9 (IX), 4 (IV), 0-3 (0 to 3 I's),
                        #        or 5-8 (V, followed by 0 to 3 I's)
    $                   # end of string
    cCs�|std��|dkrdSt�|�std|��d}d}tD]&\}}|||t|��|krC||7}|t|�7}|||t|��|ks-q|S)z convert Roman numeral to integerzInput can not be blankr&rzInvalid Roman numeral: %s)r�romanNumeralPattern�searchr*�len)�sr,�indexr-r.r	r	r
�	fromRoman\s
��r5cCsDtjddd�}|jddd�|jddd	d
dd�|��}|j|_|S)
N�romanz)convert between roman and arabic numerals)�prog�description�numberzthe value to convert)�helpz-rz	--reverse�
store_trueFz<convert roman to numeral (case insensitive) [default: False])�action�defaultr:)�argparse�ArgumentParser�add_argument�
parse_argsr9)�parser�argsr	r	r
rAqs��rAcCsLt�}|jr|j��}t|�}t|�tj	St|j�}t|�}t|�tj	S)N)
rA�reverser9�upperr5�printr)r/�os�EX_OK)rC�u�r�ir+r	r	r
�main�s

�rL�__main__)�
__future__r�
__author__�__version__�__date__�
__copyright__r>rG�re�sys�	Exceptionrrr
rr*r/�compile�VERBOSEr0r5rArLr�exitr	r	r	r
�<module>s2
�
�

https://t.me/RX1948 - 2025