Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
8
Posts with Upvotes
8
Upvoting Members
7
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
5 Commented Posts
~167.31K People Reached
Favorite Tags

167 Posted Topics

Member Avatar for samaru
Member Avatar for mattyd
Member Avatar for RMartins

You can also use [inlinecode]isinstance()[/inlinecode] method to check whether an object is an instance or type of a class[everything in Python is an object] [code=Python] >>> v=9 >>> if isinstance(v, int): print 'int' int [/code]

Member Avatar for pythonBasic
0
725
Member Avatar for eniacpx

Hi, [QUOTE]If anyone has any experience coding linux gDesklets this would help[/QUOTE]I seriously dont know about this stuff for sure. [QUOTE]I keep getting "List index out of range" when trying to execute this code, but for the life of me I cannot figure out why, ... Any thoughts?[/QUOTE]sure... Usually [inlinecode]IndexError: …

Member Avatar for Gribouillis
0
5K
Member Avatar for katharnakh

Hi, How do I disable Copy/Cut/Paste operations on a textbox in Tkinter. I want to implement this in simple login form, where I found I can copy or paste or cut from textbox which is meant to accept PASSWORD. Can we do that? How? Thank you, Regards, kath.

Member Avatar for Gribouillis
0
2K
Member Avatar for sasdap

[QUOTE=sasdap;520794]hi, It was returning the return code(0). How to get the output as 'hello'?[/QUOTE] The return value is 0 because the command you gave, actually executed successfully. [inlinecode]os.sytem("echo hello"); os.system("ren file-old file-new")[/inlinecode] If you want to print something on the screen, there is already [inlinecode]print[/inlinecode] function available in Python. If …

Member Avatar for Jimleeeel
0
159
Member Avatar for Caraka

[code=Python] import csv rf = open('sample.txt') #input file handle wf = open('writer.csv','w') #output file handle writer = csv.writer(wf) for row in rf.readlines(): writer.writerow(row.split()) rf.close() # close input file handle wf.close() # close output file hanle [/code] kath.

Member Avatar for TrustyTony
0
3K
Member Avatar for aot

[QUOTE=aot;396047]I'm frustrated by the nature of time.sleep(), which prevents the script from doing anything else during the allotted time period. For example, I have: [CODE]while True: checkSomething() time.sleep(0.1) print 'hello'[/CODE] In this case, "hello" is never printed. I really want to check something every few milliseconds, but I also need …

Member Avatar for txfoo
0
1K
Member Avatar for katharnakh

hi, why explicit cast is *not* required here? [icode]static Float f3 = new Float(5.5); //causes compile-time error b'se, by default floating-point literal type is double[/icode] but requires here, [icode]//static Short sh1 = new Short((short)12); static Short sh1 = new Short(12); //causes compile-time error b'se, by default integer literal type is …

Member Avatar for naveenreddygine
0
165
Member Avatar for mattdaddym

Hi, Well as you said your system has enough resource, i dont find any idea why it is failing. As far as my understanding goes the way you read file is line-by-line which is recommended to follow in case of large file. There are also other ways depends how your …

Member Avatar for aixylinux
-1
514
Member Avatar for sam1

