Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
aef062ac
Commit
aef062ac
authored
Aug 28, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation for PyString_FromFormat() and PyString_FromFormatV().
Closes SF patch #455666.
parent
f8b67718
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
Doc/api/api.tex
Doc/api/api.tex
+28
-0
No files found.
Doc/api/api.tex
View file @
aef062ac
...
...
@@ -2622,6 +2622,34 @@ Returns a new string object with the value \var{v} and length
the contents of the string are uninitialized.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyString
_
FromFormat
}{
const char *format, ...
}
Takes a C
\code
{
printf
}
-style
\var
{
format
}
string and a variable
number of arguments, calculates the size of the resulting Python
string and returns a string with the values formatted into it. The
variable arguments must be C types and must correspond exactly to the
format characters in the
\var
{
format
}
string. The following format
characters are allowed:
\begin{tableiii}
{
l|l|l
}{
member
}{
Format Characters
}{
Type
}{
Comment
}
\lineiii
{
\%\%
}{
\emph
{
n/a
}}{
The literal
\%
character.
}
\lineiii
{
\%
c
}{
int
}{
A single character, represented as an C int.
}
\lineiii
{
\%
d
}{
int
}{
Exactly equivalent to
\code
{
printf("
\%
d")
}
.
}
\lineiii
{
\%
ld
}{
long
}{
Exactly equivalent to
\code
{
printf("
\%
ld")
}
.
}
\lineiii
{
\%
i
}{
int
}{
Exactly equivalent to
\code
{
printf("
\%
i")
}
.
}
\lineiii
{
\%
x
}{
int
}{
Exactly equivalent to
\code
{
printf("
\%
x")
}
.
}
\lineiii
{
\%
s
}{
char*
}{
A null-terminated C character array.
}
\lineiii
{
\%
p
}{
void*
}{
The hex representation of a C pointer.
Mostly equivalent to
\code
{
printf("
\%
p")
}
except that it is
guaranteed to start with the literal
\code
{
0x
}
regardless of
what the platform's
\code
{
printf
}
yields.
}
\end{tableiii}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyString
_
FromFormatV
}{
const char *format,
va
_
list vargs
}
Identical to
\function
{
PyString
_
FromFormat()
}
except that it takes
exactly two arguments.
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyString
_
Size
}{
PyObject *string
}
Returns the length of the string in string object
\var
{
string
}
.
\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