Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~7K People Reached
Favorite Forums
Favorite Tags

26 Posted Topics

Member Avatar for prashanth s j

Hi all, could anyone please provide me a simple example of python threads? I tried looking at the python cookbook, but I find it quite confusing with its mentioning of thread, threading etc (I am familiar with threads in C only) All I want is: From my machine I need …

Member Avatar for Gribouillis
0
346
Member Avatar for prashanth s j

Hi all, I have a double pointer in C as follows: [code] void foo(char * , char**); main( ) { char * inbuff = {0x10,0x20}; char * outbuff; foo(inbuff, (char **) &outbuff); } void foo(char *inbuff, char ** outbuff); { //code to manipulate inbuff and outbuff. *outbuff = (char *) …

Member Avatar for hussnain abass
0
360
Member Avatar for prashanth s j

Hi all, I wanted to write the following line to the file. [code] sys.stdout.write("123: The metro polis\n") [/code] But the line that was written is: [code] sys.stdout.write("100: The metro polis ") [/code] How do I get the \n to be written in the text form to the? file(ie it should …

Member Avatar for TrustyTony
0
101
Member Avatar for prashanth s j

Hi all, the following is the result of executing a command on cli of a machine 192.148.2.10: [code] PGK:1200>> show employee record show employee record EmIL Desig Street Street2 Occupation Avialability ------ ----- ------------- ------------- ---------- ------------- ----------- 3222 HOD MorganLayout HB colony Engineer Yes 3321 Read Banker's colony James …

Member Avatar for TrustyTony
0
274
Member Avatar for prashanth s j

Hi all, the init.xml file has among its lines, one line as `<guid>5934</guid>` init.xml ------------------- ------------------- <guid>5934</guid> ------------------- ------------------ I need to increment the guid every time I modify the file. Could any one please tell me how to do that. Regards, Prashanth

Member Avatar for jcao219
0
142
Member Avatar for prashanth s j

Hi, I get a the following as output after executing a command remotely: for example; No of records Date Status 1 7/7/2010 Progress Total Number of records Processed so far: 1012 Currently active records: 1 Now evidently Python treats this out put as a string. Now my problem is how …

Member Avatar for Beat_Slayer
0
104
Member Avatar for prashanth s j

Hi all, From within python script, I created a ssh handler to a remote machine whose interface is down and then using the ssh handler, I executed on the remote machine the following command: service network restart But the remote ssh session breaks and the service network restart is not …

Member Avatar for ultimatebuster
0
71
Member Avatar for prashanth s j

Hi, I have got the following requirement: In a file that has many lines, i need to search for a particular line that has the word DTP. The line may be like this in the file: src 172.23.1.23 dst 192.14.2.34 DTP 0 - 65000 If the line with the word …

Member Avatar for Beat_Slayer
0
1K
Member Avatar for prashanth s j

Hi, I have got the following requirement: In a file that has many lines, i need to search for a particular line that has the word DTP. The line may be like this in the file: src 172.23.1.23 dst 192.14.2.34 DTP 0 - 65000 If the line with the word …

Member Avatar for jlm699
0
107
Member Avatar for prashanth s j

Hi, I have got a utility "sock" which is C executable (under linux) on my machine. It acts like a server or client based on the arguments passed at the command line. I want to run it through a python script. I am using the subprocess call function to execute …

Member Avatar for prashanth s j
0
205
Member Avatar for prashanth s j

Hi all, in a python script file, I am having a open statement and then i write a "50000" to that file. And then within the script i am writing a scp command that transfers the file to a remote machine. In the local machine if i check the file …

Member Avatar for prashanth s j
0
144
Member Avatar for prashanth s j

Hi all, Currently I execute multiple scripts in the following format: os.system(./script1) os.system(./script2) os.system(./script3) But now I need to modify the code in such a way that script1, script2 etc return a success code(0) or failure code(1). But os.system can not return these values. What I need to do so …

Member Avatar for prashanth s j
0
207
Member Avatar for prashanth s j

Hi all, the following code prints garbage values. I want to read from an array two bytes and print then as a short int after doing ntohs. What is the bug in the code? Thanks and Regards, Prashanth [code] #include<stdio.h> struct converter { unsigned short int i; }; main() { …

Member Avatar for prashanth s j
0
194
Member Avatar for prashanth s j

Hi all, I need to initialize an array iteratively. For example array my_arryay needs to initialized with 512 characters and next with 1024 characters and next with 2048 characters etc etc, which can only be iteratively. Something as in C: for( i = 0; i<100:i++) { my_array[i] = 'a'; } …

Member Avatar for prashanth s j
0
238
Member Avatar for prashanth s j

Hi all, I have got several python scripts and I need to run them in one shot. So I assume that in a .py file I can give statements ./file1.py ./file2.py ./file3.py etc to run multiple scripts. I am defining global variables in a config.py file and these will be …

Member Avatar for prashanth s j
0
2K
Member Avatar for prashanth s j

Hi all, I have got several python scripts and I need to run them in one shot. So I assume that in a .py file I can give statements ./file1.py ./file2.py ./file3.py etc to run multiple scripts. I am defining global variables in a config.py file and these will be …

Member Avatar for prashanth s j
0
124
Member Avatar for prashanth s j

Hi all, How to access the value of WER from the following: [code] valuesfor1 = [('WER', 100)] valuesfor2= [('WER', 700)] [/code] My requirement is I need to compare WER from valuesfor1 with WER from valuesfor2. ie something like [code] if [('WER', 100)] < [('WER', 700)] : print "values for 2 …

Member Avatar for TrustyTony
0
111
Member Avatar for prashanth s j

Hi all, I tried running the following code. [code] #! /usr/local/bin/python import threading import time print "Press any key to start timer!" input() threadBreak = False def TimeProcess(): while not threadBreak: print "How are you?" print (time.time() - startTime) startTime = time.time() threading.Thread(target = TimeProcess).start() input() threadBreak = True input …

Member Avatar for woooee
0
114
Member Avatar for prashanth s j

Hi all, I have got a regular expression of the form: "tcp:"+'[0-9]+' It works fine when using the re.search( ) module. But if I want to grep for a line in a file that contains the pattern required, then the things wont work. Grep sees the regualr expression as tcp:+[0-9]. …

Member Avatar for prashanth s j
0
146
Member Avatar for prashanth s j

Hi all, for the following string I want to search a pattern The string is lcpstr = "2008/03/25 log:true lcp: 78888 -> 100 lck=0 to=900 un=5840 l=0 BMN" If I take the pattern as "lcp: 78888", pattern checking is successful when I give the following statement: temp = re.search("lcp:"+" "+'[0-9]+'+" …

Member Avatar for snippsat
0
123
Member Avatar for prashanth s j

Hi all, I ahve got a requirement of searching for a string in a text file and then return that string. I also need to convert that to numerical value Could anyone please tell me how to do it? The requirement is precisely like this: First I need to search …

Member Avatar for bumsfeld
0
98
Member Avatar for prashanth s j

Hi all, please anybody help me in solving the following questions: 1)What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro? 2)What is the difference between the functions rand(), random(), srand() and randomize()? Regards, Prashanth

Member Avatar for Tom Gunn
0
108
Member Avatar for prashanth s j

Hi all, I need to create thousands of directories in a single parent directory using shell scripting code. One problem would be to generate the unique directory name for each of the 1000 iterations to create a directory every time. ie first time the directory name needs to be subdir1 …

Member Avatar for Dream2code
0
199
Member Avatar for prashanth s j

Hi all, consider the below code snippet: struct ips { int i; }; struct ips * ipsptr; int * ptr; ipsptr = (struct ips * ) malloc(sizeof(struct ips)); ptr = ipsptr; free(ptr); what is the effect of the code above? Does it cause memory leak? Please suggest how it happens …

Member Avatar for Ancient Dragon
0
48
Member Avatar for prashanth s j

Hi all, I am getting a compiler error for the following: [U]The following is the declaration in the header:[/U] void init(INBUFF ** , OUTBUFF ** ); ---->line no 21 [U]The following is the function init:[/U] void init(INBUFF ** inbuffptr, OUTBUFF ** outbuffptr) { ------------------->line no 81 *inbuffptr = (INBUFF *) …

Member Avatar for me_ansh
0
102
Member Avatar for prashanth s j

Hi any one please tell me why the warning is generated when the address of pointer to a local variable is passed. [U]The following is the warning generated:[/U] Icore.c:228: warning: passing argument 3 of foo from incompatible pointer type [U]The function declaration is:[/U] int foo(void * , int , void**); …

Member Avatar for grumpier
0
145

The End.