14,948 Topics

Member Avatar for
Member Avatar for ITGeEk2020

I have a project due at the end of the quarter. This is my first quarter in programming and we have to create a single player game with at least three modules. I want the game to ask the user to choose heads or tails, then a coin flips and …

Member Avatar for vegaseat
0
457
Member Avatar for ultimatebuster

This is the folder structure: [CODE]root common.py module1 somescript.py module2 someotherscript.py[/CODE] i need to import common.py from somescript.py and someotherscript.py I also need to import somescript.py from someotherscript.py

Member Avatar for lrh9
0
154
Member Avatar for pendo19

Hi all, Does anyone know how to search for a string or substring within a list. I have [CODE] def searchfilt(self): f = open("timeline1.csv", "r") reader = csv.reader(f) text = enterbox(msg='Please choose a highlighter search term', title='Highlighter ', default='', strip=True) lines = [] i = -1 self.listbox2.delete(0, tk.END) for i, …

Member Avatar for TrustyTony
0
237
Member Avatar for Tommymac501

I'm trying to make a fixed length output record, and I'm using a Dictionary as a lookup table to find a code based on the kind of car a person drives. The routine works fine; I the search the key for the car type, and the value returned is the …

Member Avatar for woooee
0
4K
Member Avatar for kametolearn

I am trying to find a way to search a filename.rc file for a particular string. For now lets just say I am searching for the string PARTYHOST. After finding PARTYHOST in the file I would like to replace anything after it(so 192.168.0.1) with a new string which I have …

Member Avatar for Beat_Slayer
0
357
Member Avatar for abcdr

I need to write a loop that traverses the list and prints the length of [B]each element[/B]. So far I have this: [code] def countEachElement(): elements= ["spam!",'1',['Brie','Roquefort','Pol le Veq'],['1','2','3']] i=0 while i < len(elements): print len(elements[i]) i=i+1 [/code] But it's not counting each element of the lists inside the list. …

Member Avatar for jcao219
0
96
Member Avatar for gonzigg

Hello, Im trying to get this program to display a receipt of the items bought with its price and total, but so far this is what I've acomplished, I've been trying for a long time now, to make it print the receipt in the win2 but I haven't been able. …

Member Avatar for gonzigg
0
4K
Member Avatar for cmalkmes

Howdy, I'm a GIS guy trying to get my hands dirty with some Python. What I'm trying to do is iterate through a file (shapefile), reading specific fields from each row of the file's associated table. The table has thousands of rows, which is why a Python script is handy …

Member Avatar for cmalkmes
0
237
Member Avatar for hisan

Hi, I want to know how to read the binary file from 10th byte to 90th byte in a file size of 100 bytes and need to write the read data into new binary file. please help me in doing this.

Member Avatar for hisan
0
85
Member Avatar for lllllIllIlllI

Hi I have been trying to install the ERIC python IDE [url]http://www.die-offenbachs.de/eric/eric-links.html[/url] for a while now to no sucess. I could not i kept getting errors when installing the QT module [code] Determining the layout of your Qt installation... Error: Make sure you have a working Qt v4 qmake on …

Member Avatar for Tommymac501
0
804
Member Avatar for Jothe

hallo people, i want to start learning python and ruby for some projects i have anyone who knows a good resource site or books for this two languages. any books and where i can get them will be highly appreciated thanx in advance

Member Avatar for anurag mishra
0
104
Member Avatar for pythonbegin

Hi all I am newbie in python. I have a csv file with two columns first as source and second as target. There are multiple values assigned to keys in successive rows such as follows 1 -->4 1 -->5 1 -->8 1 -->12 2 -->4 2 -->17 2 -->14 2 …

Member Avatar for Beat_Slayer
0
3K
Member Avatar for pendo19

Hi all I have written code there are two definition functions but the only way I can get the whole thing to work is to put some code outside the definitions. Does anyone know how to fix the code so that I can call it from another module. Please help …

Member Avatar for pendo19
0
232
Member Avatar for Tightmopedman9

I'm trying to write a gui which will continually update values obtained from a data measurement device. Orginally this was accomplished using a TKinter .after loop with a specified refresh time of 500ms. This snippet of code is called from the mainloop and updates the values once when it is …

Member Avatar for Tightmopedman9
0
686
Member Avatar for vegaseat

The code is shamefully short, but here it is. Now you can listen to the many sound files in wave (.wav) format and boing, chirp, chime, bark, booh, laugh and mooh at the people around you.

Member Avatar for jbronen
3
1K
Member Avatar for manzati93

Hi All! I'm creating a program using Python and compiling it with py2exe. I've the same problem of this topic, but I can't solve it because GUI2exe is not supported by Python26. [url]http://www.daniweb.com/forums/thread224403.html[/url] How could I solve this problem?

