| 1 |
%% |
| 2 |
%% This is file `listings-python.prf', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% lstdrvrs.dtx (with options: `python-prf') |
| 8 |
%% |
| 9 |
%% The listings package is copyright 1996--2004 Carsten Heinz, and |
| 10 |
%% continued maintenance on the package is copyright 2006--2007 Brooks |
| 11 |
%% Moses. From 2013 on the maintenance is done by Jobst Hoffmann. |
| 12 |
%% The drivers are copyright 1997/1998/1999/2000/2001/2002/2003/2004/2006/ |
| 13 |
%% 2007/2013 any individual author listed in this file. |
| 14 |
%% |
| 15 |
%% This file is distributed under the terms of the LaTeX Project Public |
| 16 |
%% License from CTAN archives in directory macros/latex/base/lppl.txt. |
| 17 |
%% Either version 1.3c or, at your option, any later version. |
| 18 |
%% |
| 19 |
%% This file is completely free and comes without any warranty. |
| 20 |
%% |
| 21 |
%% Send comments and ideas on the package, error reports and additional |
| 22 |
%% programming languages to Jobst Hoffmann at <[email protected]>. |
| 23 |
%% |
| 24 |
\ProvidesFile{listings-python.prf} |
| 25 |
[2025/11/14 1.11b listings language file] |
| 26 |
\usepackage{xcolor} |
| 27 |
\usepackage{textcomp} |
| 28 |
|
| 29 |
%% Actual colors from idlelib/config-highlight.def |
| 30 |
%% --> corrected to ``web-safe'' |
| 31 |
%% Unimplemented IDLE syntax: function/class names being |
| 32 |
%% defined should be blue |
| 33 |
%% strings = #00aa00 / 0,170,0 (a darker green) |
| 34 |
%% builtins = #900090 / 144,0,144 (purple-ish) |
| 35 |
%% keywords = #FF7700 / 255,119,0 (quite close to plain `orange') |
| 36 |
%% Corrected to ``web-safe'' |
| 37 |
\definecolor{purple2}{RGB}{153,0,153} % there's actually no standard purple |
| 38 |
\definecolor{green2}{RGB}{0,153,0} % a darker green |
| 39 |
|
| 40 |
\lstdefinestyle{python-idle-code}{% |
| 41 |
language=Python, % the language |
| 42 |
basicstyle=\normalsize\ttfamily, % size of the fonts for the code |
| 43 |
% Color settings to match IDLE style |
| 44 |
keywordstyle=\color{orange}, % core keywords |
| 45 |
keywordstyle={[2]\color{purple2}}, % built-ins |
| 46 |
stringstyle=\color{green2},% |
| 47 |
commentstyle=\color{red},% |
| 48 |
upquote=true, % requires textcomp |
| 49 |
} |
| 50 |
\endinput |
| 51 |
%% |
| 52 |
%% End of file `listings-python.prf'. |