Strange location for a comma
Laura Creighton
lac at openend.se
Thu Sep 3 08:40:34 EDT 2015
In a message of Thu, 03 Sep 2015 14:20:06 +0200, "ast" writes:
>Hello,
>
>At the end of the last line of the following program,
>there is a comma, I dont understand why ?
>
>Thx
>
>
>from cx_Freeze import setup, Executable
>
># On appelle la fonction setup
>setup(
> name = "salut",
> version = "0.1",
> description = "Ce programme vous dit bonjour",
> executables = [Executable("salut.py")], # <--- HERE
>)
In python a tuple consists of a number of values separated by commas.
see: https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences
or https://docs.python.org/2/tutorial/datastructures.html#tuples-and-sequences
for Python 2.
The round parentheses aren't significant.
So:
>>> def Executable(arg):
... return arg
...
>>> executables = [Executable("salut.py")],
>>> executables
(['salut.py'],)
>>>
Laura
More information about the Python-list
mailing list