Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106427 > unrolled thread
| Started by | Ganesh Pal <ganesh1pal@gmail.com> |
|---|---|
| First post | 2016-04-04 13:34 +0530 |
| Last post | 2016-04-04 13:34 +0530 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
how to optimize the below code with a helper function Ganesh Pal <ganesh1pal@gmail.com> - 2016-04-04 13:34 +0530
| From | Ganesh Pal <ganesh1pal@gmail.com> |
|---|---|
| Date | 2016-04-04 13:34 +0530 |
| Subject | how to optimize the below code with a helper function |
| Message-ID | <mailman.5.1459757101.32530.python-list@python.org> |
Hi Team,
Iam on python 2.7.10 and Linux.
I have a python function where the similar kind of pattern repeating 100
of times
Sample code snippet:
test01_log = os.path.join(LOG_DIR, "test01.log")
cls.get_baddr['test01'] = failure.run_tool(
test01_log, object="inode", offset="18", size="4",
optype="set")
test02_log = os.path.join(LOG_DIR, "test02.log")
cls.get_baddr['test02'] = failure.run_tool(
test02_log, lin=lin_02, object="lin", offset="100", size="5",
optype="set")
..............................................------------------------
test100_log = os.path.join(LOG_DIR, "test100.log")
cls.get_baddr['test100'] = failure.run_tool(
test02_log, baddr=lin_02, object="baddr", offset="100", size="5",
optype="set")
(1) Any tips how I can optimize this i.e test case, should have a helper
function that all test cases call.
(2) Also note that failure.run_tool function can have variable number of
argments how to handle this in the helper function?
Thanks in advance
Regards,
Ganesh
Back to top | Article view | comp.lang.python
csiph-web