Improving -x switch on CLI interface

Hi. What about improving the -x switch by passing the number of lines to ignore? Ex: -x (default=1 line) -x n (Python will ignore first n lines of file). I think it will allow us to execute some Windows commands before running python. Install modules, etc... Thanks in advance. -- Rafael Nunes nunes.rafael@gmail.com

On Sun, May 15, 2022 at 07:32:56PM -0300, Rafael Nunes wrote:
Hi Rafael, You have answered Eric's question with *what* you would do (write Windows Shell commands in a .BAT file) but a use-case is *why* you would do it. What sort of real-world problems are you solving by turning a .py file into a .bat file with Windows shell commands at the beginning? Which shell commands do you expect to use? The next question would be, couldn't you re-write those shell commands as Python code? Or have the .BAT file call Python and run the .py file? -- Steve

On Sun, May 15, 2022 at 07:32:56PM -0300, Rafael Nunes wrote:
Hi Rafael, You have answered Eric's question with *what* you would do (write Windows Shell commands in a .BAT file) but a use-case is *why* you would do it. What sort of real-world problems are you solving by turning a .py file into a .bat file with Windows shell commands at the beginning? Which shell commands do you expect to use? The next question would be, couldn't you re-write those shell commands as Python code? Or have the .BAT file call Python and run the .py file? -- Steve
participants (3)
-
Eric V. Smith
-
Rafael Nunes
-
Steven D'Aprano