Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
91% Quality Score
Upvotes Received
10
Posts with Upvotes
10
Upvoting Members
7
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
2 Commented Posts
3 Endorsements
Ranked #496
Ranked #261
~162.72K People Reached
Favorite Tags
Member Avatar for pyguy25

Hello. I was wondering if anyone could help me with a caesar cipher program I am attempting to create. I was asked to write a caesar cipher encoder program. Ok. No problem. This is what i got: [code] import string def main(): print "This program will encode your messages using …

Member Avatar for FaZeSkwlSh00ter
0
7K
Member Avatar for sneekula

I asked that in another thread, but it got lost: [QUOTE]When do you use root.quit() and when do you use root.destroy() to exit a Tkinter program?[/QUOTE] Also, can you intercept an exit when you use the little x in the title bar, just to affirm that you really want to …

Member Avatar for entropicII
0
44K
Member Avatar for Lardmeister

When I run: [code]dec = 255 print hex(dec) [/code]I get 0xff, but I like to get just 'ff'

Member Avatar for bumsfeld
0
5K
Member Avatar for R.S.Chourasia

Hi, I have two list of any datatype supported by python. I want to check whether the any of the element of first list is present in second list or not. Example: I have a = [4,5,6] b = [1,3,8,6,7,9] I want to check whether any element of a is …

Member Avatar for TrustyTony
0
6K
Member Avatar for sneekula

I need a function that returns True or False if an integer n is a prime. Any 'high speed' thoughts?

Member Avatar for wallars
0
1K
Member Avatar for NetByte

Greetings to Everyone :cool: , I just would like to know how to run/launch/start the IDLE ide of python in linux? (In windows the IDLE ide comes part of the python download, I assume its the same for linux??! or not?!) I currently have installed ubuntu linux, its already got …

Member Avatar for snippsat
-1
1K
Member Avatar for pyguy25

I have another string dilemma. I am asked to write a program that counts the number of words in a sentence entered by the user. This is what I have right now, although I don't think that it is anywhere near being correct: [code] import string def main(): print "This …

Member Avatar for j6m8
0
267
Member Avatar for cmpt

search(l, key): if len(l) == 0: return False elif l[0] == key: return True else: return search(l[1:], key) I was just wondering if there is any way that i can get rid of "elif" statement. The function is suppose to return False if the key is not in the list …

Member Avatar for ptirthgirikar
-1
153
Member Avatar for sneekula

How would you make a simple bar graph from a list of data? [code]data = [20, 15, 10, 7, 5, 4, 3, 2, 1, 1, 0] [/code]

Member Avatar for Stefano Mtangoo
0
551
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 Dark_Omen

Hello everyone, I just started to learn how to program in Ruby. It is a pretty cool language. You can get ruby from [url="http://www.ruby-lang.org"]www.ruby-lang.org[/url]. You can see my code snippets on making widgets using fxRuby (fxRuby is downloaded seperatly from ruby, unless you get the one click installer, which installs …

Member Avatar for pkc
0
418
Member Avatar for Mouche

So, I created this fun little Tic Tac Toe game all on my own. It was a tough project, and I know I used some inefficient strategies in the coding. Just like the other things I've posted, this could use a lot of suggestions in the areas of clean code …

Member Avatar for vegaseat
0
1K
Member Avatar for mawe

The name says it all, I think. You have a nested list, you want to flatten it (e.g. because you want to count the occurence of an element), this function is all you need ;)

1
744
Member Avatar for liz517

[code=python]from random import randrange import math def main(): print "This program will simulate the probability of rolling " print " a 5 of a knid in one throw." pos = randrange(1,7) dice = [0] *5 value = dice [ : ] for pos in [0,1,2,3,4]: dice[pos] = randrange(1,7) roll = …

Member Avatar for anatashinu
0
174
Member Avatar for mattyd

This demonstration was originally proposed to be posted as a Python tutorial but with further inspection it was deemed more of a "how-to" guide, in this case, how-to create simple animation via Tkinter (Tool Kit Interface) All the necessary elements are included in the attched zip file. This includes: [LIST] …

Member Avatar for vegaseat
1
237
Member Avatar for danizzil14

Ok, so from my last post, you might have figured that I'm making a coder/decoder package. Anyways, say I've got a string of letters that i want to decode, such as: AAAGGGCCC Which should produce: ACB Because a=aaa c=ggg and b=ccc Currently with my program, you have to input one …

Member Avatar for Gribouillis
0
202
Member Avatar for Micko

Hi to all, after two months I decided to give Python one more chance. Here is a little code snippet about counting number of words in text file. (Under word I assume any combination of letters and numbers delimited by standard separators " .,\n\t" [code] file = open ( "Test.txt", …

Member Avatar for vegaseat
0
5K
Member Avatar for alex05

I have to write a script called trying. The script takes a full path (like /users4/st/jdoe/prog.c) as an argument and displays the path and the file name. For /users4/st/jdoe/prog.c, the path is /users4/st/jdoe and the file name is prog.c. I know that I can use grep for it, but it's …

Member Avatar for msr_viz
0
242
Member Avatar for sneekula

I want to make a small Molecular Weight calculator. If the user for instance enters the molecular formula for dichloro-benzoic acid as "C6H3Cl2COOH", I would like to split it into a list like ['C6', 'H3', 'Cl2', 'C', 'O', 'O', 'H'] so I can then combine all the carbons, chlorines, oxygens …

Member Avatar for sneekula
0
113
Member Avatar for Tetch

With my program, I have been trying to simulate the game of Roulette (at a casino) with a GUI, but I have a problem that I can't seem to figure out. For some reason, any kind of accumulator for "current funds" I place in the program doesn't seem to work …

Member Avatar for Tetch
0
2K
Member Avatar for vegaseat

Things are getting quiet around the shop, seems like all the coding is done in foreign lands. Any way, let's get a thread started, a multilingual coding spree showing how to display "Hello World! (computer language used)". The code has to be a full program! Make sure you have the …

Member Avatar for sgssergio
0
1K
Member Avatar for Jusa

Hi, I'm having trouble removing objects from a list. It seems that when I remove single objects in a loop, the loop kind of skips elements in the list, not continuing from the point where the last removal occurred. I want to remove only certain elements from a list, and …

Member Avatar for pandu22
0
512
Member Avatar for fredzik

G'day, Thanks Mr. Vegaseat, Jeff, Ene, Mawe for all of your great help so far...I'm slowly (very slowly!) getting used to Tkinter. But I'm again puzzled by how Tkinter does things. Some examples of code at the beginning say "from Tkinter import *" and some say "import Tkinter as tk" …

Member Avatar for fredzik
0
298
Member Avatar for Zorbie

I read somewhere about somebody importing the sys.py module. I can't find the bugger on my system! I have python 2.5.1 installed on this Waxows XP machine. I did a search for sys.py in the c:\python25 folder and sys.py isn't there! Isn't it supposed to be installed by default? If …

Member Avatar for StrikerX11
0
152
Member Avatar for justmonkey23

I would like to be able to add the day, month and year to the end of the filename. I plan on running a version of this script every day so I would like it to create a new file each day. I would like the file to look like …

Member Avatar for justmonkey23
0
116
Member Avatar for Matt Tacular

[code]str1 = 'c:\documents and settings\user\desktop' str2 = 'starcraft.exe' print str1[/code] I would like to know how it would be possible to add str2 to the end of str1 with a "\" inbetween the two strings. so that I end up with "c:\documents and settings\user\desktop\starcraft.exe". Thanks

Member Avatar for ghostdog74
0
179
Member Avatar for lineman60

so when i run this in python interpiter it works [CODE] >>> import os >>> b= os.path.getsize("/path/isa_005.mp3") >>> b 2071611L >>> [/CODE] but when i run it in a script [CODE] b= os.path.getsize("/path/isa_005.mp3") FILE.writelines(b) [/CODE] i get an error. any one know how i can get it to print the …

Member Avatar for mawe
1
480
Member Avatar for jwjazz

This function is part of a program to convert numbers between different bases. [code=language] num = 32 b1 = 10 b2 = 2 x = 1 def increasex(num,b2,x): if num%(b2**x) < num: x = x+1 increasex(num, b2, x) else: print x return x print increasex(num,b2,x) [/code] The parameters are the …

Member Avatar for jrcagle
0
133
Member Avatar for pkraop

hi i am reading from a file and grep'ng for some values and writing those into another file I am using "|" as a seperator for the values smthing like this printf FILE " %d| %d |%d\n",$x,$y,$z; In file i am getting values like this 12|23|23 123|3|234 22333|223|3 but i …

Member Avatar for pkraop
0
103
Member Avatar for nam5a

I was wondering if there is something in python similar to the begin expression in Scheme, and if not how would you write something in python to simulate it.

Member Avatar for nam5a
0
112