Re: Instatiating module / Reusing module of command-line tool

2022-05-07 Thread Cameron Simpson
On 06May2022 14:11, Loris Bennett wrote: >r...@zedat.fu-berlin.de (Stefan Ram) writes: >> If you need a class, you can write a class. >> >> When one imports a module, the module actually gets executed. >> That's why people write "if __name__ == '__main__':" often. >> So, everything one wan

Re: Instatiating module / Reusing module of command-line tool

2022-05-06 Thread Loris Bennett
r...@zedat.fu-berlin.de (Stefan Ram) writes: > "Loris Bennett" writes: >>My question: What is the analogue to initialising an object via the >>constructor for a module? > > If you need a class, you can write a class. > > When one imports a module, the module actually gets executed. > That's

Instatiating module / Reusing module of command-line tool

2022-04-29 Thread Loris Bennett
Hi, I have a command-line script in Python to get the correct salutation for a user name in either English or German from a 'salutation server': $ get_salutation alice Dear Professor Müller $ get_salutation alice -l de Sehr geehrte Frau Professorin Müller The hostname, port, user and pas