Member Avatar for manzati93
0
141
Member Avatar for pythonbegin

Hi All I have two tab-delimited files. I want to compare first column of testfile1 to first column of testfile2 to find if items in file2 are in file1 and write it to the new file. I have a following code but not working!! :(. [CODE]f1 = open('testfile1.txt') #f2 = …

Member Avatar for TrustyTony
0
750
Member Avatar for acrocephalus

Hello! I am trying to write a function that looks for a desired string pattern within a table (Countries). Look at the code. [CODE]def selectCountry(): print 'Enter country:' country = raw_input('> ') sql = '''select idCountries,CountryEn from Countries where CountryEn REGEXP '%s'''' cursor.execute(sql,(country)) result = cursor.fetchall() rowHead = 'Country ID','Country …

Member Avatar for acrocephalus
0
348
Member Avatar for acrocephalus

Hello! I have this simple funcion [CODE]def newUser(): print 'Choose a username?' Username = raw_input('> ')[/CODE] The variable 'Username' has to be used by other functions. How can I do it? Cheers! Dani

Member Avatar for acrocephalus
0
10K
Member Avatar for acrocephalus

Hello! I have written a program where you have to give the path to directories and files as input. Is it possible to enable any kind of auto-completion when running the program? Cheers! Dani

Member Avatar for cronos4d
0
87
Member Avatar for bettersaid

i need help in controlling mouse click in python. Example would be 'clicking File menu --> Save Us--> Save' on its own. I have this code for launching an app, for example a textfile. but i dont know how to control its mouse click. Advice please. [CODE]import os class LaunchApp: …

Member Avatar for bettersaid
0
104
Member Avatar for dush0805

Hi, I am trying to find this string "QuickSearchResultsCOnfig" in a text file. The text file will contain this in several places. I need the following var QuickSearchResultsConfig = ['a','b','v','d','e 'f','f']; I need to replace the above with var QuickSearchResultsConfig = [['a',{hidden:true}],['b', {hidden:true}],'v','d','e 'f','g ']; My original approach: Store a,b,c,d,e,f,g …

Member Avatar for griswolf
0
121
Member Avatar for jenzilla

Hello! I'm fairly new to Python. Hopefully you can understand what I'm trying to accomplish here. I'm making a GUI that prints Parking Garage Tickets. I want to be able to post an expiration date on the ticket. I found out about timedelta, and it works if I put in, …

Member Avatar for jenzilla
0
3K
Member Avatar for spac_e

Hey- First time posting here so hopefully I explain everything correctly. [CODE] class sendbackcurricula(app.page): def GET(self): query = models.Curricula.query.all() map = dict() for x in query: x = x.to_dict() map[x['owner_id']] = x['title'] return json.dumps(map); [/CODE] The above code will return the last element held in the database at 'owner_id' and …

Member Avatar for TrustyTony
0
76
Member Avatar for Musing888

The basic idea for this program is to for me to enter a code to a corresponding website (which is already in a dictionary in the body of the program) and search that webpage for a specific phrase and return a value. This is so that I can check number …

Member Avatar for Musing888
0
230
Member Avatar for kimberling

Hi, I had write a script in perl to randamize hex value and get the results as attached. Which is decimal value-----hexadecimal value. If i want to get randomized hexadecimal value 0x12c8xxxx but not 0x12c80000, what can i do? (where xxxx is not zero but with some hex value) I …

Member Avatar for calccrypto
0
86
Member Avatar for Gribouillis

How would you safely round a floating point number to the nearest integer ? Python has the built in function [icode]round[/icode], but it returns a floating point number [code=python] >>> round(4.9) 5.0 >>> help(round) Help on built-in function round in module __builtin__: round(...) round(number[, ndigits]) -> floating point number Round …

Member Avatar for Gribouillis
0
3K
Member Avatar for kumarantechie

hi, I want to run an application that is compiled in python 2.5 in fedora 13 but fedora 13 comes with python 2.6.4 so i manually install python 2.5 to run the application but it is saying that no module named gtk .. how to set path for gtk for …

Member Avatar for woooee
0
144
Member Avatar for TrustyTony

Here is my practise with [URL="http://www.boggled.org/"]boggle [/URL]letter square non-overlapping word finder after some drastic debugging and cleaning. I think it is reasonable speed also. Comments wellcome.

Member Avatar for TrustyTony
0
1K
Member Avatar for personx1212

hi there, i have some binary data (zip files, music, etc..)stored in a database, how can i start those files in memory without saving them to HDD..or even to temp files folder... thanks.

Member Avatar for personx1212
0
74

The End.