Re: How to enter escape character in a positional string argumentfrom the command line?

2022-12-21 Thread Barry
> On 21 Dec 2022, at 17:06, Chris Angelico wrote: > > On Thu, 22 Dec 2022 at 03:58, gene heskett wrote: >> >>> On 12/21/22 11:22, Chris Angelico wrote: >>> On Thu, 22 Dec 2022 at 03:11, Stefan Ram wrote: Lars Liedtke writes: > Or you could have "native" bash ($SHELL) with WS

Re: How to enter escape character in a positional string argumentfrom the command line?

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 04:12, Barry wrote: > I see bash scripts that are 1000’s of line of code at work and its a > maintenance nightmare. > > Knowing when to make the move from “handy bash script” to “this is a > production application” and needs to be python is what I see people miss. > > Afte

Re: How to enter escape character in a positional string argumentfrom the command line?

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 03:58, gene heskett wrote: > > On 12/21/22 11:22, Chris Angelico wrote: > > On Thu, 22 Dec 2022 at 03:11, Stefan Ram wrote: > >> > >> Lars Liedtke writes: > >>> Or you could have "native" bash ($SHELL) with WSL. > >> > >>In this newsgroup, it would actually be obvious

Re: How to enter escape character in a positional string argumentfrom the command line?

2022-12-21 Thread gene heskett
On 12/21/22 11:22, Chris Angelico wrote: On Thu, 22 Dec 2022 at 03:11, Stefan Ram wrote: Lars Liedtke writes: Or you could have "native" bash ($SHELL) with WSL. In this newsgroup, it would actually be obvious to use Python. Less obvious than you might think - partly because bash is ju

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 03:11, Stefan Ram wrote: > > Lars Liedtke writes: > >Or you could have "native" bash ($SHELL) with WSL. > > In this newsgroup, it would actually be obvious to use Python. Less obvious than you might think - partly because bash is just so dang good that it's really really

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 03:11, Jach Feng wrote: > > Chris Angelico 在 2022年12月21日 星期三下午1:02:01 [UTC+8] 的信中寫道: > > On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > > > That's what I am taking this path under Windows now, the ultimate > > > solution before Windows has shell similar to bash:-) > > Te

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Jach Feng
Chris Angelico 在 2022年12月21日 星期三下午1:02:01 [UTC+8] 的信中寫道: > On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > > That's what I am taking this path under Windows now, the ultimate solution > > before Windows has shell similar to bash:-) > Technically, Windows DOES have a shell similar to bash. It's

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Chris Angelico
On Wed, 21 Dec 2022 at 23:16, Albert-Jan Roskam wrote: > > > > On Dec 21, 2022 06:01, Chris Angelico wrote: > > On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > > That's what I am taking this path under Windows now, the ultimate solution > > before Windows has shell similar to bash:-) > > Techn

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Lars Liedtke
Or you could have "native" bash ($SHELL) with WSL. But I assume not everyone is using it. Cheers Lars Lars Liedtke Software Entwickler [Tel.] +49 721 98993- [Fax] +49 721 98993- [E-Mail]l...@solute.de solute GmbH Zeppelinstraße 15 76185 Karlsruhe Germany

Re: How to enter escape character in a positional string argument from the command line?

2022-12-21 Thread Albert-Jan Roskam
On Dec 21, 2022 06:01, Chris Angelico wrote: On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > That's what I am taking this path under Windows now, the ultimate solution before Windows has shell similar to bash:-) Technically, Windows DOES have a shell similar to bash. It'

Re: How to enter escape character in a positional string argument from the command line?

2022-12-20 Thread Chris Angelico
On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > That's what I am taking this path under Windows now, the ultimate solution > before Windows has shell similar to bash:-) Technically, Windows DOES have a shell similar to bash. It's called bash. :) The trouble is, most people use cmd.exe instead.

Re: How to enter escape character in a positional string argument from the command line?

