15,175 Topics

Member Avatar for
Member Avatar for Ri0o

hi, i'm new in python programming i'm trying to write a simple program that processes a text file containing grades for a class, extracts the desired grades, count the number of grades in each grade segment and genrate a pie chart for grades,(A1) and here is the text file link …

Member Avatar for Ri0o
0
163
Member Avatar for Mathhax0r

My issue is essentially spelled out in the title. I want to be able to catch clicks (more specifically double clicks) on icons on the desktop or in folders or wherever, and tell where the click was on the icon (the coordinates of the click along with the whole size …

Member Avatar for Mathhax0r
0
104
Member Avatar for efecto
Member Avatar for efecto
0
243
Member Avatar for simpatar

This is my program: [CODE]def main(): print('This is a program to calculate the setprod') print() userinput = input('Enter two sets separated by a comma: ') value1, value2 = userinput.split(',') mylist1 = eval(value1.strip()) mylist2 = eval(value2.strip()) print(mylist1 + mylist2) main()[/CODE] If I enter following: [CODE]>>> This is a program to calculate …

Member Avatar for simpatar
0
103
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 npn_

Sorry if this is a really easy question, but I've been going through control flows in the python documentation and something confuses me that it doesn't address. [CODE] a = ['Mary', 'had', 'a', 'little', 'lamb'] for i in range(len(a)): print i, a[i] [/CODE] When I type that in, it prints …

Member Avatar for npn_
0
87
Member Avatar for pdxwebdev

Ok, lets say I have a string [CODE] str = "main,sub,sub_sub" [/CODE] how could I use that to edit the value inside the dict [CODE] dicx = {'main':{'sub':{'sub_sub':'value to change'}}} [/CODE]

Member Avatar for masterofpuppets
0
113
Member Avatar for zyrus001

Having worked with txt files, I'm learning about binary now. My code below works for a while then bombs out, can you point me towards a method or module to read binary data line by line? The crypto module requires a buffer (don't know how to create one of those) …

Member Avatar for mn_kthompson
0
555
Member Avatar for sneekula

I am still rather new to the Linux OS and need some detailed advice on the installation of Python3.1 on my Ubuntu machine. Python3.1 is not in the Ubuntu package repository yet.

Member Avatar for pdxwebdev
0
1K
Member Avatar for pdxwebdev

[CODE] def doKey(e): print(e.widget.get("1.0","end")) root= Tk() root.title('yada') txta = Text(root, width=40, height=10) txta.bind("<Key>", doKey) txta.pack(side=LEFT) root.mainloop() [/CODE] Pressing a key in this text area will always output the string prior to your pressing the key. Am I missing something?

Member Avatar for pdxwebdev
0
142
Member Avatar for BattlingMaxo

I am a complete newbie to python but know some c++ Was wondering where i can get my hands on a 3D script for schooling(like fish) BattlingMaxo

Member Avatar for vegaseat
0
92
Member Avatar for masterofpuppets

hi all, I am designing a text editor program in Python using Tkinter and I was wondering if there's any way to get the current line number when the mouse is clicked somewhere on the text field, i.e the mouse position should determine the current line, like in the python …

Member Avatar for masterofpuppets
0
918
Member Avatar for kenmeck03

Write a function called NumDistinctDict that takes a single parameter alist that determines the number of distinct values in alist. For example, the list [1,2,4,2,7] contains 3 unique values (namely 1,2,4 and 7).

Member Avatar for vegaseat
0
112
Member Avatar for Zaffron

So I want to make a class based RPG, as a project to help me understand how classes work. Unfortunately, I didn't get far. The below code is intended to make an instance of a character and have info in it like name, health, gold, exp, and the like. I …

Member Avatar for vegaseat
0
74
Member Avatar for lewashby

How do you know when to use a function by wraping the content between parentheses "function(x) or through dot notation x.function() ? thanks.

Member Avatar for masterofpuppets
0
160
Member Avatar for henks83

I have no idea how to do this. Please help. This week's lab is to design a hangman game. Your program should be able to open a text file which contains a list of words (one word on each line of the text file) and read the words into a …

Member Avatar for masterofpuppets
0
954
Member Avatar for bunkus

Hi, I tried the following code to capture the contents of the foreground window to an avi-file. It works under Python 2.6 and OpenCV2.0 though it only takes about 210 shots and then crashes. I think it might be a memory problem. Any ideas? You need to resize the window …

