15,181 Topics

Member Avatar for
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
324
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
211
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
267
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
159
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
140
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
150
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
206
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
130
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
121
Member Avatar for chiochiosane

Hello, well well, I'm all new with Python, actually I've heard of it for the first time 2 or 3months ago... I have to do a project for my class (I'm not even in Computer Sciences)and I need some help... I start to be familiar with different expressions of the …

Member Avatar for woooee
0
71
Member Avatar for dark3lf

Hello, I am writing a program in python that detects inserted usb drives using dbus in linux and copies all of the files from it over to a dir on the computer. Here's my code: [CODE] import dbus import gobject import shutil import os import subprocess import time def move_files(pth): …

Member Avatar for dark3lf
2
193
Member Avatar for dmurder
Member Avatar for 15uck
0
93
Member Avatar for Democles

Hello, I am more experienced with Java and trying to write a script for a server I have. I need to learn Python anyway, so I am attempting to do it in python. I am not completely lost, but just puzzled why it would do this. Here is the code …

Member Avatar for Democles
0
266
Member Avatar for Boonzo

I'm trying to write a program which asks for the number of animals and then the name and the population of each animal. I want to get it to add the population of each animal but I having trouble getting the variables from the dictionary and adding them. This is …

Member Avatar for Gribouillis
0
112
Member Avatar for 15uck

Hi Guys, I've been doing python programming for a few months and I have some code that needs a GUI. All the code does is various print outs to the screen, now in my head this sounds simple enough to convert to a GUI but I can't figure out where …

Member Avatar for 15uck
0
356
Member Avatar for furret

So I have a function called find_positions which gives off values like [101,207] [99, 87] [34, 56] etc. I then have a centre of mass function called CoM which when any region is put in, can find the centre of mass of that region. Herein lies the problem. I need …

Member Avatar for woooee
0
132
Member Avatar for ccandillo

Can someone please tell me why my menubar does not show up? [CODE] #!/usr/bin/env python from Tkinter import * class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.master.rowconfigure(0, weight=1) self.master.columnconfigure(0, weight=1) self.master.title('Test Menu') self.createMenu(master) #self.createShell() def createMenu(self, master): menubar = Menu(master) master.config(menu=menubar) loadmenu = Menu(menubar) loadmenu.add_command(label='Load', command=self.load) loadmenu.add_command(label='Save', command=self.save) loadmenu.add_separator() loadmenu.add_command(label='Quit', …

Member Avatar for woooee
0
348
Member Avatar for kpxny2sk

Hi. I was wondering if theres a way to take a specific item from a list to another list. Here's what I thought would work...: [CODE]def __init__(self, indata): self.data = indata self.total = len(self.data) def getTtestFactorA(self, factorA): ListFactorA = [] for factorA in self.data: ListFactorA.append() return ListFactorA def getTtestFactorB(self, factorB): …

Member Avatar for richieking
0
193

The End.