[QUOTE=sam1;329459]hi, I have a table called shoutbox, i created it this way: [CODE]CREATE TABLE `shoutbox` ( `id` INT NOT NULL AUTO_INCREMENT , `ip` varchar(20) NOT NULL , `name` varchar(30) NOT NULL , `url` varchar(30) NOT NULL , `message` varchar(50) NOT NULL , `date` date NOT NULL , PRIMARY KEY ( …

Member Avatar for habeebuddincse
0
177
Member Avatar for freddypyther

[QUOTE=freddypyther;400405]Hi! Could someone make a little tutorial for dummies about how to create a GUI with wxGlade in SPE?, because I've been tying to do it like for example Netbeans, but I can't put the widgets where I want, I don't see my application as I'm drawing it...kind of a …

Member Avatar for brandonrunyon
0
987
Member Avatar for pyguy25

[QUOTE=pyguy25;327982]Would there be a way for me to modify this program to calculate the average word length in a sentence?[/QUOTE] [url]http://www.daniweb.com/techtalkforums/thread72136.html[/url] go through this link... regards, kath.

Member Avatar for j6m8
0
273
Member Avatar for kishore5001

hey, you should have googled it, before posting it here... Well, I found, __END__ is the logical end of program text. You can put anything you want after this token; it will be ignored by the compiler. kath.

Member Avatar for afbach
0
2K
Member Avatar for katharnakh

how to create a submenu in python? how to use [I]insert_cascade(index,**options)[/I].......... please help me out.

Member Avatar for skydiverman05
0
4K
Member Avatar for chandrag

Hi, [Quote]so, u want me to write the code and save it in a text file and type perl -e and the file name on command line?[/Quote] Depends, 1. you can write perl code and save it as .pl (for eg. program1.pl) and run. 2. make it executable by inluding …

Member Avatar for dangidipu
0
931
Member Avatar for katharnakh

im confused with [I]__call__() [/I] method defined within the class. [I]__init__() [/I] is used as constructor, and is called when we create an instance of the object. when does [I]__call__() [/I] method get called even though we not specify it explicitly... please help..........

Member Avatar for snippsat
0
17K
Member Avatar for katharnakh

I am facing problem connecting problem connecting remote MySQL server which is firewall protected. I used the valid user name and password, but it throws me the error [I]OperationalError: (2003, "Can't connect to MySQL server on 'www.myreomtemysqlserver.com' (10061)")[/I] I want to connect from python. I searched in Google is there …

Member Avatar for wendymclee
0
260
Member Avatar for StarZ

[icode]java.io.FileNotFoundException: File1.txt (The system cannot find the file specified)[/icode] the specified path to file is not correct. Java is not able to find the file in the path given which you want to open. katharnakh

Member Avatar for Alfredtwo
0
147
Member Avatar for Stefano Mtangoo

Every Java program needs a class defined in the file. You can define more than one class in a file and atleast one class as public and its name should be that of the file. In that public class you define main() method with [icode]public static void[/icode] which is the …

Member Avatar for Stefano Mtangoo
0
121
Member Avatar for saikeraku

Below are some mistakes you are doing, 1. calling [icode]reorder()[/icode] without any args, in print fuction. 2. you cannot refer a char at [icode]a[a+b][/icode] which you are doing it in for loop in the [icode]reorder[/icode] fuction, because of IndexError. Instead you need to loop through the size of either of …

Member Avatar for katharnakh
0
110
Member Avatar for skelly16

Hi, is your cron job created for the same usr as you use to run the script? If yes, in my opinion, the env variables should get assigned with new values. Also note that these env variables you set in the script will be available till executing script ends. katharnakh.

Member Avatar for skelly16
0
227
Member Avatar for mitzoff
Member Avatar for piers

you are returning from the [icode]&fname[/icode] as soon as you enter the function. So your function is not executing till end of the function. You have two [icode]return[/icode] statements in your function. Learn how to write sub-routines in perl [icode]perldoc perlsub[/icode].

Member Avatar for katharnakh
-1
85
Member Avatar for kkcaddy

If your shell does not understand javac command, you might want to add path to your javac in your PATH env variable. katharnakh.

Member Avatar for kkcaddy
0
101
Member Avatar for freon73

[QUOTE=freon73;264699][COLOR=#555555]I am a newbie to Python and need to transfer files across an internal network. Are there any coding tips or code snippets that would be helpful? Any assistance provided would be appreciated.[/COLOR][/QUOTE] the more core you go is use socket... cheers, kath.

Member Avatar for Tech B
0
195
Member Avatar for designblocks

I assume READFILE is valid file handle. Because the above code does not show how you are opening file or what is READFILE. [code=Perl] while ($ch = getc(READFILE)) { ++$character_count; if ($ch eq "?" || $ch eq "!" || $ch eq ".") { $sentences++; } $word++; if($ch =~ /[ \t]+/); …

Member Avatar for Akase
0
121
Member Avatar for k2k

Hi, 1. If you are not able find what is going on when running command from perl, it is better to run the SAME command, used in the code, in your shell by yourself and check. Eg: from above. useradd <value_of_$uName.$i> -g 999. 2. Knowing the return value of the …

Member Avatar for katharnakh
0
161
Member Avatar for rana03

Hi, You can obviously use path to your shell script run. Rather than changing the directory. [icode]`/path/to/your/script.sh`[/icode] Hope this helps. katharnakh.

Member Avatar for crb3
0
122
Member Avatar for Vandithar

Hi, Try this.. [code=Perl] my $string = 'Lake City 84132, USA. FAU - Carrell, D T AU - Carrell DT FAU - Emery, B R AU - Emery BR '; foreach my $sub_str(split(/, /, $string)){ print $1,"\n" if($v =~ /( AU - (\w+ \w+)?)/); } [/code] katharnakh.

Member Avatar for katharnakh
0
106
Member Avatar for yssirhc

hi, You might want to assign values if your [inline]@row[/inline] has something. Though, sometimes query executes fine and returns nothing your [inline]@row[/inline] will be an empty array. [code=Perl] #... @row = $query->fetchrow_array(); #... if (scalar(@row) > 0){ # code to assign other variables from @row. } [/code] katharnakh.

Member Avatar for katharnakh
0
155
Member Avatar for yair7190

Hi, I would recommend you to define a method in Parse.pl and use it in your client script which requires parsing. For eg. [icode] #caller.pl require 'Parse.pl'; #... # call method parse_me(for eg.) in Parse.pl my $return_val = Parse::parse_me($line); #... [/icode] [icode] #Parse.pl sub parse_me{ my $line = @_; #... …

Member Avatar for bryansmith123
0
320
Member Avatar for >shadow<
Member Avatar for shaybery

[icode]print "$1, $2, $3", $/ if ($line =~ /(\w+)=(\".+?\"|'.+?'|.+)\s*(#.*|)/); [/icode] katharnakh.

Member Avatar for mattjmorrison
0
102
Member Avatar for koteswarvijay

With [icode]Net::SSH::Perl[/icode] you can execute commands remotely. katharnakh.

Member Avatar for KevinADC
0
121
Member Avatar for yair7190

Hi, Two points to consider, 1. In your code, you are opening 'ParsedLog.txt' two times. One before entering for loop in R or read mode and second inside for loop in A or append mode. Instead you can have this line, opening in W or A mode(you choose) before for …

Member Avatar for yair7190
0
137
Member Avatar for navsaug
Member Avatar for osjak

[QUOTE=osjak;681783] Does anyone have an idea what could cause this error? Could it be my script running out of memory? I'm using an old beater machine with 256MB for this project.[/QUOTE] the error clearly says syntax error in sql statement, try running the same query in you query browser and …

Member Avatar for katharnakh
0
100
Member Avatar for katharnakh

Hi, [B]Background:[/B] I have task of calculating dependencies of project(s) of a scenario. Dependency calculation is done using an external command. Since this dependency calculation time depends on how big is the project is, it is difficult to guess how much dependency calculation of a scenario(a set of projects) takes. …

Member Avatar for katharnakh
0
129
Member Avatar for raul15791

[code=Perl]use strict; use warnings; use Cwd; use DirHandle; my $folder = 'C:\Perl5.8.8\site\lib\File'; my $dh = DirHandle->new($folder); while(defined(my $val = $dh->read)){ print "\nDirectory: ",$folder."\\".$val if (-d $folder."\\".$val); print "\nFile: ",$folder."\\".$val if (-f $folder."\\".$val); } $dh->close(); print "\n\nCurrent working dir: ", getcwd();[/code] katharnakh.

Member Avatar for raul15791
0
153
Member Avatar for raul15791

[QUOTE=raul15791;634727]What I actually did was installing perl and Komodo Edit 4.3. Is there any difference between IDE and an Editor? Komodo Edit 4.3 is an editor? Or an IDE?[/QUOTE]Both. [QUOTE=raul15791;634727]And the IDE is it comes together with the ActivePerl?? I cant seems to find it though.[/QUOTE] Not necessarily, in komodo …

Member Avatar for KevinADC
0
204
Member Avatar for raj_3y2k

First you need to go through [URL="http://www.daniweb.com/forums/thread70467.html"]this[/URL] thread, in my opinion. As Kevin was replying to your earlier post it is nothing to do with Perl as such, only thing you need to place the scripts in right place so that you can call those scripts in browser. The error …

Member Avatar for katharnakh
0
189
Member Avatar for raul15791

add [icode]chomp($nama);[/icode] after line 14. Because, you need to remove whitespaces(i.e, new-line character in this case) after you take input from keyboard. Also you need to lexically scope $nama scalar. [icode]my $nama = <STDIN>;[/icode] katharnakh.

Member Avatar for KevinADC
0
191
Member Avatar for katharnakh

Hi, I have problem running my cgi scripts under Apache Tomcat server. I am using Apache Tomcat/5.5.20 on WinXP. I followed the instruction tips I found out at [url]http://www.wellho.net/forum/Perl-Programming/Running-Perl-CGI-scripts[/url]... [url]http://www.ftponline.com/javapro/2003_03/online/perl_teden_03_18_03/p[/url]... but still I could not get the scripts running. I get HTTP status 404 error. The directory structure I have …

Member Avatar for KevinADC
0
1K
Member Avatar for adadadad

Hi, You can use [icode]HTML::Parser[/icode] module to parse html files. You can download the same [URL="http://search.cpan.org/dist/HTML-Parser/"]here[/URL]. Also you can go through [URL="http://www.foo.be/docs/tpj/issues/vol5_1/tpj0501-0003.html"]this[/URL] link to learn how to do it or [icode]perldoc HTML::Parser[/icode] after you install the module. [QUOTE=adadadad;623429]... what is the way to write to the text file each time …

Member Avatar for katharnakh
0
121
Member Avatar for Scruffstone

What server you are using to run your .pl file? As far as i know, diff. web servers require to keep files in diff. hierarchy of folders in server installation path. For eg.(in Apache web server) you need to keep .pl files in ../cg-bin and like wise. May be that …

Member Avatar for Scruffstone
0
149
Member Avatar for prakasnisha

[QUOTE=prakasnisha;611568]... now i have to compare this two files[/QUOTE] Use File::Compare module to compare two files or contents of two files. Go through the help doc. of this module, first and try. [QUOTE=prakasnisha;611568] and check whether the value change is within 1% of the initial value. ...[/QUOTE] Without knowing what …

Member Avatar for Major Major
0
223
Member Avatar for prakasnisha

Hi, Please go through [URL="http://www.daniweb.com/forums/announcement112-3.html"]this[/URL], before posting your code. Its not an assignment, just a prerequisite if you want to get really quick help. Only with code it is hard to know what is working and what is not. Provide some input(example) details. Post your errors, if any OR if …

Member Avatar for prakasnisha
0
102
Member Avatar for SNN

[code=Perl] for($j=0; $j<=100; $j++){ <do the expression> unless($j%2); } [/code] If you are doing some mathematical operation with the expression i think you want to re-check whether loop should start from 0. katharnakh.

Member Avatar for KevinADC
0
57
Member Avatar for somename

[QUOTE=somename;607063]... perl forum is kind of abandoned ;/ [/QUOTE]Its not true. [QUOTE=somename;607063]... I want to write a selfkilling perl prog :D Ok, i got a simple prog which shows up a simple tk window with some text in it, to go to the next function (in my app), i have …

Member Avatar for katharnakh
0
93

The End.