When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if required. Does it matter at all that
Scott wrote:
When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if required. Does it
Scott wrote:
When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if required. Does it
r0g wrote:
Scott wrote:
When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
called.
However, please consider writing complete,
On Jan 11, 2010, at 2:50 PM, Phlip wrote:
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables
outside
a function in order to avoid re-creating them every time the
function is
called.
On Jan 11, 1:50 pm, Phlip phlip2...@gmail.com wrote:
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
On Mon, 11 Jan 2010 18:57:09 +, MRAB wrote:
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
called.
Actually there is, but the benefit (avoiding the re-creation of the
table) may be worth
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
called.
Brilliant! I didn't think of that. I guess I accidentally did it right
this time as I query that dictionary quite a few times from the