Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+4
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
2 Commented Posts
~73.8K People Reached
Favorite Forums
Favorite Tags
Member Avatar for novice20

[B]Hi all.. I need to do a condition check in a script. The same condition check needs to be repeated in another script. So, I am looking for a way, where i can set, say a flag in the first script ,upon meeting the condition, and be able to access …

Member Avatar for Cisco_1
0
37K
Member Avatar for novice20

hi all... how to find the localhost ip address in python [B]import socket socket.gethostbyname(socket.gethostname())[/B] gives me 127.0.0.1 instead of my ip address any help...........

Member Avatar for Suraj_2
0
916
Member Avatar for novice20

hi, using ftplib.storbinary(), i am able to successfully upload files of size 60KB, but not of size 7,218 KB and also 26 KB... I am wondering why is this happening??? should file sizes be a multiple of 10...or what is the actual problem??????????? any reply would be greatly helpful....... I …

Member Avatar for Schol-R-LEA
0
133
Member Avatar for novice20

Hi all... I am trying to upload 4 files on a local disk, onto a remote ftp server. All of them are in the same folder(in local machine). I am using the storbinary function of ftplib. Following are the file sizes: 1-- 70 KB 2-- 60 KB 3-- 73 KB …

Member Avatar for novice20
0
116
Member Avatar for novice20

Hi all, i have different modules developed so far, and a main script needs to call the modules based on user's choice. will doing like this work?? using raw_input(), i wait for user choice, and once a choice is made, corresponding module is called. if main.py, does an 'import xxx.py' …

Member Avatar for novice20
0
187
Member Avatar for novice20

Hi all, Here is a part of my code: [CODE]#-- if the ports are mapped properly if(map_dict1[int(MIO_outports1[i])] == int(Exp_map_inport[i]) ): flag = 1 elif(map_dict2[int(MIO_outports1[i])] == int(Exp_map_inport[i])): flag = 1 else: flag = 0 [/CODE] But I am not able to navigate to the 'elif' part. I am getting : [CODE] …

Member Avatar for TrustyTony
0
275
Member Avatar for novice20

Hi, I want to do something like this: I have two lists: list1 = range(6) list2 = range(10,15) i want a dictionary like this: adict ={0:10, 1:11, 2:12, 3:13, 4:14, 5:15 } I did the following: [CODE]list1 = range(6) list2 = range(10,15) adict = dict(zip(list1,list2))[/CODE] i get : [B]TypeError: list …

Member Avatar for novice20
0
230
Member Avatar for novice20

Hello, can anyone help me regarding how this can be done? I need to declare an 'array' which has 95 indices, and each entry holds 8 bits each of data. am doing this with: PORT_MAP_LEN = 764/8 bit_map_len = [0]*PORT_MAP_LEN but it is giving me list index out of range …

Member Avatar for novice20
0
517
Member Avatar for novice20

Hi, I am working with [B]python2.4 on windows[/B], and want pysnmp to be imported. Have downloaded [B]pysnmp-4.1.14a.tar.gz[/B] and [B]pyasn1-0.0.12a.tar.gz[/B] and put it under [B]D:\Python24\Lib\site-packages\[/B]. Still i am getting the import error. from pysnmp.entity.rfc3413.oneliner import cmdgen ImportError: No module named pysnmp.entity.rfc3413.oneliner What should I do to make pysnmp importable?

Member Avatar for snippsat
0
2K
Member Avatar for novice20

Hi all, I need to set some variables via Pysnmp which take 'unsigned int' only. Is python int by default a 32 bit- signed int? How do I convert it into 16 and 8 bit- unsigned ints? I need to read two registers consequently( which are of 8 bits each) …

Member Avatar for vegaseat
0
9K
Member Avatar for novice20

Hi all, Is there any way to do forward referencing or function prototyping in python..? Being an interpreted language, is lack of forward referencing a drawback of python?

Member Avatar for novice20
0
4K
Member Avatar for novice20

using pysnmp I am querying a variable which gives the IP address. I want to check that address. I do the following [CODE] ........... ............ ............. errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( cmdgen.CommunityData('xxx', 'yyy', 1), cmdgen.UdpTransportTarget((addr,161)), ((1,3,6,1,4,1,18489,1,2,2,2,9,30,0))) print"Error on GET for ccmSDIDULinkUtilEastRemoteIP -%s,%s%(errorIndication,errorStatus) print varBinds print varBinds[0][1] [/CODE] i get …

Member Avatar for novice20
0
195
Member Avatar for novice20

hi all.. I need to issue a 'ping' to an ip address via my script and check whether it is up? can I issue it using os.system? can I capture the output and analyze to see if the host is up??

Member Avatar for novice20
0
2K
Member Avatar for novice20

Hi, I get the log messages 'twice' on the console and only once in the log file. Can any one tell me the reason for this duplication on console? here is how I have set the logger: [ICODE]import logging #--set up logging to file logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d …

Member Avatar for novice20
0
101
Member Avatar for novice20

Hi, I have a for loop something like: [CODE]for n in range(no_of_rows): #--configuring ODU Op mode odu_op_mod=list1[n] odu_op_mode= odu_enum["%s"%odu_op_mod] if (odu_op_mod == 'blahblah'): #------------ elif(odu_op_mod == 'aaa'): #-------- elif(odu_op_mode =='xxx'): #----- elif(odu_op_mod == 'yyy'): #------------------- elif(odu_op_mod == 'zzz'): #------------- logging.info("*******************************************************************") subprocess.call(['python link_config_idu12.py %s'%addr],shell=True) [/CODE] I have different lists, list1 #for …

