15,185 Topics

Member Avatar for
Member Avatar for KrazyKitsune
Member Avatar for KrazyKitsune

I'd like a code in which a raw_input function will end and move to a print function after 35 seconds. So something like: [code=syntax]var = raw_input() # put time limit of 35 secs here print "Time's up!" # prints this only if time runs out in the raw_input[/code]

Member Avatar for wikirifi
0
4K
Member Avatar for Toikkala

Hey, i need to make app that should take 10 chars from list. I tried it with range command but it's not working. [CODE] list = 'abcdefghijklmnopqrstuvxyzo' for list in range(10): print list [/CODE] And this code just prints numbers 0 to 10. So, is there some other command that …

Member Avatar for TrustyTony
0
226
Member Avatar for kerimabdullah

#Hi friends I want to shorten these codes I must control at least 100 space and delete please help[CODE] for i in range(mylist.count('')): mylist.remove('') for i in range(mylist.count(' ')): #delete 1 space mylist.remove(' ') for i in range(mylist.count(' ')): #delete 2 space mylist.remove(' ') for i in range(mylist.count(' ')): #delete …

Member Avatar for TrustyTony
0
125
Member Avatar for kumar_k

Hi, Iam in the process of creating a program for converting words in a file to numbers. Am struck at the input file selection gui script. i want to create a GUI to open a file from the open file dialog box and to read the words in the file …

Member Avatar for kumar_k
0
140
Member Avatar for Techguruwanabe

I am a student and my assignment is to write a change calculator program.I have got to go from Dollars down to pennies (not to much work) but I lost my notes (Kinda stupid of me) and I dont know how to fix my program.Please help [CODE]print 'Hello please enter …

Member Avatar for cghtkh
0
2K
Member Avatar for Ultralisk

Hi Having trouble getting this started. I wan't to read lines of data from my file, which has the current contents Scores.txt - [CODE] Names Difficulty Scores Totals Mark Smith 2.5 6.0 5.0 5.5 5.5 6.5 6.0 6.5 44.25 John Andrews 2.8 5.5 5.5 6.0 4.5 6.0 5.5 5.0 46.20[/CODE] …

Member Avatar for cghtkh
0
125
Member Avatar for jimmy9pints

Total new question here - and I know [URL="http://www.daniweb.com/forums/thread76747.html"]a similar question[/URL] has been asked before - but I've done a bit of work on this and I'm stuck, so I'd appreciate some help. The exercise I'm stuck on is this: [QUOTE]Write a function that implements Euclid's method for finding a …

Member Avatar for jimmy9pints
0
124
Member Avatar for convoluted

Hi all, Just started using Python a week or so ago, really enjoying it so far, but stuck with a project I'm working on. I'm trying to create a in-dash display system which uses Python to communicate with a piece of hardware and uses an HTML page to display the …

Member Avatar for SoulMazer
0
183
Member Avatar for noniterum03

I am having trouble with tkinter and python on my Mac, I'm running Leopard.I did a port install of python2.6, numpy, scipy, matplotlib, but when I try and import matplotlib.pyplot, I get the following error. I think there is a conflict with the pre-built version of python that comes with …

Member Avatar for woooee
0
158
Member Avatar for danholding

i am getting a ValueError message when running my code i am currently converting from 2 to 3 and have come across a brick wall any help would be great :) [code=python] # sorts files by modifed date, collects the 6 most recent files, and delete all others. #created by …

Member Avatar for woooee
0
415
Member Avatar for sebcbien

Hello, I'm trying to update a dictionary using variable in a class. Something looking like this : [code=python] class testClass(object): def __init__(self): self.data0 = 0 self.data1 = 1 self.data2 = 2 self.data3 = 3 self.d = dict( data0 = self.data0, data1 = self.data1, data2 = self.data2, data3 = self.data3 ) …

Member Avatar for snippsat
0
173
Member Avatar for viandante

I'm trying to make a siple list to display sqlite rows in a grid using wxList. I can't come up with something decent. I can't place correctly the items in the list. [code] #!/usr/bin/env python # -*- coding: utf-8 -*- # generated by wxGlade HG on Wed Sep 22 12:34:17 …

Member Avatar for viandante
0
134
Member Avatar for doffing81

Let's create a continuing thread to program Crazy 8's from scratch for learning purposes! [B]DECK/CARD IDEA'S[/B] My simple starting suggestion: [CODE]deck = ['2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC', '2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD', '2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH', '2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS',][/CODE]

Member Avatar for doffing81
0
1K
Member Avatar for Enders_Game

So I'm trying to make a parser for a game replay. I just need help getting started, I have docs for it explaining. Atm I'm just trying to get the header parsed. [code] replay = open(r'C:\Users\CookieMonster\Desktop\mix.w3g', 'rb') #offset | size | description print(replay.read(0x1c)) #0x0000 | 28 chars | zero terminated …

Member Avatar for griswolf
0
335
Member Avatar for slingblade

