15,190 Topics

Member Avatar for
Member Avatar for Nyaki Makgoba

Okay, i've just started python a few days ago, and i think i'm doing well considering how quickly I"ve been working, but I've reached a dead end!! I keep encountering an error when using the statement "from sys import argv" In the first code were I had this problem, I …

Member Avatar for TrustyTony
0
244
Member Avatar for JJHT7439

I have a project to do and I'm pretty lost on it. The purpose of the project is to make a game like quoridor, but for this part you only need to have your program ready walls from a file (Walls are given in the format of: (startx, starty)(endx, endy) …

Member Avatar for newbieha
0
604
Member Avatar for brundlefly

Hi guys i wonder if someone can help an absolute noob out with some homework. i was given a brief of: ask a user to input up to 3 mobile numbers. for the numbers entered display the list of numbers entered and clearly displays the mobile network each number belongs …

Member Avatar for brundlefly
0
109
Member Avatar for sanjcee

Hi. I'm trying to make a grade forecasting program for python 2.7. My problem is that I'm having difficulty trying to correlate the first "grade element" input with the first "grade element percentage" input. Here's what I have so far. ## Grade Forecast ## Chandiramani Grade Forecast [CODE]import random print …

Member Avatar for richieking
0
107
Member Avatar for bhysen

Hello, can anyone help me on the fellowing... Write a function that will take two arguments: a word to be searched for and a list of strings containing the grid. The function should search for a horizontal left-to-right or vertical downwards occurrence of the word (e.g. activex and capslock in …

Member Avatar for richieking
0
122
Member Avatar for HoneyBadger

Guys, I just started tinkering with Python in a GUI enviorment. But I have a question. I a using wx-glade, and it says I can't touch the code between: [CODE]# begin wxGlade: extracode # end wxGlade[/CODE] Here is my code: [CODE]#!/usr/bin/env python # -*- coding: utf-8 -*- # generated by …

Member Avatar for richieking
0
236
Member Avatar for TheSassyDragon

Im trying to make a card class that I can use in other programs, the main goal of this is to make a deck of cards that would be valid, only 52 cards - no repeats, 4 suits - 13 cards each. My problem is I don't know how to …

Member Avatar for lrh9
0
680
Member Avatar for efregoso

Hi, I am trying to make a brick breaker game, but I am stuck. i need help moving the panel, and getting the ball to bounce off of bricks upon collision and erase the bricks. Also I wanted to create two lists, one that contains coordinates, the second would be …

Member Avatar for efregoso
0
2K
Member Avatar for dballar1

I am having some trouble verifying the given data for 'user' against what is already in the users.txt file. An example of a line in the text file is... ('Ralph', '1a1dc91c907325c69271ddf0c944bc72') Where 'Ralph' is what I want to compare against the users input for 'user'. Here is my code so …

Member Avatar for TrustyTony
0
328
Member Avatar for FAITH2011

[B][COLOR="Red"]Hi all, I am dyslexic person and find it very hard to read and write without assistance, I was wondering if there are any good Videos or computer based book that teach Pyton 3.1.3 for begginers that could be recommended. The reason for this is that I can see the …

Member Avatar for SgtMe
0
325
Member Avatar for FAITH2011

Hi all, I am new Phython user and started using Python 2.7 just a couple days ago. I have written this code which is working, But when user put in correct code loop is not breaking ?? just wondering if it could be improved and what book would you recommend …

Member Avatar for griswolf
0
212
Member Avatar for FAITH2011

Hello all, I need a little help with Dictionary statement. My question is it possible to display just one thing for a Dictionary ? I know that Dictionary use Keys and Values so if I have this code. How would I display let say the Dog from Dictionary without printing …

Member Avatar for TrustyTony
0
128
Member Avatar for MUFC4life

i = 1 while i < 10000 and i > 0 and 1 : print " still going ..." i = 2 * i Hi i am new to Python and completley useless at it. Can somebody please explain to me why this code prints "Still going" 14 times. I …

Member Avatar for 15uck
0
132
Member Avatar for plum0922

How do you draw a star in Python, I am really confused over it now This is the program I have so far import helper *helper checks if input is valid or not import ecs10graphics07 as gr * ecs10graphics07 is almost the same as the program Tkinter import math starPoints …

Member Avatar for mastaerf
0
1K
Member Avatar for yellowkaiq

I can't get this to generate random shapes, etc. Basically what I need to do is randomly generate similar lists consisting of: combinations of 'square', 'triangle', 'circle' and 'left'. And random numbers from 1 to 10 for physical dimensions and 10 to 90 for angles Have the program use 'split' …

Member Avatar for woooee
0
2K
Member Avatar for newbieha

its a 9x9 squares. im wondering how to find neighbors. for example the neighbors of[i,j] is [i-1,j][i,j+1][i+1,j][i,j-1] how can i code them? [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, …

Member Avatar for TrustyTony
0
124
Member Avatar for lagspike

A simple physics graph... [code=python]import pylab a_time = range(0,141,10) a_R = [3.0,2.8,2.56,2.36,2.2,2.0,1.86,1.7,1.6,1.43,1.3,1.2,1.1,1.06,0.96] for i in range(0,15): pylab.plot(a_time[i],a_R[i], 'x') pylab.errorbar(a_time[i], a_R[i], 0.5, 0.05) pylab.show() [/code] I'm guessing the [icode]pylab.plot[/icode] line isn't needed, but even with this there is nothing connecting the plots together. I'm pretty sure there wasn't anything extra needed …

Member Avatar for lagspike
0
268
Member Avatar for jice

Hello there, I'm trying to generate a open office text document with tables generated from a database with the lpod library. I'd like to set the width of the tables columns but i can't manage it. Here is my test code so far : [code] import lpod.document import lpod.table doc …

Member Avatar for jice
0
160
Member Avatar for Simplicity.

I have developed a python code that is comprised of several functions, I want the output from the last function to be an input in the first function and the program should stop when a certain criterion is met! for example: [CODE] [[COLOR="Red"]def[/COLOR] f1(something1): Block of statements [COLOR="Red"] return[/COLOR] something …

Member Avatar for Simplicity.
0
142
Member Avatar for bronzer888
Member Avatar for mbehnaam

[B]Hi, I am beginner in Python and I'm looking for a method to write to a file by using Index. This is my program:[/B] ************************************************************** infile = open("land1.txt","r") outfile = open('out.txt', 'w') text = infile.read() infile.close() search = "<CgPoint" found=text.find(search) while found > -1: print search, "found at location", found …

Member Avatar for TrustyTony
0
169
Member Avatar for FAITH2011

I am trying to run this program in python 2.7. But get an error Traceback (most recent call last): File "C:/Python27/Rpg1.py", line 95, in <module> p = Player() File "C:/Python27/Rpg1.py", line 25, in __init__ Character.__init__(self) AttributeError: class Character has no attribute '__init__' When run this pragram can someone help me …

Member Avatar for TrustyTony
0
151
Member Avatar for dragonstear

sequence is a string, and gene is the the word that i gotta find.. im new to python.. and so far i got this: the list always ends with a -1 at the very end...how do i get rid of that.. [CODE]def find_genes(gene,sequence): list= [] count = sequence.count(gene) find = …

Member Avatar for dragonstear
0
163
Member Avatar for dipanjanpal

Can anyone tell me how to use _winreg module in Window vista without being administrator. I have tried but it gives an Error5 "Access is denied".plz help me. Thank u in advance....

0
101
Member Avatar for brianmitchell

Hey all so im a bit new to python and I need to create a select sort function without any for or whiles but this is all i have so far any help would be greatly appreciated. [CODE]def selection_sort(list): l=list[:] sorted=[] while len(l): lowest=l[0] for x in l: if x<lowest: …

Member Avatar for seanbp
0
207
Member Avatar for HoneyBadger

How do I do it? I tried sorting the keys: [CODE]keys = dictionary.keys() keys.sort() return map(dictionary.get, keys) [/CODE] But it didn't work.

Member Avatar for seanbp
0
144
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
131
Member Avatar for kafro

I'm trying to create a Tkinter that will search through a webiste and import a picture. My codes is a bit messy but I'm able to use the Search button and grab a URL and print the URL in the Python Shell, but I'd like to show the URL image …

0
80
Member Avatar for Python_Doofus

Hello, im really stuck at the minute. im trying to create a pattern (that is shown below) and this is all that I can get. im not very good with python, but im trying. any help would be appreciated. the actual size of the whole thing has to be 100x100 …

Member Avatar for richieking
0
224
Member Avatar for lewashby

In the following two functions, why is it that the first one can see the outside variable but the second one can not? [CODE]name = 'Jack' def say_hello(): print ('Hello ' + name + '!') def change_name(new_name): name = new_name[/CODE]

Member Avatar for TrustyTony
0
122

The End.