Member Avatar for novice20
0
3K
Member Avatar for novice20

I want 1.py to call 2.py. 1.py takes an Ip address as a command line argument. I am trying a '[B]subprocess.call()[/B]' in 1.py to call 2.py. I have defined addr= sys.argv[1] before the [B]main()[/B] of 1.py. I want the same address to be accessed in 2.py. In short, 1.py should …

Member Avatar for slate
0
180
Member Avatar for novice20

Hi, in the pysnmp tutorial, I couldn't find an equivalent for snmpwalk. What can be used?

0
52
Member Avatar for novice20

hi... using pysnmp, an 'snmp get' varBinds gives me an 'octet string' of values like: 1+1 Protection; East-West; Spiral Search; ODU Enable/Disable I need to loop through these strings and see whether a particular string say, 'East-West' is present. I am not finding way to do this. can this octet …

Member Avatar for LoveMyPadres
0
2K
Member Avatar for novice20

[B]hi all using telnetlib, I am issuing a 'top' command on a remote host. Top seems to continue indefinitely. On a terminal, I can use CTRL+c to suspend the process... What can be passed in telnet.write() equivalently to suspend the process , yet retain the output so far... pls help …

Member Avatar for novice20
0
749
Member Avatar for novice20

[B]hi, my problem is as such... I am establishing a telnet session to an IP using telnetlib module. I read the free memory on the board using telnet.write("free\n"). after this i call a system command 'snmpwalk' to walk the MIBs of the IP above. I again need to establish the …

Member Avatar for novice20
0
112
Member Avatar for novice20

Hi... I have a set of strings as below: [CODE]4:14.4-17M,5:14.4-2e13M,6:14.4-4e9M,7:14.4-8e,22:28.4-35M,23:28.4-2e30M,24:28.4-4e26M,25:28.4-8e18M,26:28.4-16e2M,27:28.4-18e,28:14.16-36M,29:14.16-2e32M,30:14.16-4e28M,31:14.16-8e20M[/CODE] I want everything after the ':' to be discarded. i.e., i just want a list of what preceeds ':' (4,5,6,7,22,.................) How can this be done?

Member Avatar for novice20
0
107
Member Avatar for novice20

can anyone suggest a simple method to define an enum in python. as some examples floating on net, i used class Animal: DOG=1 CAT=2 print Animal.DOG but it doesn't seem to be working...

Member Avatar for novice20
0
124
Member Avatar for novice20

telnetlib is helping me to connect to remote host and do the user login. but, when i try doing the super user login, it hangs ............... .............. ............... User="abc" Password="abc" Superuser_id="yyy" su_passwd="xxx" #-- establish a telnet connection to all the remote hosts in the list except the host running script …

Member Avatar for Simplified
0
171
Member Avatar for novice20

hi, I just came accross the csv module to deals with csv files in python. suppose my csv file has two rows: 1,2,3,4 5,6,7,8 and i want to access each item at a time, i.e., 1 followed by 2 and so on....what can be done? [B]import csv reader= csv.reader(open('filename.csv','r'),delimiter=' ') …

Member Avatar for richieking
0
262
Member Avatar for novice20

[B]$? in linux gives the exit status of the recently executed command , as i have learnt. suppose i give a cd command at the terminal and if such a directory or file is not present, echo $? following it gives me 1. but, when the same is run via …

Member Avatar for novice20
0
130
Member Avatar for novice20

I need to install python 2.4 on a fedora 3 system. I followed the instructions in [B][url]http://www.python.org/download/releases/2.4/rpms/[/url][/B] i have the following contents in [B]/etc/yum.repos.d/python24.repo[/B] [B][python24] name=Fedora Core 3 - $basearch - Python 2.4 baseurl=http://www.python.org/ftp/python/2.4/rpms/fedora-3/ enabled=1 gpgcheck=1[/B] further following the instructions, [B]rpm --import [url]http://www.python.org/ftp/python/2.4/rpms/KRUD-GPG-KEY[/url][/B] gave me: [B]error: [url]http://www.python.org/ftp/python/2.4/rpms/KRUD-GPG-KEY:[/url] import read failed.[/B] …

0
47
Member Avatar for novice20

[B]hi.... i created a telnet connection to a remote server using telnetlib and excuted few commands using telnet.write. can't a python script residing on the remote host be run using telnet.write? i.e, do something like telnet.write("./script_name.py argument1 arguement2........") after the connection is established?[/B]

Member Avatar for novice20
0
58
Member Avatar for novice20

[B]hi all, can anyone tell me how to open a folder on a remote machine connected on same LAN. I need to open a folder in the form "\\remote_machine\folder1\folder2\folder3"[/B]

Member Avatar for novice20
0
3K
Member Avatar for novice20

hi all, can anyone tell me hoe to open a file from one machine, when the file is present on a remote machine, specifying it's IP address?

Member Avatar for richieking
0
624
Member Avatar for novice20

[B]How to validate an IP Address using python? It should reject the shorter addresses such as 192.168 instead of padding the rest of the bits the address with 0s[/B]

Member Avatar for TrustyTony
0
43