Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/numpy/f2py/__pycache__/__init__.cpython-37.pyc
Назад
B �5�g� � @ s� d Z ddddgZddlZddlZddlZddlmZ dd lmZ ejZej Z ddd�Z dd� Zejdd� dkr�dd� Z dd� Zn"ddlmZ ddlmZ ee�Z[dS )z(Fortran to Python Interface Generator. �run_main�compile�get_include�f2py_testing� N� )�f2py2e)�diagnose�untitled� T�.fFc C s: ddl }ddl}|dkr4|j|d�\} } t�| � n|} t| t�sLt| d�} z�t| d��} | �| � W dQ R X dd|| j g}t|t�r�tj dk}|j ||d �}|�|� tj dd g| } ytj| tjtjd�}W n& tk r� tj| dd d d�}Y nX |�rt|j�� � W d|dk�r$t�| � X |�r0|S |jS dS )a� Build extension module from a Fortran 77 source string with f2py. Parameters ---------- source : str or bytes Fortran source of module / subroutine to compile .. versionchanged:: 1.16.0 Accept str as well as bytes modulename : str, optional The name of the compiled python module extra_args : str or list, optional Additional parameters passed to f2py .. versionchanged:: 1.16.0 A list of args may also be provided. verbose : bool, optional Print f2py output to screen source_fn : str, optional Name of the file where the fortran source is written. The default is to use a temporary file with the extension provided by the `extension` parameter extension : {'.f', '.f90'}, optional Filename extension if `source_fn` is not provided. The extension tells which fortran standard is used. The default is `.f`, which implies F77 standard. .. versionadded:: 1.11.0 full_output : bool, optional If True, return a `subprocess.CompletedProcess` containing the stdout and stderr of the compile process, instead of just the status code. .. versionadded:: 1.20.0 Returns ------- result : int or `subprocess.CompletedProcess` 0 on success, or a `subprocess.CompletedProcess` if ``full_output=True`` Examples -------- .. include:: compile_session.dat :literal: r N)�suffixzutf-8�wz-cz-m�posix)r z)import numpy.f2py as f2py2e;f2py2e.main())�stdout�stderr� � )�tempfile�shlex�mkstemp�os�close� isinstance�str�open�write�name�split�extend�sys� executable� subprocess�run�PIPE�OSError�CompletedProcess�printr �decode�remove� returncode)�source� modulename� extra_args�verboseZ source_fn� extensionZfull_outputr r �f�fname�argsZis_posix�c�cp� r4 �I/home/digitalm-up/venv/lib/python3.7/site-packages/numpy/f2py/__init__.pyr s>