2022-12-20 Thread Jach Feng
uot;more" input. If you press enter again, > you'll get another "more" prompt in which you can write the rest of > the command line. Command-line arguments are separated by spaces, so > you have to start the next line with a space if you want it to be a > new a

Re: How to enter escape character in a positional string argument from the command line?

2022-12-20 Thread Jach Feng
> >>> "step\x0A" as one of its positional arguments. I expect this string has a > >>> length of 5, but it gives 8. Obviously the escape character didn't > >>> function correctly. How to do it? > >> That depends on the command-line shell you'

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Eryk Sun
prompt in which you can write the rest of the command line. Command-line arguments are separated by spaces, so you have to start the next line with a space if you want it to be a new argument. Also, "^" is a literal character when it's in a double-quoted string, which requires c

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Thomas Passin
it gives 8. Obviously the escape character didn't function correctly. How to do it? That depends on the command-line shell you're calling your script from. In bash, you can include a newline in a quoted string: ./your_script 'step ' (the closing quote is on the next line) Or if you

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Jach Feng
sly the escape character didn't function > > correctly. How to do it? > That depends on the command-line shell you're calling your script from. > > In bash, you can include a newline in a quoted string: > ./your_script 'step > ' > (the closing quote

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Mark Bourne
Jach Feng wrote: I have a script using the argparse module. I want to enter the string "step\x0A" as one of its positional arguments. I expect this string has a length of 5, but it gives 8. Obviously the escape character didn't function correctly. How to do it? That depends

Re: INSTALLATION DOES NOT WORK FRO GITBASH COMMAND LINE

2022-08-26 Thread Fulian Wang
ITBASH COMMAND LINE On 8/23/22 05:00, Gladstone Rose wrote: > Why is my installation of Python does not work at the command line for git > bash. > > I get the following message > bash: python3: command not found The git bash package for Windows is built from msys2, a GNU/Linux type

Re: INSTALLATION DOES NOT WORK FRO GITBASH COMMAND LINE

2022-08-24 Thread Mats Wichmann
On 8/23/22 05:00, Gladstone Rose wrote: > Why is my installation of Python does not work at the command line for git > bash. > > I get the following message > bash: python3: command not found The git bash package for Windows is built from msys2, a GNU/Linux type environmen

Re: Installation does not work fro GitBash command line

2022-08-24 Thread J.O. Aho
On 23/08/2022 13.00, Gladstone Rose wrote: Why is my installation of Python does not work at the command line for git bash. I get the following message bash: python3: command not found It can be that you need to use python.exe instead of python3.exe, see my work computers response when

INSTALLATION DOES NOT WORK FRO GITBASH COMMAND LINE

2022-08-23 Thread Gladstone Rose
Why is my installation of Python does not work at the command line for git bash. I get the following message bash: python3: command not found Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows -- https://mail.python.org/mailman/listinfo/python-list

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

2022-05-07 Thread Cameron Simpson
as one instance >of the module, different runs, say test and production, would require >different internal data and thus different instances. Therefore a class >seems more appropriate and it is more obvious to me how to initialise >the objects (e.g. by having the some main function which c

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

2022-05-06 Thread Loris Bennett
nal data being set from outside, then, even though the program only ever has one instance of the module, different runs, say test and production, would require different internal data and thus different instances. Therefore a class seems more appropriate and it is more obvious to me how to initiali

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

Re: How to package a Python command line app?

2021-12-10 Thread Anssi Saari
Manfred Lotz writes: > pyinstaller worked fine taking care of message.py and typer module. But > as said in my other reply it is glibc version dependent. Perhaps the included freeze.py script (included in the CPython source that is, in Tools/freeze) is worth considering as well. Although it also

Re: How to package a Python command line app?

2021-12-10 Thread Manfred Lotz
executables for differen glibc versions. > > > > So, it seems I will have to check how executable zip archives are > > supposed to work. > > > > For me at least, I'm still not sure what you are trying to accomplish. > I like to offer my command line app

Re: How to package a Python command line app?

2021-12-10 Thread Manfred Lotz
On Thu, 9 Dec 2021 21:23:58 +0100 "Peter J. Holzer" wrote: > On 2021-12-09 19:35:37 +0100, Manfred Lotz wrote: > > I played with pyinstaller which worked fine. However, it builds a > > dynamic executable and thus it is glibc version dependent. Means, I > > have to build different executables for

Re: How to package a Python command line app?

2021-12-09 Thread Mats Wichmann
archives are supposed to work. For me at least, I'm still not sure what you are trying to accomplish. "A Python command line app which requires some packages which are not in the standard library." If your code and its dependencies are "pure python" then you only need to

Re: How to package a Python command line app?

2021-12-09 Thread Peter J. Holzer
On 2021-12-09 19:35:37 +0100, Manfred Lotz wrote: > I played with pyinstaller which worked fine. However, it builds a > dynamic executable and thus it is glibc version dependent. Means, I > have to build different executables for differen glibc versions. Just build it for the oldest version. Even

Re: How to package a Python command line app?

2021-12-09 Thread Manfred Lotz
On Thu, 9 Dec 2021 18:18:26 +0100 "Dieter Maurer" wrote: > Manfred Lotz wrote at 2021-12-8 12:31 +0100: > >The are many possibilities to package a Python app, and I have to > >admit I am pretty confused. > > > >Here is what I have: > > > >A Pyt

Re: How to package a Python command line app?

2021-12-09 Thread Manfred Lotz
On Thu, 9 Dec 2021 17:34:03 + Barry wrote: > > On 8 Dec 2021, at 18:27, Manfred Lotz wrote: > > > > The are many possibilities to package a Python app, and I have to > > admit I am pretty confused. > > > > Here is what I have: > > > &g

Re: How to package a Python command line app?

2021-12-09 Thread Barry
> On 8 Dec 2021, at 18:27, Manfred Lotz wrote: > > The are many possibilities to package a Python app, and I have to admit > I am pretty confused. > > Here is what I have: > > A Python command line app which requires some packages which are not in > the standard

Re: How to package a Python command line app?

2021-12-09 Thread Dieter Maurer
Manfred Lotz wrote at 2021-12-8 12:31 +0100: >The are many possibilities to package a Python app, and I have to admit >I am pretty confused. > >Here is what I have: > >A Python command line app which requires some packages which are not in >the standard library. Are they o

Re: How to package a Python command line app?

2021-12-09 Thread Loris Bennett
> > admit I am pretty confused. >> > >> > Here is what I have: >> > >> > A Python command line app which requires some packages which are >> > not in the standard library. >> > >> > I am on Linux and like to have an executable

Re: How to package a Python command line app?

2021-12-08 Thread Manfred Lotz
Hi Loris, On Wed, 08 Dec 2021 15:38:48 +0100 "Loris Bennett" wrote: > Hi Manfred, > > Manfred Lotz writes: > > > The are many possibilities to package a Python app, and I have to > > admit I am pretty confused. > > > > Here is what I have: &g

Re: How to package a Python command line app?

2021-12-08 Thread Loris Bennett
Hi Manfred, Manfred Lotz writes: > The are many possibilities to package a Python app, and I have to admit > I am pretty confused. > > Here is what I have: > > A Python command line app which requires some packages which are not in > the standard library. > > I am o

How to package a Python command line app?

2021-12-08 Thread Manfred Lotz
The are many possibilities to package a Python app, and I have to admit I am pretty confused. Here is what I have: A Python command line app which requires some packages which are not in the standard library. I am on Linux and like to have an executable (perhaps a zip file with a shebang

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-13 Thread Greg Ewing
On 13/11/21 7:23 pm, Abdur-Rahmaan Janhangeer wrote: os.getcwd is giving the path of site-packages and not the directory from which the command is run from. Something must be changing the working directory before getcwd is called. Once that happens there's no way I know of to find out what it w

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-13 Thread Abdur-Rahmaan Janhangeer
Greetings, This is what I am trying to do: How to get the getcwd of the directory of where the command is run and not that of the file where the cli entrypoint is found. Having the user enter the absolute path as a cli argument does not sound nice. Kind Regards, Abdur-Rahmaan Janhangeer about

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-13 Thread Barry
> On 13 Nov 2021, at 06:26, Abdur-Rahmaan Janhangeer > wrote: > > Only thing is that os.getcwd is giving the path of site-packages and not > the directory from > which the command is run from. In which case the code is doing a os.chdir() before the call to os.getwd(). You need to call getwd(

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread Abdur-Rahmaan Janhangeer
Greetings, Well since sometimes i have this: https://github.com/shopyo/shopyo Old versions worked as we are using it for FlaskCon , even newer versions until sometimes ago. shopyo has a copy of the project which is a flask app in site-packages. upon using sh

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread Greg Ewing
On 13/11/21 10:51 am, Abdur-Rahmaan Janhangeer wrote: ow do i get the path from which miaw the command is called from? What exactly do you mean by "called from"? If you want the user's working directory, os.getcwd() will give you that. If you want something else, you'll have to give us more d

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread dn via Python-list
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Let's say i created a package named miaw > > miaw also has a cli command called miaw > > miaw prints files and folders in the directory it is called in > > except that when miaw is used, it prints the files and folders i

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread David L Neil via Python-list
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Let's say i created a package named miaw > > miaw also has a cli command called miaw > > miaw prints files and folders in the directory it is called in > > except that when miaw is used, it prints the files and folders i

Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread Abdur-Rahmaan Janhangeer
Greetings list, Let's say i created a package named miaw miaw also has a cli command called miaw miaw prints files and folders in the directory it is called in except that when miaw is used, it prints the files and folders in site-packages This is an analogy for a package i have. Well forget

Re: Making command-line args available to deeply-nested functions

2021-09-10 Thread Loris Bennett
ect. >>> >> >>> >> However, the question of how to parse the arguments is somewhat >>> separate >>> >> from that of how to pass (or not pass) the arguments around within a >>> >> program. >>> >>> [snip (16 lin

Re: Making command-line args available to deeply-nested functions

2021-08-31 Thread George Fischhof
; from that of how to pass (or not pass) the arguments around within a >> >> program. >> >> [snip (16 lines)] >> > >> > Hi, >> > I thought not just parsing, but the usage method: you add a decorator to >> > the function where you want to use t

Re: Making command-line args available to deeply-nested functions

2021-08-29 Thread George Fischhof
sage method: you add a decorator to > > the function where you want to use the parameters. This way you do not > have > > to pass the value through the calling hierarchy. > > > > Note: typer is a newer package, it contains click and leverages command > > line par

Re: Making command-line args available to deeply-nested functions

2021-08-26 Thread Loris Bennett
thin a >> program. [snip (16 lines)] > > Hi, > I thought not just parsing, but the usage method: you add a decorator to > the function where you want to use the parameters. This way you do not have > to pass the value through the calling hierarchy. > > Note: typer is a new

Re: Making command-line args available to deeply-nested functions

2021-08-23 Thread George Fischhof
021 at 11:54:00 UTC+2, Loris Bennett wrote: > >> >> Hi, > >> >> > >> >> TL;DR: > >> >> > >> >> If I have a command-line argument for a program, what is the best way > >> >> of making this available to a deeply-nested[1] fu

Re: Making command-line args available to deeply-nested functions

2021-08-23 Thread Loris Bennett
George Fischhof writes: > Loris Bennett ezt írta (időpont: 2021. aug. > 20., P 17:54): > >> Julio Di Egidio writes: >> >> > On Friday, 20 August 2021 at 11:54:00 UTC+2, Loris Bennett wrote: >> >> Hi, >> >> >> >> TL;DR: >&g

Re: Making command-line args available to deeply-nested functions

2021-08-21 Thread George Fischhof
Loris Bennett ezt írta (időpont: 2021. aug. 20., P 17:54): > Julio Di Egidio writes: > > > On Friday, 20 August 2021 at 11:54:00 UTC+2, Loris Bennett wrote: > >> Hi, > >> > >> TL;DR: > >> > >> If I have a command-line argument for a progr

Making command-line args available to deeply-nested functions

2021-08-20 Thread Loris Bennett
Hi, TL;DR: If I have a command-line argument for a program, what is the best way of making this available to a deeply-nested[1] function call without passing the parameter through every intermediate function? Long version: If I have, say, a command-line program to send an email with a

Re: Making command-line args available to deeply-nested functions

2021-08-20 Thread Loris Bennett
Julio Di Egidio writes: > On Friday, 20 August 2021 at 11:54:00 UTC+2, Loris Bennett wrote: >> Hi, >> >> TL;DR: >> >> If I have a command-line argument for a program, what is the best way >> of making this available to a deeply-nested[1] function

Re: How to run Jupyter notebook in command line and get full error message?

2020-11-29 Thread Skip Montanaro
> > My VPN keeps dropping and can not run Jupyter Notebook as it is. > You don't provide a lot of detail, but this seems similar to the kind of flaky networking we used to deal with in the Before Times. Simply connecting directly to a host over the Internet was often plagued by disconnects. For th

How to run Jupyter notebook in command line and get full error message?

2020-11-28 Thread Shaozhong SHI
How to run Jupyter notebook in command line and get full error messages? My VPN keeps dropping and can not run Jupyter Notebook as it is. I started to use nbconvert in command line. But, when it stops due to error, I can not see where the error occurs. In order to make life easier for

Re: Embedding version in command-line program

2020-10-20 Thread Loris Bennett
"Loris Bennett" writes: > Tony Flury writes: > >> On 07/10/2020 12:06, Loris Bennett wrote: >>> Hi, >>> >>> I have written a program, which I can run on the command-line thus >>> >>>mypyprog --version >>> >&g

Re: Embedding version in command-line program

2020-10-19 Thread Loris Bennett
Tony Flury writes: > On 07/10/2020 12:06, Loris Bennett wrote: >> Hi, >> >> I have written a program, which I can run on the command-line thus >> >>mypyprog --version >> >> and the get the version, which is currently derived from a variable in &

Re: Embedding version in command-line program

2020-10-17 Thread Tony Flury via Python-list
On 07/10/2020 12:06, Loris Bennett wrote: Hi, I have written a program, which I can run on the command-line thus mypyprog --version and the get the version, which is currently derived from a variable in the main module file. However, I also have the version in an __init__.py file and in

Re: Embedding version in command-line program

2020-10-12 Thread Loris Bennett
ackageNotFoundError` exception (of course you > could > catch that and fall back to trying to read the pyproject.toml file). You're right of course, that 'poetry_version' just looks at the toml file. I'm using Python 3.6, so I had to do import importlib_metadata as metad

Re: Embedding version in command-line program

2020-10-09 Thread Heinrich Kruger
‐‐‐ Original Message ‐‐‐ On Thursday, October 8, 2020 2:00 PM, Loris Bennett wrote: > Marco Sulla marco.sulla.pyt...@gmail.com writes: > > > On Wed, 7 Oct 2020 at 14:16, Loris Bennett loris.benn...@fu-berlin.de > > wrote: > > > > > But the toml file isn't part of the distribution and so

Re: Embedding version in command-line program

2020-10-08 Thread Loris Bennett
Marco Sulla writes: > On Wed, 7 Oct 2020 at 14:16, Loris Bennett > wrote: > >> But the toml file isn't part of the distribution and so it won't be >> installed. >> >> I suppose I could write a separate program which parses the toml file >> and then just injects the version into __init__.py. > >

Re: Embedding version in command-line program

2020-10-07 Thread Loris Bennett
Hi Marco, Marco Sulla writes: > In __init__.py, you can parse the toml file, extract the version and > store it in a __version__ variable. But the toml file isn't part of the distribution and so it won't be installed. I suppose I could write a separate program which parses the toml file and th

Re: Embedding version in command-line program

2020-10-07 Thread Marco Sulla
On Wed, 7 Oct 2020 at 14:16, Loris Bennett wrote: > But the toml file isn't part of the distribution and so it won't be > installed. > > I suppose I could write a separate program which parses the toml file > and then just injects the version into __init__.py. Yes, I do not know poetry, but I sup

Re: Embedding version in command-line program

2020-10-07 Thread Marco Sulla
In __init__.py, you can parse the toml file, extract the version and store it in a __version__ variable. -- https://mail.python.org/mailman/listinfo/python-list

Embedding version in command-line program

2020-10-07 Thread Loris Bennett
Hi, I have written a program, which I can run on the command-line thus mypyprog --version and the get the version, which is currently derived from a variable in the main module file. However, I also have the version in an __init__.py file and in a pyproject.toml (as I'm using p

Re: Trying to test SelectDateWidget as SelectMonthDayWidget on command line

2019-06-03 Thread MRAB
ed 'html['month']' so, I decided to convert it to command line to get a better picture of what's going on. Unfotunately, now I get: Traceback (most recent call last): File "SelectMDWidget.py", line 34, in class SelectMonthDayWidget(month,day_ok):

Trying to test SelectDateWidget as SelectMonthDayWidget on command line

2019-06-03 Thread eileen
Hi, I'm a newbie and I want to change the Django SelectDateWidget to SelectMonthDayWidget because I can't use the year in my application. I had been getting another error (which I don't recall right now) on the statement that started 'html['month']' so, I de

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Thomas Jollans
On 2018-08-16 14:33, Chris Angelico wrote: > On Thu, Aug 16, 2018 at 8:32 PM, Thomas Jollans wrote: >> On 2018-08-16 01:05, Chris Angelico wrote: >>> On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: And as an additional alternative, when I want something weird (extra python args

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Chris Angelico
On Thu, Aug 16, 2018 at 8:32 PM, Thomas Jollans wrote: > On 2018-08-16 01:05, Chris Angelico wrote: >> On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: >>> And as an additional alternative, when I want something weird (extra python >>> args or the like) I usually make my script.py into a m

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Thomas Jollans
On 2018-08-16 01:05, Chris Angelico wrote: > On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: >> And as an additional alternative, when I want something weird (extra python >> args or the like) I usually make my script.py into a module and invoke it >> via a shell script, eg: >> >> #!/bin/

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Ben Finney
David Raymond writes: > So what are you saying is an option vs an argument? Because I see no > distinction whatsoever. The command-line conventions do recognise the distinction. * A command-line argument specifies input to the program. For example, the destination file for a ‘cp’ comm

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Malcolm Greene
Thanks to everyone who contributed to this thread. Great feedback and suggestions! - Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Chris Angelico
On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: > And as an additional alternative, when I want something weird (extra python > args or the like) I usually make my script.py into a module and invoke it > via a shell script, eg: > > #!/bin/sh > exec /particular/python python-opts... -m sc

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Cameron Simpson
On 15Aug2018 20:54, eryk sun wrote: On Wed, Aug 15, 2018 at 9:22 AM, Thomas Jollans wrote: If you really want to, you can pass a *single* argument in your #! line, e.g.: #!/usr/bin/python3 -Wd This works for options that can be grouped into a single argument. Multiple -X options aren't supp

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread eryk sun
On Wed, Aug 15, 2018 at 9:22 AM, Thomas Jollans wrote: > > If you really want to, you can pass a *single* argument in your #! line, > e.g.: > > #!/usr/bin/python3 -Wd This works for options that can be grouped into a single argument. Multiple -X options aren't supported, nor is combining a -X opt

RE: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread David Raymond
to python.exe", or the more difficult method of "muck about with the OS's convenience method to get it to do something magical." -Original Message- From: Python-list [mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of Malcolm Greene Sent: Tu

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Thomas Jollans
On 14/08/18 23:45, Malcolm Greene wrote: > When you run a script via "python3 script.py" you can include command > line options like -b, -B, -O, -OO, etc between the "python3" interpreter > reference and the script.py file, eg. "python3 -b -B -O -OO script.py&qu

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Malcolm Greene
assed on the command line following the script's name). Here's a description of the options I'm referring to: https://docs.python.org/3/using/cmdline.html#generic-options -- https://mail.python.org/mailman/listinfo/python-list

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Malcolm Greene
> If you run the script directly, by entering >script.py or clicking a script > icon or name in File Explorer, it runs python without python options *other > than those specified in environmental variables*. Understood. I thought there might have been a way to pass Python option values via a si

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Michael F. Stemper
On 2018-08-14 16:45, Malcolm Greene wrote: > When you run a script via "python3 script.py" you can include command > line options like -b, -B, -O, -OO, etc between the "python3" interpreter > reference and the script.py file, eg. "python3 -b -B -O -OO script.py&qu

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Terry Reedy
On 8/14/2018 5:45 PM, Malcolm Greene wrote: When you run a script via "python3 script.py" you can include command line options like -b, -B, -O, -OO, etc between the "python3" interpreter reference and the script.py file, eg. "python3 -b -B -O -OO script.py". More generally, python script.py

How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Malcolm Greene
When you run a script via "python3 script.py" you can include command line options like -b, -B, -O, -OO, etc between the "python3" interpreter reference and the script.py file, eg. "python3 -b -B -O -OO script.py". When you create a script that is executable directly

Re: command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
On Wed, 2018-06-20 at 12:36 +0200, George Fischhof wrote: > Hi, > You can also try click library from pypi, that is a very good command line > stuff. > > George Thank you for the tip. I am away of click and it's awesomeness, but am hesitant because it's not apart of std

Re: command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Thanks Peter! That's pretty slick. I will get it working for sure now. Regards, Brian -- https://mail.python.org/mailman/listinfo/python-list

Re: command line utility for cups

2018-06-20 Thread George Fischhof
endAction(option_strings=['-o'], dest='o', nargs=None, const=None, > default=None, type= at 0x7feef70a8510>, choices=None, > help=None, metavar=None) > >>> parser.parse_args(["-o", "a=b", "-o", "c=d"]) > Namespace(o=[['a', 'b'], ['c', 'd']]) > > > -- > https://mail.python.org/mailman/listinfo/python-list Hi, You can also try click library from pypi, that is a very good command line stuff. George > > -- https://mail.python.org/mailman/listinfo/python-list

Re: command line utility for cups

2018-06-20 Thread Peter Otten
Brian Oney via Python-list wrote: > Dear all, > > I am having trouble with argparse. I am trying to translate the following > line to a sleek python script: > > lpr -o media=legal -o sides=two-sided-long-edge filename > > Now where I am. > > import argparse > parser = argparse.ArgumentParser(d

command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Dear all, I am having trouble with argparse. I am trying to translate the following line to a sleek python script: lpr -o media=legal -o sides=two-sided-long-edge filename Now where I am. import argparse parser = argparse.ArgumentParser(description='Print stuff with cups') parser.add_argument(

Re: pip and command line

2018-03-11 Thread Terry Reedy
On 3/11/2018 2:08 PM, GISDude wrote: On Saturday, March 10, 2018 at 10:28:00 AM UTC-8, Terry Reedy wrote: Why can't I use pip while in IDLE Would you expect to use pip in MS Excel? If you type 'python' at a command line, and get the '>>>' REPL prompt (goo

Re: pip and command line

2018-03-11 Thread GISDude
modules included with Anaconda. > > If you are just starting with Python, and do not work somewhere that > uses 2.7, I would ignore 2.7. Unless you absolutely need the 32 bit > version, I delete it. > > > I'm having a problem using pip: > > 1. Does one have to

Re: pip and command line

2018-03-10 Thread Terry Reedy
'm having a problem using pip: 1. Does one have to use pip in the commandline? Yes, use command line programs in a command line console/window. Why can't I use pip while in IDLE Would you expect to use pip in MS Excel? If you type 'python' at a command line, and get t

pip and command line

2018-03-10 Thread GISDude
Hi all, I'm hoping someone could help a wannabe python coder out. I'm an aspiring Data/AI/ML coder/programmer/datafiend - that might help with my situation. In my various fits of python downloads, I've managed to download Anaconda, Pyscripter, IDLE(3.6/32 AND 64bit), IDLE 2.7. I'm thinking of Py

Command-line torrent search tool (windows/linux)

2017-08-02 Thread Kryptxy via Python-list
Torrench - A Command-line torrent search tool - For windows and Linux OS The tool fetches torrents from existing torrent-hosting sites. Websites supported: 1. linuxtracker.org - Get linux distros ISO torrents 2. ThePirateBay - Do read usage instructions. Project is in python3, and is completely

Re: Installation Python 3.6.x on Windows using command line installer (without GUI)

2017-07-28 Thread Irmen de Jong
On 27/07/2017 20:55, Andreas Jung wrote: > > I need to installed Python 3.6.x on Windows as part of an automated process > without user-interaction. Recently Python releases provided MSI files for > installation using the "msiexec" utility however there are no more MSI > release files available

Installation Python 3.6.x on Windows using command line installer (without GUI)

2017-07-27 Thread Andreas Jung
I need to installed Python 3.6.x on Windows as part of an automated process without user-interaction. Recently Python releases provided MSI files for installation using the "msiexec" utility however there are no more MSI release files available for Python 3.6.X. Are there any alternatives? -aj

Re: Python Command Line Arguments

2017-04-17 Thread breamoreboy
On Saturday, April 15, 2017 at 6:45:51 PM UTC+1, Grant Edwards wrote: > On 2017-04-14, Bernd Nawothnig wrote: > > > He should switch to argparse in any case because getopt is no longer > > supported and does only receive bugfixes. > > In my book, "receiving bug fixes" means it's still supported.

Re: Python Command Line Arguments

2017-04-17 Thread breamoreboy
ify it to what I need, it only half works. The problem is the > >> try/except. If you don't specify an input/output, they are blank at the end > >> but it shouldn't be. > >> > >> import getopt > >> import sys > > > > I am guessin

Re: Python Command Line Arguments

2017-04-15 Thread Grant Edwards
On 2017-04-14, Bernd Nawothnig wrote: > He should switch to argparse in any case because getopt is no longer > supported and does only receive bugfixes. In my book, "receiving bug fixes" means it's still supported. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Command Line Arguments

2017-04-14 Thread Bernd Nawothnig
u don't specify an input/output, they are blank at the end >> but it shouldn't be. >> >> import getopt >> import sys > > I am guessing you are wanting to parse command-line arguments rather than > particularly wanting to use the getopt module. >

Re: Python Command Line Arguments

2017-04-12 Thread ian . stegner
On Thursday, April 13, 2017 at 12:38:48 PM UTC+10, MRAB wrote: > On 2017-04-13 02:59, ian.steg...@gmail.com wrote: > > I have this code which I got from > > https://www.tutorialspoint.com/python/python_command_line_arguments.htm The > > example works fine but when I modify it to what I need, it o

  1   2   3   4   5   6   7   8   9   10   >