15,185 Topics

Member Avatar for
Member Avatar for Brickmack

I was wondering how to make a sound play repeatedly in python. I'm making a simple alarm clock program, and at a certain time (6:30 for example) it will play a recorded sound over and over again until the user presses enter. I think I have that figured out, but …

Member Avatar for woooee
0
77
Member Avatar for convoluted

Hey all. So I'm attempting to include mouse gestures as a part of a GUI I'm designing. I'm using the following code, and it works great HOWEVER only when the gesture is draw away from widgets/controls (such as buttons, statictext's, etc). If I start a gesture and cross the path …

Member Avatar for richieking
0
173
Member Avatar for keltik
Member Avatar for Gribouillis
0
78
Member Avatar for bmoe

What is the best way to terminate ReadFile once the data is done being read? I just sits there an hangs! I'm kinda new to Python so be easy on me! :) The other way i was able to read info from my pipe was blah = open(pipe) then blah.read() …

0
118
Member Avatar for parijat24

[CODE]dict = {'ENSTRUT00000047813': '1680', 'ENSTRUT00000047812': '2067', 'ENSTRUT00000047811': '2067', 'ENSTRUT00000047810': '2088', 'ENSTRUT00000047814': '738', 'ENSTRUT00000047808': '2208', 'ENSTRUT00000047809': '2001'}[/CODE] I want to find out the key with max value from the dict I am using the [CODE] protein = max(dict.iteritems(),key=operator.itemgetter(1))[0][/CODE] but it will give me results as [CODE]'ENSTRUT00000047814'[/CODE] though i know that it …

Member Avatar for TrustyTony
0
170
Member Avatar for python_user

Can anyone please help me as i am new to python, i have a requirement for a cascaded menu(which should be dynamically built). The cascaded menu should have new at all levels and when the user clicks on new it should ask for keyword and when done it should add …

Member Avatar for richieking
0
162
Member Avatar for Naley2010

hi i need help to write two different functions the first one is to displaysquareroots that asks the user for a number n, and displays the square roots of the number from 1 to n and to 3dp so if the user enters 3 it displays the square root of …

Member Avatar for richieking
0
153
Member Avatar for DanniStacey

Hi, I have been ask to do this: Write a function wallOfEyes that takes three parameters (radius, width and height) and displays, in a window of exactly the right size, a “wall” of brown eyes of the given radius and dimensions. E.g., the function call wallOfEyes(50, 4, 2) should give …

Member Avatar for richieking
0
85
Member Avatar for bob24bob

I have recently made a guessing game code and I am now trying to make it so when you enter a number above 3, it will give a print command that i will write. I don't need help on the print command, I just need to know what the string …

Member Avatar for TrustyTony
0
163
Member Avatar for Finki

So im putting together a program that decompositions numbers on prefactors. Example: 252=2^2 3^2 7^1 and 1944=2^3 3^5 Put this into tuples: (wont use split, just for example) >>> split(252) [(2, 2), (3, 2), (7, 1)] >>> split(1944) [(2, 3), (3, 5)] This is the code that determines whether a …

Member Avatar for Finki
0
204
Member Avatar for flamedragon00

Hello everyone, I'm new to this website and to prgramming in general. Taking a class and we're starting with python. Doin a programming project in which I need to do Data mining for a company. I'm stuck trying to get the company's monthly average for each month. I can A …

Member Avatar for flamedragon00
0
1K
Member Avatar for Azul-P

Greetings, I'm working my way through Michael Dawson's Python Programming for the Absolute Beginner book. At the end of chapter 4: "for Loops, Strings and Tuples", there is a challenge that asks so "improve Word Jumble so that each word is paired with a hint. The player should be able …

Member Avatar for TrustyTony
0
2K
Member Avatar for Andrew1988

Hi there, I am in a first year programming class at Dalhousie University (Halifax, Nova Socita, Canada), and I need a little help with an assignment. The exercise is as follows: "[10 Points] Create a number guessing game. First, ask the user for some positive integer, n. Ask the user …

Member Avatar for woooee
0
191
Member Avatar for kuchi

Hi, I have a date with the String like "20091128' and we have to check this date with current date ("20101118"). if that date is old then we need to do some rules. I've checked in google whether there any existance but there have different formats. Can anyone give me …

Member Avatar for Gribouillis
0
79
Member Avatar for davidgulliaf

Hi, im newish to python and have been stuck on this coding for a few days I have managed to code so I take input from user of a string which I then list the string depending on how many strings are entered after a space so if the input …

Member Avatar for woooee
0
121
Member Avatar for bwbyron

This is basically what I have. I've commented out all the places where I know what to do, but not how to do it. PEG_HOLE = 10 PEGGED = "X" ##################### # Functions you need to fill out def roll_die(): # This function will simulate rolling two six sided dice …

