Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84619

Re: Running a .py file iteratively at the terminal

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Running a .py file iteratively at the terminal
Date 2015-01-26 20:30 +0000
References <bea3815c-7a64-417a-959c-9408581a643e@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.18158.1422304262.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 26/01/2015 19:52, varun7rs@gmail.com wrote:
> Hello Everyone,
>
> I am running a python script as of now and I have to change three global values repeatedly. I'm tired of doing this manually. SO, I was wondering if there is a way to run a python command repeatedly. In my case, the command would be
>
> srva@hades:~$ python NFV_v3_7_10_14.py -l log --lp --xml eu_v3_14_1_15.xml
>
> Everytime I run this, I get a log file with the results. The main file is the NFV_v3....py. These are the values I intend to change iteratively and then run the command in the terminal.
> dataplane_latencybound = 200 # The delay bounds are in milli seconds
> controlplane_latencybound1 = 200 # The delay bounds are in milli seconds
>
> So, in every iteration, I would like to increase it from 0 in steps of 10 till 200. And after doing so, I'd like to run the command. But, I'm unaware of doing this using a single script. I hope some of you experts over there could help me in this issue. It can be a huge timesaver.
>
>
> Thanks a lot guys
> Varun RS
>

I think you need this:-

dataplane_latencybound in range(0, 205, 10):
     doSomething(dataplane_latencybound)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Running a .py file iteratively at the terminal varun7rs@gmail.com - 2015-01-26 11:52 -0800
  Re: Running a .py file iteratively at the terminal Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-26 20:30 +0000
    Re: Running a .py file iteratively at the terminal varun7rs@gmail.com - 2015-01-26 13:10 -0800
      Re: Running a .py file iteratively at the terminal Cameron Simpson <cs@zip.com.au> - 2015-01-27 09:35 +1100
      Re: Running a .py file iteratively at the terminal Philip Keogh <pkeogh@compusoftcs.com> - 2015-01-26 13:30 -0800

csiph-web