I've been trying to modify a function and every attempt seem to screw up the plist. [CODE]def removeItem(pl, item_name): for dock_item in pl['persistent-apps']: if dock_item['tile-data']['file-label'] == item_name: verboseOutput('found', item_name) pl['persistent-apps'].remove(dock_item) return True for dock_item in pl['persistent-others']: if dock_item['tile-data']['file-label'] == item_name: verboseOutput('found', item_name) pl['persistent-others'].remove(dock_item) return True return False [/CODE] This scans …

Member Avatar for slingblade
0
125
Member Avatar for PascalNouma

Hi everyone, Does anyone know how to remove a particular attribute in XML by using Python? [CODE] <country> <city capital="Paris">Paris</city> ............ ............ </country> <country> <city capital="Helsinki">Helsinki</city> ............ ............ </country> <country> <city capital="Bogota">Bogota</city> ............ ............ </country> [/CODE] I just wanna delete or remove Paris and Helsinki here by using SAX or …

Member Avatar for bvdet
0
322
Member Avatar for acrocephalus

Hello! I have a frame with some sizers in it (see code at th end for a running example). I would like to know how to repeat the sizers 2, 3 and 4 when pressing the add button. The sizers should be added before the submit button, and the control …

Member Avatar for acrocephalus
0
123
Member Avatar for emorjon2

hello! I'm coding in python and have make the computer controll a lego NXT robot via bluetooth. Next step is to involve my lg ku990 mobile to the network, so I can get the camera and sound information from the mobile phone. Do anyone knows a python library as allow …

0
162
Member Avatar for Archenemie

[CODE]paid_value = self.paidinput.GetValue().strip()[/CODE] I have this line of code to take a number from the paidinput field, but i need the value as an integer, how would i go about this?

Member Avatar for Archenemie
0
98
Member Avatar for AnnetteM

Hello Daniweb, I would like to read binary data into floating point numbers. I'd be happy with a 1-D array (or vector) or a 2-D array. Just something I can write to a text file. I attached a small sample of this data. Here is the code I have so …

Member Avatar for woooee
0
4K
Member Avatar for kadvar

Hi, Given a sentence, I'm trying to check if all the individual constituents of a word are present in it and if they are then do some further processing. I can't seem to get the logic to work. [CODE]wordlist = ['England area','Germanic 6th'] mysentence = 'The area now called England …

Member Avatar for kadvar
0
99
Member Avatar for Sandhya212

Hi, My requirement is to identify '-' in string1 and delete those corresponding locations in string2. The logic I am implementing is that 1. find the locations in string1 where '-' occurs 2. At these locations, insert spaces in string2 and then 3. have string2 without spaces. I managed to …

Member Avatar for TrustyTony
0
123
Member Avatar for kez1985

Hi I recently started using python for work and was tasked with creating a mailer script for one of our linux servers. I found a number of good examples on the web for different mailer app implementations and eventually came to the code below. Can anyone advise me on good …

Member Avatar for TrustyTony
0
193
Member Avatar for cmcpart0422

Hey I'm new to the site but I'm taking a class that will probably have me here often asking stupid questions. One of my homework problems is create a python program using a while loop to answer the 100 fowl problem. The 100 fowl problem is a farmer sold 100 …

Member Avatar for cmcpart0422
0
109
Member Avatar for Sandhya212

Dear all. I have a file with lines like this.[CODE] query 210 ACTTGGACTC 219 query 311 ACTTGGACTC 320 ....[/CODE] From every line, I need to extract the number coming right after 'query' and then the DNA sequence. I currently read each line as a list but was only able to …

Member Avatar for Sandhya212
0
176
Member Avatar for bettersaid

Is it possible in python to open all files in a directory? this only opens a particular file: [CODE]import os path = "/Desktop/directory/file.odt" temp = os.system("open " + path)[/CODE] how about this? am i doing it right? [CODE]import os mypath = "/Desktop/directory" temp = os.listdir(mypath) temp = [os.path.join(mypath, i) for …

Member Avatar for redyugi
0
128
Member Avatar for bettersaid

[CODE]import os from appscript import * this = app(u'System Events').application_processes[param1].windows[param2].exists() while True: this1 = app(u'System Events').application_processes[param1].windows[param2].count(each=k.radio_button) if count == (this1): this2 = app(u'System Events').application_processes[param1].windows[param2].radio_buttons[param3].click() try: os.makedirs(param1) except OSError: if os.path.exists(param1): this3 = os.system('screencapture -C '+ param1 +'/'+ param2) while True: self.param2 = os.path.join(param1, 'win%s_%s_img_%s' % (param1, param2)) return param2 + …

Member Avatar for bettersaid
0
186
Member Avatar for kimmi_baby

I've created a program with turtle graphics that has 3 functions. One draws rectangles, one draws squares and one sets the position. I'd like to create a function that fills in the shapes with different colours. I know about begin fill and end fill... but I would really like to …

Member Avatar for stevenpgrm
0
80
Member Avatar for bettersaid

f i opened a document in terminal through this [CODE]os.system("open " + pathName)[/CODE] how should i close it? is there something like [CODE]os.system("exit")[/CODE] or something Thanks

Member Avatar for bettersaid
0
76

The End.