Member Avatar for TrustyTony
0
210
Member Avatar for Kagome

I'm writing a program for a class that's a game. It has ten places to put a peg, numbered 1-10. You have to roll 2 die and the summation is the number you have to work with to try and fill in the board. So far, my program is as …

Member Avatar for TrustyTony
0
243
Member Avatar for fannunziata1

I need help converting this problem into a python program. I've been at it for days and its due tomorrow. Someone please help! In a locker room there are 1,000 lockers in a row numbered from 1 to 1,000. They are all closed. A monkey comes in and starting at …

Member Avatar for TrustyTony
0
155
Member Avatar for maofree

Hi Droopy doesn't work on my Linux's distro with python 3.1 (with python 2.x everything was ok). (here you can find droopy [url]http://stackp.online.fr/?p=28[/url]) I've used this command 2to3 -w droopy and changed alot u" in " , in Translations section But now there is another problem [CODE] Traceback (most recent …

Member Avatar for maofree
0
381
Member Avatar for gunbuster363

I just started to learn gui with wxpython I can see many objects have a style attribute, for example TextCtrl, self.inputArea = wx.TextCtrl(self.background, style=wx.TE_PROCESS_ENTER) Where can I see a list of available style for each object? Thanks

Member Avatar for cghtkh
0
105
Member Avatar for gk123987

Hi all, I am in the process of automating functional tests. I have the following requirement. 1. The python script should invoke the Lauterbach automatically 2. The cmm file mentioned in the python script, should be loaded in to the Lauterbach automatically. Is there any commands to do it? Please …

0
54
Member Avatar for gunbuster363

Hi all, I am having problem printing chinese character in a text file. Some point to know: 1. I do not know the codec of the text file, but I know it is writting in traditional chinese. 2. I tried some approach from google, no one work I don't remember …

Member Avatar for richieking
0
97
Member Avatar for hyperzero4

[code]> can't invoke "event" command: application has been destroyed while executing "event generate $w <<ThemeChanged>>" (procedure "ttk::ThemeChanged" line 6) invoked from within "ttk::ThemeChanged"[/code] Has anyone ever seen this error before? It keeps appearing when I load a toolkit I need for my project. I've been working to find out where …

Member Avatar for creed_creed
0
778
Member Avatar for victordq

Hi guys, I'm new to forum and to Python. I need some help with the python - MySQL interaction. I'm creating a program for my conclusion project in College and it's not working. I gotta present it on Wed, 11/24, and I'm really desperate for some help. It's suposed to …

Member Avatar for victordq
0
198
Member Avatar for convoluted

Hey all, Hopefully this will help someone with a problem I encountered. For a few days now I was looking for a way to concisely set the attributes to numerous controls without duplicating attribute code again and again. For example, let's say I have 3 static text controls and I …

Member Avatar for convoluted
0
175
Member Avatar for evertron

I created 2 classes and I need to pass Name, Dept., Birthdate and HireDate from the Employee class to the Date class. I get the month date and year from input prompts. The problem I have is how to get those dates for the employee passed into the date class. …

Member Avatar for slate
0
135
Member Avatar for spiricn

So I've been writing this application that works with files , and I wanted to add a list of recently opened files in the "File" menu and I came across a weird bug .. Here's the sample code .. [code] for path in recentFilesList: item = wx.MenuItem(menu, wx.NewId(), path) self.Bind(wx.EVT_MENU, …

Member Avatar for loading...
0
183
Member Avatar for sallubhai

Hi, How can I print this figure if I have an array like this? It should be a for-loop but don´t know how. [CODE] labyrinth = \ [[0,0,0,0,0,0,1,0], [0,1,0,1,1,1,1,0], [0,1,1,1,0,1,0,0], [0,1,0,0,0,0,0,0], [0,1,1,0,1,1,1,0], [0,0,1,1,1,0,0,0], [0,1,1,0,1,1,1,0], [0,1,0,0,0,0,0,0]] [/CODE] figure: ############. ## ## ##. . . . ## ##. . . ## #### …

Member Avatar for TrustyTony
0
151
Member Avatar for Binika

Please help! I need to write a programe, that would draw a picture like this: [URL="http://yfrog.com/6ptreelj"]http://yfrog.com/6ptreelj[/URL] I've tried with recoursion but it doesn't work properly. from turtle import * [CODE]tree(n, lenght): if n == 0: lt(90) fd(lenght) rt(45) fd(lenght/2) bk(lenght/2) lt(90) fd(lenght/2) bk(lenght/2) rt(45) else: rt(135) tree(n-1, lenght/2)[/CODE]

Member Avatar for ultimatebuster
0
162
Member Avatar for ekkanh

Hi How can I delete a file after a certain time? for example if I want to delete a file after 08.30 has passed? do I use import OS? and import time?

Member Avatar for richieking
0
396

The End.