15,194 Topics

Member Avatar for
Member Avatar for brianlion1992

im new to python. just started today. learned a few things but not much. I have made 4 different menus each with a list of choices that executes certain functions. i want to make a 4 choice menu that can direct me to each one of the other 4 menus. …

Member Avatar for jcao219
0
130
Member Avatar for arunbg

Hi, I am working on a project in text mining using Python. As part of the project I need to use a technical term extractor, and I found the [URL="http://www.nactem.ac.uk/software/termine/#form"]Termine[/URL] system from NACTEM very useful. I have used the web demo (it's pretty nifty) and now want to integrate it …

0
108
Member Avatar for Hoss212

First some background, i am writing a stats program for my school, the way you enter stats is by a window that has a textbox that shows how many of that stat the player has, lets say pass thrown, and two buttons a plus and a minus to add or …

Member Avatar for Murtan
0
147
Member Avatar for Tommy.Leedberg

I have a Value Error that is caught, in the exception block when I have no problem printing to the terminal, however, i cannot insert any text into the text widget. Heres the code snippet, any ideas? try: if len( errorCode ) == 0 and len( errorCodeHex ) >= 1: …

Member Avatar for Tommy.Leedberg
0
123
Member Avatar for Simes

[CODE=python]#Code should always be in a method or class #Always start variable names with lowercase, classes could be capital #input.upper() allows the user to use lower or upper case for each option import random def isint(x): try: int(x) return True except: return False print "Invalid guess. " def getGuessValidator(): while …

Member Avatar for Simes
0
409
Member Avatar for camigirl4k3

I have most of it but I can't figure out how to word the last part. [CODE] def findLargest(L): largest = 0 for x in L: if x > largest: largest = x return largest def findSmallest(L): smallest = 300000000 for x in L: if x < smallest: smallest = …

Member Avatar for spiricn
1
249
Member Avatar for catcit

Hello! I am in the 11th grade and I have started with one of my colleagues to work on a file compression program based on Huffman coding. I have previously worked with python (a program that handles some .xls files) but this project is more complicated so I shall need …

Member Avatar for jcao219
0
149
Member Avatar for swish123

Hello, I have new to programming in python(have a little experience in C++) and to this forum. I am trying to write a program that finds Nth prime number; for example the 1000th prime number. Whenever, I try to run the program I just a see a blinking cursor and …

Member Avatar for woooee
0
149
Member Avatar for vrk6

Hi everyone, I am getting a error when using Xampp with mod_python addon and another python script Here is what I am trying to do, (I checked that the mysql server and apache server are running and refreshed. Also the config files was done correctly.) 1. First entered a string …

0
33
Member Avatar for john2oth

On the Unix machines,there is a file /usr/dict/words that contains a list of English words,one per line.This file is used by spell-checking programs for example. Write a python function which takes one argument,which is a word (as a string)and returns true if the word contains alternating vowels and consonants (i.e …

Member Avatar for Gribouillis
-4
321
Member Avatar for prashanth s j

Hi all, I have got a regular expression of the form: "tcp:"+'[0-9]+' It works fine when using the re.search( ) module. But if I want to grep for a line in a file that contains the pattern required, then the things wont work. Grep sees the regualr expression as tcp:+[0-9]. …

Member Avatar for prashanth s j
0
146
Member Avatar for «¤¦PR☼GRAM¦¤»

Well I have just started learning python and one of my first projects I have assigned is to find out every uniquely usable character (like the ones in my id) can be used in python. I would save them in file. I am not very good at writing the code …

Member Avatar for Tech B
0
300
Member Avatar for o0b3600

Hello, I found this website while I was trying to search a solution/ recipe for a problem I am trying to tackle... I am very new to python :( How can I run an executable file from a python script? for example: All the files (python script - filename.py-, executable …

Member Avatar for Gribouillis
0
274
Member Avatar for goodwin912

I did a project last year in VB for image processing, basically link to a folder, load an overlay and loop through the folder overlaying a watermark. I now need to get the same thing running in python to cater for cross platform use. I have translated all the image …

Member Avatar for goodwin912
0
154
Member Avatar for prashanth s j

Hi all, for the following string I want to search a pattern The string is lcpstr = "2008/03/25 log:true lcp: 78888 -> 100 lck=0 to=900 un=5840 l=0 BMN" If I take the pattern as "lcp: 78888", pattern checking is successful when I give the following statement: temp = re.search("lcp:"+" "+'[0-9]+'+" …

Member Avatar for snippsat
0
123
Member Avatar for ITgirl2010

This is the question i was given --------------------------------------------------- Here is a program that prompts the user to enter a student’s marks, and then prints out whether they have passed or failed a unit. '''calculate a students grade given their final mark''' def calcFinal( asg1, asg2, exam ): final = asg1 …

Member Avatar for snippsat
0
165
Member Avatar for garyinspringhil

I'm a newbie so please be patient... :) [CODE]def canvas(self): import qt self.setCaption('My Canvas') c = qtcanvas.QCanvas(self) # <- gives the canvas a parent QObject c.resize(315, 207) v = qtcanvas.QCanvasView(self) v.setGeometry(QRect(200,590,321,211)) lay = qt.QVBoxLayout(self) lay.addWidget(v) v.setCanvas(c) l = qtcanvas.QCanvasLine(c) l.setPen(qt.QPen(qt.Qt.black)) l.setPoints(10,10,390,390) l.show() v.show() c.update() l1 = qtcanvas.QCanvasLine(c) l1.setPen(qt.QPen(qt.Qt.red)) l1.setPoints(20,60,10,230) l1.show() …

Member Avatar for garyinspringhil
0
137
Member Avatar for mattj63

The askdirectory window in tkinter has a fixed size. My folders are deeply nested with long names. I would like to make the window larger so one can read the entire path. (I'm in WinXP) Is there a way to set the size of the askdirectory window or make it …

0
56
Member Avatar for qwertyui

i have 2 list contaning 4 element i must create 2 new list which contain 2 element 1st new list must contain an element from each original list 2nd list must also contain 2 element apart those of the 1st new list

Member Avatar for woooee
0
174
Member Avatar for davethebear10

I have to get three pieces of information from the files i have 1. The name of the owner of the file which appears after the pattern tag <foaf:name> 2. The ID of the owner of the file which is embedded in the filename, e.g., http%3A%2F%2Ftalk.ie%2Fvbulletin%2Ffoaf.php%3Fu%3D12 belongs to user 12. …

Member Avatar for woooee
0
251
Member Avatar for danizzil14

ok I had looked on the internet and found one form of running an exe file from a py script, i goes like this. [CODE]import os os.system("c:/windows/iexplore.exe") # Or wherever it lives[/CODE] Problem is, whenever i run the script with the appropriate path loaded in, i get the following: [CODE]Traceback …

Member Avatar for o0b3600
0
369
Member Avatar for SgtMe

Hi guys! I am in the process of making a game...similar to this one: [url]http://www.miniclip.com/games/nfl-lateral-collateral/en/[/url] I am using the following code to detect key presses: [CODE] pygame.event.pump() key = pygame.key.get_pressed() if key[pygame.K_LEFT]: ... [/CODE] How can I detect if a key is released? I have seen this done with using …

Member Avatar for tbone2sk
0
14K
Member Avatar for foxyenock

Write a python function which takes one argument, which is a word(as a string),and returns true if the word contains the same number of vowels as consonants. Then write a short piece of code to read the above file and print out all such words.For example the words such as …

Member Avatar for foxyenock
0
88
Member Avatar for tkpanther

I have been given an assignment to create a random race program where 2 different lines race. How the lines travel is determined by a random number generator, but that is not the issue I currently have. I am suppose to create a window that is 500x600, with the x- …

Member Avatar for ssmokincamaro
0
193
Member Avatar for camigirl4k3

A non-robot problem (Should be submitted independently). Write a Pyhton program, called Scores.py, which reads a collection of exam scores (integers) ranging from 1 to 100 and counts and prints the number of `A' scores, `B' scores, `C' scores, `D' scores and `F' scores based on the following grading scale: …

0
61
Member Avatar for duomaximus

Good day, any ideas on how to implement edge scrolling for wxPython. Panel used is a wx.ScrolledWindow here's a sample screen shot of the tool. The red areas indicates the edges of the map panel where the scrolling will be triggered. [url]http://i40.tinypic.com/wsmo95.jpg[/url] Thanks in advance!

Member Avatar for duomaximus
0
57
Member Avatar for garyinspringhil

I need a qtimer to trigger reading of a file line by line, I have the code working running with the timer trigger but qtimer will just read the first line over and over as it is now. Here is the code so far: self.lcdtimer = QTimer() self.connect(self.pushButton85,SIGNAL("clicked()"),self.update) self.connect(self.lcdtimer, SIGNAL("timeout()"), …

0
61
Member Avatar for GMUPATS

I am a student in my first python programming class in college and I am trying to figure out how to do my latest lab assignment. Could anyone just give my a hint on how to get a file (I know how to import it into the program) into dictionary …

Member Avatar for vegaseat
0
88
Member Avatar for bumsfeld

I am starting to play around with IronPython, but I can't figure out how to convert any code to executable file that will run on Windows. There has got to be some kind of batch file.

Member Avatar for jcao219
0
187
Member Avatar for prashanth s j

Hi all, I ahve got a requirement of searching for a string in a text file and then return that string. I also need to convert that to numerical value Could anyone please tell me how to do it? The requirement is precisely like this: First I need to search …

Member Avatar for bumsfeld
0
98

The End.