mick verdu wrote:
> ThanK you. It solved my problem.
> Can someone tell me how can i print particular value inside list of key.
>
> I know how to print J['PC2'][1] means will print IP. but I want the user
> to input some element and I will print element just before that element.
>
> e.g. if user
ThanK you. It solved my problem.
Can someone tell me how can i print particular value inside list of key.
I know how to print J['PC2'][1] means will print IP. but I want the user to
input some element and I will print element just before that element.
e.g. if user inputs 192.168.0.2, program wil
mick verdu wrote:
What I want is if host already exists it would
overwrite otherwise add to database. And if host doesn't exist it will first
add this host to database and then compare its IP with IPs of rest of hosts.
If ip matches with any of the other hosts, it will delete the host that it
jus
On 26/01/2014 20:28, mick verdu wrote:
I have programming course and trying to learn things. This is of no human use.
I am just following exercises. Just have to do steps as asked.
A slightly OT observation... Mick, consider using more meaningful names
than t,z etc. You know what they stand
On Sun, 26 Jan 2014 10:47:11 -0800, mick verdu wrote:
> z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
> 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1':
> ['01:01:01:01:01:01', '192.168.0.1', '200'] }
>
> My solution:
>
> z=raw_input("Enter Host, Mac, ip and time")
>
I have programming course and trying to learn things. This is of no human use.
I am just following exercises. Just have to do steps as asked.
--
https://mail.python.org/mailman/listinfo/python-list
@Peter Otten:
I have lists for keys. What I want is if host already exists it would overwrite
otherwise add to database. And if host doesn't exist it will first add this
host to database and then compare its IP with IPs of rest of hosts. If ip
matches with any of the other hosts, it will delete
On 2014-01-26 10:47, mick verdu wrote:
> z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
> 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'],
> 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] }
>
> My solution:
>
> z=raw_input("Enter Host, Mac, ip and time")
> t=z.split()
> t[
mick verdu wrote:
> z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
> 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'],
> 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] }
>
> My solution:
>
> z=raw_input("Enter Host, Mac, ip and time")
> t=z.split()
> t[0]=z[1:]
> for key i
z={ 'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'],
'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'],
'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200'] }
My solution:
z=raw_input("Enter Host, Mac, ip and time")
t=z.split()
t[0]=z[1:]
for key in dic:
if t[2] in dic[key]:
10 matches
Mail list logo