Member Avatar for bunkus
0
807
Member Avatar for AutoPython

I can't find a compiler to compile version 3 Python scripts to .exe. All the compilers I see are all for Python 2.

Member Avatar for vegaseat
0
186
Member Avatar for tomtetlaw

I tried to make a leet speak converter, but it outputs characters that I don't even tell it to.. This is what I mean: (Test run) Enter something to convert to L337 5P34K: Hi, how are you? L337 5P34K equivilent: hi,@H0w 4R3 Y0u? I don't know why it's got the …

Member Avatar for willygstyle
0
530
Member Avatar for m.albert

Hi I have made a small program to record sound. I have a TK window with a record button. I would like to add a vumeter to this TK window. I use ubuntu and pulseaudio. If I type pavumeter in the terminal window I see a (pa) vumeter on my …

0
68
Member Avatar for thehivetyrant

Greetings Pythoneers. I've got this problem and the problem is thus: i have drawn a shape using [B]pygame.draw.circle[/B] i am finding it hard to make it move. i tried [icode]self.move_to(self.x-5,self.y)[/icode] and also [icode]self.forward(random.randint(0,10))[/icode] (Where forward is defined as a function as [icode]self.x,self.y + 10[/icode])<== I dont think i defined the …

Member Avatar for vegaseat
0
8K
Member Avatar for P3run

I just started to learn Python before a week or so and i found this example and rewrited it in Notepad++ (btw it was really painfull to figure out how to connect Notepad++ with python.exe but i like notepad++ more than Python GUI) and this program just wont work nor …

Member Avatar for snippsat
0
128
Member Avatar for python.noob

Hello geeks, First of all thanks to the members of this forum for their active participation, contribution and willingness to help. Now i'm in need of your valuable suggestions for my project in python. 1) I want to have GUI interface in my project and now i'm using python 3.1.1. …

Member Avatar for vegaseat
0
136
Member Avatar for nerdagent

Just like the title says. I need help on clicking on a box in a grid and filling it in with a color. Right now each block is 10x10 so I would have to use a 9x9 rectangle so it doesn't overlap. [CODE] #!/usr/bin/python import pygame,os,sys from pygame.locals import * …

Member Avatar for vegaseat
0
2K
Member Avatar for mishu5770l

I want to create a string like this: (just theoretically:-)) [CODE]import random list1 = ["1", "2", "3"] string1 = random.choice(list1) string2 = "Random Number is" + string1 [/CODE] but I want string2 to show up formatted like this: Random Number is [INDENT] 2[/INDENT] But, for the life of me I …

Member Avatar for vegaseat
0
103
Member Avatar for johnroach1985

Hi there, Trying to write a small script in python. What it will basically do is this; 1- A SSH user initiates the python script (from SSH remotely) 2- The script gets the connected users IP (the user is connected through SSH) 3- The connected IP is sent back to …

Member Avatar for johnroach1985
0
2K
Member Avatar for mms6

binding_locations(strA, strB) My specifications The first parameter represents a strand of DNA. The second parameter is one strand from a recognition sequence. Return a list of all the indices where the recognition sequence appears in the DNA strand. (These are the restriction sites.) ------------------------------------------------------- For example, if the DNA palindrome …

Member Avatar for AutoPython
0
100
Member Avatar for nizbit

This is a very basic question, but I'm very new to python. I want to read data in a file. The data is between two delimiters. I'm not exactly sure how I can extract the data and skip the delimiters. Any help would be great.

Member Avatar for vegaseat
0
245
Member Avatar for simpatar

Ok my program looks like this: [CODE]U = set([0,1,2,3,4,5,6,7,8,9]) A = set([2,4,5]) B = set([5,8]) C = set([5]) def main(): print('This is a program to give complement to given elements') x = input('Enter elements bla bla: ') y = U.difference(x) print('The complement of given elements are:', y) main()[/CODE] As you …

Member Avatar for simpatar
0
80
Member Avatar for rackster992

Hello Everyone I am new to this forum and new to learning Python. I was looking for a good book to help teach it to myself and on a recommendation purchased the book [I]Python Programming In Context[/I] by Bradley Miller and David Ranum. This is a good book in terms …

Member Avatar for dcghelp
0
1K

The End.