Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0041a94e
Kaydet (Commit)
0041a94e
authored
Nis 29, 1999
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fill in a few holes in the "Very High Level" chapter.
üst
5f342ac2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
api.tex
Doc/api/api.tex
+37
-0
No files found.
Doc/api/api.tex
Dosyayı görüntüle @
0041a94e
...
@@ -552,12 +552,25 @@ given in a file or a buffer, but they will not let you interact in a
...
@@ -552,12 +552,25 @@ given in a file or a buffer, but they will not let you interact in a
more detailed way with the interpreter.
more detailed way with the interpreter.
\begin{cfuncdesc}
{
int
}{
PyRun
_
AnyFile
}{
FILE *fp, char *filename
}
\begin{cfuncdesc}
{
int
}{
PyRun
_
AnyFile
}{
FILE *fp, char *filename
}
If
\var
{
fp
}
refers to a file associated with an interactive device
(console or terminal input or
\UNIX
{}
pseudo-terminal), return the
value of
\cfunction
{
PyRun
_
InteractiveLoop()
}
, otherwise return the
result of
\cfunction
{
PyRun
_
SimpleFile()
}
. If
\var
{
filename
}
is
\NULL
{}
, use
\code
{
"???"
}
as the filename.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyRun
_
SimpleString
}{
char *command
}
\begin{cfuncdesc}
{
int
}{
PyRun
_
SimpleString
}{
char *command
}
Executes the Python source code from
\var
{
command
}
in the
\module
{__
main
__}
module. If
\module
{__
main
__}
does not already
exist, it is created. Returns
\code
{
0
}
on success or
\code
{
-1
}
if
an exception was raised. If there was an error, there is no way to
get the exception information.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyRun
_
SimpleFile
}{
FILE *fp, char *filename
}
\begin{cfuncdesc}
{
int
}{
PyRun
_
SimpleFile
}{
FILE *fp, char *filename
}
Similar to
\cfunction
{
PyRun
_
SimpleString()
}
, but the Python source
code is read from
\var
{
fp
}
instead of an in-memory string.
\var
{
filename
}
should be the name of the file.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyRun
_
InteractiveOne
}{
FILE *fp, char *filename
}
\begin{cfuncdesc}
{
int
}{
PyRun
_
InteractiveOne
}{
FILE *fp, char *filename
}
...
@@ -568,24 +581,48 @@ more detailed way with the interpreter.
...
@@ -568,24 +581,48 @@ more detailed way with the interpreter.
\begin{cfuncdesc}
{
struct
_
node*
}{
PyParser
_
SimpleParseString
}{
char *str,
\begin{cfuncdesc}
{
struct
_
node*
}{
PyParser
_
SimpleParseString
}{
char *str,
int start
}
int start
}
Parse Python source code from
\var
{
str
}
using the start token
\var
{
start
}
. The result can be used to create a code object which
can be evaluated efficiently. This is useful if a code fragment
must be evaluated many times.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
struct
_
node*
}{
PyParser
_
SimpleParseFile
}{
FILE *fp,
\begin{cfuncdesc}
{
struct
_
node*
}{
PyParser
_
SimpleParseFile
}{
FILE *fp,
char *filename, int start
}
char *filename, int start
}
Similar to
\cfunction
{
PyParser
_
SimpleParseString()
}
, but the Python
source code is read from
\var
{
fp
}
instead of an in-memory string.
\var
{
filename
}
should be the name of the file.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyRun
_
String
}{
char *str, int start,
\begin{cfuncdesc}
{
PyObject*
}{
PyRun
_
String
}{
char *str, int start,
PyObject *globals,
PyObject *globals,
PyObject *locals
}
PyObject *locals
}
Execute Python source code from
\var
{
str
}
in the context specified
by the dictionaries
\var
{
globals
}
and
\var
{
locals
}
. The parameter
\var
{
start
}
specifies the start token that should be used to parse
the source code.
Returns the result of executing the code as a Python object, or
\NULL
{}
if an exception was raised.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyRun
_
File
}{
FILE *fp, char *filename,
\begin{cfuncdesc}
{
PyObject*
}{
PyRun
_
File
}{
FILE *fp, char *filename,
int start, PyObject *globals,
int start, PyObject *globals,
PyObject *locals
}
PyObject *locals
}
Similar to
\cfunction
{
PyRun
_
String()
}
, but the Python source code is
read from
\var
{
fp
}
instead of an in-memory string.
\var
{
filename
}
should be the name of the file.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
Py
_
CompileString
}{
char *str, char *filename,
\begin{cfuncdesc}
{
PyObject*
}{
Py
_
CompileString
}{
char *str, char *filename,
int start
}
int start
}
Parse and compile the Python source code in
\var
{
str
}
, returning the
resulting code object. The start token is given by
\var
{
start
}
;
this can be used to constrain the code which can be compiled. The
filename specified by
\var
{
filename
}
is used to construct the code
object and may appear in tracebacks or
\exception
{
SyntaxError
}
exception messages. This returns
\NULL
{}
if the code cannot be
parsed or compiled.
\end{cfuncdesc}
\end{cfuncdesc}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment