NEURON
nrnpython.cpp File Reference
#include <nrnpython.h>
#include <nrnpy_utils.h>
#include <stdio.h>
#include <InterViews/resource.h>
#include <nrnoc2iv.h>
#include <nrnpy_reg.h>
#include <hoccontext.h>
#include <string>
#include <ocfile.h>
#include <hocstr.h>

Go to the source code of this file.

Functions

void nrnpython_real ()
 
int nrnpython_start (int b)
 Start the Python interpreter. More...
 
int hoc_get_line ()
 
char * neuronhome_forward ()
 
static char * nrnpython_getline (FILE *, FILE *, const char *)
 
void nrnpy_augment_path ()
 
int nrnpy_pyrun (const char *fname)
 Execute a Python script. More...
 
void rl_stuff_char (int)
 
static int nrnmingw_pyrun_interactiveloop ()
 Like a PyRun_InteractiveLoop that does not need a FILE* Use InteractiveConsole to work around the issue of mingw FILE* not being compatible with Python via the CAPI on windows11. More...
 
static void del_wcargv (int argc)
 
static void copy_argv_wcargv (int argc, char **argv)
 
static wchar_t * mywstrdup (char *s)
 

Variables

HocStrhoc_cbufstr
 
int nrnpy_nositeflag
 
char * nrnpy_pyhome
 
char * hoc_ctp
 
FILE * hoc_fin
 
const char * hoc_promptstr
 
int nrn_global_argc
 
char ** nrn_global_argv
 
int(* p_nrnpy_pyrun )(const char *)
 
static wchar_t ** wcargv
 

Function Documentation

◆ copy_argv_wcargv()

static void copy_argv_wcargv ( int  argc,
char **  argv 
)
static

Definition at line 128 of file nrnpython.cpp.

◆ del_wcargv()

static void del_wcargv ( int  argc)
static

Definition at line 118 of file nrnpython.cpp.

◆ hoc_get_line()

int hoc_get_line ( )

Definition at line 1859 of file hoc.cpp.

◆ mywstrdup()

static wchar_t* mywstrdup ( char *  s)
static

Definition at line 145 of file nrnpython.cpp.

◆ neuronhome_forward()

char* neuronhome_forward ( )

Definition at line 190 of file code2.cpp.

◆ nrnmingw_pyrun_interactiveloop()

static int nrnmingw_pyrun_interactiveloop ( )
static

Like a PyRun_InteractiveLoop that does not need a FILE* Use InteractiveConsole to work around the issue of mingw FILE* not being compatible with Python via the CAPI on windows11.

Returns
0 on success, nonzero on failure.

Definition at line 101 of file nrnpython.cpp.

◆ nrnpy_augment_path()

void nrnpy_augment_path ( )

Definition at line 44 of file nrnpython.cpp.

◆ nrnpy_pyrun()

int nrnpy_pyrun ( const char *  fname)

Execute a Python script.

Returns
0 on failure, 1 on success.

Definition at line 69 of file nrnpython.cpp.

◆ nrnpython_getline()

static char * nrnpython_getline ( FILE *  ,
FILE *  ,
const char *  prompt 
)
static

Definition at line 263 of file nrnpython.cpp.

◆ nrnpython_real()

void nrnpython_real ( )

Definition at line 251 of file nrnpython.cpp.

◆ nrnpython_start()

int nrnpython_start ( int  b)

Start the Python interpreter.

defined(NRNPYTHON_DYNAMICLOAD)

  • b Mode of operation, can be 0 (finalize), 1 (initialize), or 2 (execute commands/scripts)
    Returns
    0 on success, non-zero on error
    There is an internal state variable that stores whether or not Python has been initialized. Mode 1 only has an effect if Python is not initialized, while the other modes only take effect if Python is already initialized.

Definition at line 161 of file nrnpython.cpp.

◆ rl_stuff_char()

void rl_stuff_char ( int  )

Variable Documentation

◆ hoc_cbufstr

HocStr* hoc_cbufstr
extern

Definition at line 165 of file hoc.cpp.

◆ hoc_ctp

char* hoc_ctp
extern

◆ hoc_fin

FILE* hoc_fin
extern

◆ hoc_promptstr

const char* hoc_promptstr
extern

Definition at line 166 of file hoc.cpp.

◆ nrn_global_argc

int nrn_global_argc
extern

Definition at line 34 of file nrnpython.cpp.

◆ nrn_global_argv

char** nrn_global_argv
extern

Definition at line 35 of file nrnpython.cpp.

◆ nrnpy_nositeflag

int nrnpy_nositeflag
extern

Definition at line 183 of file ivocmain.cpp.

◆ nrnpy_pyhome

char* nrnpy_pyhome
extern

Definition at line 69 of file nrnpy.cpp.

◆ p_nrnpy_pyrun

int(* p_nrnpy_pyrun) (const char *) ( const char *  fname)
extern

Definition at line 38 of file hoc.cpp.

◆ wcargv

wchar_t** wcargv
static

Definition at line 116 of file nrnpython.cpp.