Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
29
Posts with Upvotes
24
Upvoting Members
16
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
8 Commented Posts
2 Endorsements
Ranked #630
Ranked #355
~181.39K People Reached
PC Specs
Debian Linux stock kernel 2.4.25 on a Dell Inspiron XPS
Favorite Forums
Favorite Tags
Member Avatar for vegaseat

The idea of this thread is to help the beginning Python programmer with hints and helpful code. Please feel free to contribute! If you have any questions start your own thread! The creators of Python are very active, improving the language all the time. Here is a little of the …

Member Avatar for vegaseat
23
33K
Member Avatar for vegaseat

After you got the basics of Python under your belt, the best way to get a good knowledge of the language and improve your coding skills is to start on a project you are interested in. Maybe an image viewer, a slide show, computer generated random or fractal art, a …

Member Avatar for vegaseat
20
18K
Member Avatar for EriCartman13

How do you rest your variable everytime your execute the program. [code]for x in range(1,100): running = True while running: guess = int(raw_input("Enter an integer:")) if guess == x: print "Nice" running = False if guess < x: print "Higher" running = True if guess > x: print "Lower" running …

Member Avatar for bumsfeld
-1
4K
Member Avatar for bumsfeld
Member Avatar for Kyss
0
235
Member Avatar for Micko

Hello, I'm learning Python. It is my first interpreted language. I have some experience with C and C++. I must admit that it's very hard for me to accept a concept of interpreted language. For example I write code in C++, compile it, link it and I have .exe file …

Member Avatar for darkside2205
0
319
Member Avatar for ram.patil

1. .......Algorithm to find the first n Hardy-Ramanujan numbers.... since 1729 is the least ..... I request to post the solution for this............

Member Avatar for TrustyTony
0
2K
Member Avatar for G-Do

Hi guys, I'm trying to learn the principles of artificial intelligence. I just finished coding up a belief net and a corresponding EM algorithm that learns the CPTs for latent nodes using training data (if you're unfamiliar with the lingo, you're probably going :eek: right now). While the program (written …

Member Avatar for Gael Varoquaux
0
328
Member Avatar for G-Do

Here's something of mine that might actually be useful: a Python implementation of the K-means clustering algorithm. I wrote something similar last year in Java for a school project, and decided to rewrite it in Python this summer for practice. The purpose of the algorithm is to discover internal structure …

Member Avatar for woooee
2
1K
Member Avatar for Ene Uran

This is my first experience with Python's Tkinter GUI. I want to write a program where the result of an interim calculation is displayed on a label. Later in the program I want to use this result in another calculation by simply clicking on the label. This is what I …

Member Avatar for vegaseat
0
3K
Member Avatar for eleonora

I do have a problem with my connect four code ; it doesn't check whether there is a winner even though the function its okay :-/ Can anyone help me to solve my problem ??? [CODE=python] import random board = dict() rows,columns = 4,4 def game(): choose_player() #MAKE BOARD FUNCTION …

Member Avatar for TrustyTony
0
3K
Member Avatar for Avner .H.

Hello everyone! I want to use bash from python, however the os.system([I]command[/I]) seems to act only on one command at a time. I want to use complete commands, also containing control flow statements, like If and While, and to call them from python. something like this code in bash: T1="foo" …

Member Avatar for sneekula
0
784
Member Avatar for G-Do

Hi all, Have you ever heard of "Petals Around the Rose?" It's a logic puzzle. The way it works is, I roll five dice, then tell you what the "score" is for this round. I can repeat this for you as many times as you want. It's your job to …

0
839
Member Avatar for G-Do

[URL="http://www.bitstorm.org/gameoflife/"]Life[/URL] is a "game" or cellular automaton - an evolving computational state system - developed by a Cambridge mathematician named John Conway. The idea is simple: start with a board of dimensions (x,y). Populate the board with an initial pattern of occupied and empty cells. In every turn, the rules …

0
1K
Member Avatar for G-Do

Suppose you are a medical researcher studying diabetes. Your boss has given you a big chart of data from diabetes patients. Each row of the chart has information for one patient. Each column of the chart is a health-related statistic, such as height, weight, age, blood pressure, cholesterol level, etc. …

2
1K
Member Avatar for G-Do

Here's a cute little encipher/decipher program with a Tkinter GUI I wrote a while back. It's an implementation of a derivative of the Vigenere algorithm; the algorithm is taken from Laurence Smith's Cryptography: The Science of Secret Writing, Amazon link here. It's a dated book (and the technique itself is …

0
214
Member Avatar for a1eio

i've made a little animation using python and the pygame module, I'm just wondering if it's possible to turn that into a screensaver? is there a format i have to save it to? If anyone knows i would be grateful for the solution thanks, a1eio

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for jmroach

So this should be a really easy one, but i've spent a few hours searching and can't find anything that explicitly states how to do this. All i want to do is see the column names for a particular table. I created the tables like: [CODE=python] con = sqlite3.connect( ":memory:" …

Member Avatar for weisburd
0
23K
Member Avatar for gusbear

so i have to write regression line program which is hard enough seeing as i just started so i need help, 1st thing is how do i write a loop for mouse clicks of any number, then write the average of whatever the amount of mouseclicks, thanks!

Member Avatar for hobbz86
0
133
Member Avatar for rysin

Hi im new to this board. Im beginning a new Python prject, my last one was a html GUI which I built in Tkinter. This time im going to make a AIM bot. Any idea on where to start with a project such as this. All help is appreciated! Thanks

Member Avatar for EAnder
0
91
Member Avatar for Edwards8

So, I wrote a little script to convert tifs into jpegs. The tifs are about 600mb in size, I reduce the size, and then convert. Here is the code in its entirety: [code=python] ## First we import the image library, Image object, and garbage ## collector, as well as os …

Member Avatar for woooee
0
423
Member Avatar for zachabesh

Hopefully this question is easier than I think it is. :) I have a directory with thousands and thousands of flv and jpeg files in it. I want to loop through the directory, get the file names and their sizes (in bytes) I've tried searching the web for a function …

Member Avatar for zachabesh
0
124
Member Avatar for sibdizzle

Hello, I am fairly new to Python and starting to get it. But I am having some difficulty with pickle. I am trying to get a account program to pickle user input and to save that in a data file and then reload said info and read as input for …

Member Avatar for G-Do
0
185
Member Avatar for linux

Is there any way for someone to, using PyGame or SDL, to do, say: [code]00000000 01222100 01112110 01112110 01111110 00000000[/code] And have it display the 0's as a water tile (10x10), the 1's as a grass tile (10x10), and the 2's as a rock tile (10x10)? As to make maps …

Member Avatar for linux
0
138
Member Avatar for G-Do

Hi all, I add a pygame implementation of the Game of Life to the Code Snippets section. I was actually kind of surprised that we didn't already have one in there! The program only has about 60 lines of code, but I buttressed that with a lot of comments and …

Member Avatar for nish88
0
109
Member Avatar for nish88

hi everyone.....i'm designing a simulator and i need to study John Conway's Game of Life. i'm getting the source code in java or c++ everywhere i search. Have anyone ever implement it using python or can you please give me a link where i can find the source code in …

Member Avatar for nish88
0
133
Member Avatar for G-Do

Hi all, Are there any python modules which contain functions for getting the roots of a quartic (degree 4) polynomial? I don't think NumPy has anything like it, and I [I]really[/I] don't want to enter the equations in by hand. Thanks.

Member Avatar for jrcagle
0
96
Member Avatar for RMartins

Can anybody tell me how can i avoid the overflow of this program? from math import sqrt f=lambda n: sum([int(i)*int(i) for i in str(n)]) L=[] for n in range(0,10**20): if sqrt(f(n))%1==0:# == float(int(sqrt(f(n)))): L.append(n) L.sort() print "NĂºmero de quadrados perfeitos na lista:",len(L) print L y= lambda L: reduce(lambda x,y: x+y,L) …

Member Avatar for G-Do
0
81
Member Avatar for Carlo Gambino

I am working to increment lists in such a way that each item in the list is incremented incrementally, it sounds confusing but its not: If the user inputs: [CODE]list = [1, 2, 3, 4] [/CODE] I want the output to be: [CODE]2, 4, 6, 8[/CODE] in essence, the first …

Member Avatar for jrcagle
0
138
Member Avatar for StepIre

Hi Guys, I have a nested dictionary that i would like to be populated from a file at the start of my prog and put back into the file at the end of the prog. Could anyone direct me to somewhere where i could get info on how to do …

Member Avatar for StepIre
0
124
Member Avatar for trihaitran

Hi, I've got about 10 functions that all share a bit of code. They all look something like this: [code=python] def func(arg): statement1 statement2 statement3 unique code statement4 statement5 [/code] Each function does similar statements at the beginning and end, but has unique stuff in the middle. Is there a …

Member Avatar for G-Do
0
112