15,190 Topics

Member Avatar for
Member Avatar for JustAnotherJoe

For weeks I've been using the same code without any problems. I call SIGNAL within a thread and it's working like a charm. Then I bring the same module home to the same environment (Ubuntu Jaunty, Python 2.6) and now I'm getting this error: ValueError: signal only works in main …

Member Avatar for JustAnotherJoe
0
7K
Member Avatar for Mathhax0r

This question, as the title says, is specific to the new file tagging feature in Windows Vista. Basically, I want to make a tag cloud for a certain folder, and in order to do this, I need to access all of the tags of the files in the folder. What …

0
62
Member Avatar for tweak

Well I'm trying to make a phone book program and I need some help what I want to do is add a ListCtrl to my frame so I can see the names and numbers of people in my phone book but I am unsure how to do this. Here is …

Member Avatar for tweak
0
168
Member Avatar for scru

Is there an open source (lgpl, bsd, mit) math parser/lexer library available out there? Has anybody ever written one by themselves (with support for variables, exponents, grouping) and have some tips/hints?

Member Avatar for scru
0
192
Member Avatar for Zaffron

Ok so I am attempting to make a program that downloads files from a site that are similarly named. For example, there is a site with files that are named blarg-0001, blarg-0002, blarg-0003, etc, until blarg-0020. Well the purpose of my code is to download those and everything inbetween but …

Member Avatar for Zaffron
0
105
Member Avatar for smerny

Hello, I'm trying to learn how to create a very simple class just to get the basics of OOP in python. I figure just to learn I'll start with a class where I can create an object and use a method to update a string associated with that object and …

Member Avatar for JasonHippy
0
156
Member Avatar for scrace89

I am new to python and programming this is my first time using the code (first assignment). I need help with writing a program to convert the code message entered by the user into ascii numbers, then find which number occurs 12% of the time, and have it represent the …

Member Avatar for willygstyle
0
277
Member Avatar for leegeorg07

Hi, I have this code: [code=python] import urllib2 as url import webbrowser def extract(text, sub1, sub2): """ extract a substring from text between first occurances of substrings sub1 and sub2 """ return text.split(sub1, 1)[-1].split(sub2, 1)[0] start="http://xkcd.com/" permlist=[] textlist=[] for i in range(1, 638): temp=start+str(i) permlist.append(str(url.urlopen(temp).readlines()[88])) textlist.append(str(url.urlopen(temp).readlines()[77])) for i in permlist: …

Member Avatar for ov3rcl0ck
0
204
Member Avatar for catcit

Hello! As the title suggests I need some help regarding an "open directory" dialog box. I tried this code but every time I run the module it appears a blank window in the back of the dialog box and normally after I select the directory it should disappear but it …

Member Avatar for vegaseat
0
24K
Member Avatar for htndrum

I'm having trouble getting this program to keep going through the lines in the first loop. It just prints out the output for the first (searchline) and stops. Can anyone help me to figure out why it won't keep reading the lines in the birthday file? [CODE] import string def …

Member Avatar for foosion
0
104
Member Avatar for jcmeyer

I need a back-end that can: -be used in python -handle multiple-users reading and writing to a database at the same time -can be accessed on a mapped share drive I have used sqlite but I have read that it is not recommended for multi-user use. I have looked into …

Member Avatar for ov3rcl0ck
0
234
Member Avatar for squareff255

I'm trying to write a python program that guesses a number that the user chooses between 1 and 1000 in no more than 10 guesses and I can not figure it out for my life! I know it's super beginner and there are a lot of problems, but please be …

Member Avatar for snippsat
0
89
Member Avatar for soulrider

Hi all, I'm fairly new to programming in Python, and I have been getting on pretty well. I had a little working program compiled from old code snippets I had found online, converted to working 3.x code and combined together with some of my own ideas to create simple apps. …

Member Avatar for vegaseat
0
281
Member Avatar for akie2741

How can i extact the personal address from html file.. After i get the source from the html file using read() method,what pattern should i consider if i wanna extact the address? Currently i think is use the compile() method to set the matching the address' pattern, but what rule …

Member Avatar for jice
0
138
Member Avatar for akie2741

My code is: [CODE] import re import urllib import urllib2 webURL="http://www.sc.iitb.ac.in/~bijnan/personal-details.htm" #the website is connect=urllib.urlopen(webURL) #connect to this website htmlDoc=connect.read()#get the html document from this website patternIN="Permanent Address" # Where to begin to keep the text patternOUT="</tr>" # Where to end to keep the text (after the begining) keepText=False # …

Member Avatar for vegaseat
0
157
Member Avatar for smerny

[CODE] for line in infile: if(line[len(line)-1:] = "\n"): line = line[:len(line)-1] output = "Searching for: " + line search.append([line,output])[/CODE] Giving me the error: [QUOTE] if(line[len(line)-1:] = "\n"): ^ SyntaxError: invalid syntax[/QUOTE] I'm basically trying to take each line of the file and I want to exclude the newline character at …

Member Avatar for vegaseat
0
163
Member Avatar for chico2009

Hi All I am working on the project detailed below and need some help please. The flow diagram is the best I could do, I'm afraid. I need some direction as to what function to use to undertake the pointing to various lines of text and also the instruction to …

Member Avatar for jice
0
161
Member Avatar for squareff255

Sorry guys! Last time I posted, I didn't know about code tags! I put them in. SO, I'm trying to write a python program that guesses a number that the user chooses between 1 and 1000 in no more than 10 guesses and I can not figure it out for …

Member Avatar for JasonHippy
0
155
Member Avatar for jtabak2

I am new-ish to python and need to write a short program which will take a file with many lines of sets of coordinates alongside a defined variable of a series of letters and out a 3 columned file with columns x, y, and letter. the input file has each …

Member Avatar for jice
0
155
Member Avatar for sysenm

Hi All! I am VERY NEW to Python and I am trying to make a program that can generate random words from a list of letters given to it. The command line can be: [I]program.py abcdefghi[/I] and then as a result the program will print all possible 9 letter words. …

Member Avatar for sysenm
0
100
Member Avatar for klabak85

Hi all, A question for you. I have these types of files at my work (.sj extension) that I need to work with and I'm wondering if there is a way to read from the file like a text file (the .sj files can be opened / read by notepad). …

Member Avatar for jlm699
0
129
Member Avatar for god0fgod

I've created a few functions to be used with pygame which are based on anti-aliased curves. At the moment and likely forever, it has two useful functions: aacircle(s,x,y,r,colour): Draws an anti-aliased circle on the surface s at the starting point x and y with the radius r. The circle will …

0
770
Member Avatar for erckle

Sorry guys...this is probably really trivial but i'm new to Python. How do you remove the first digit from a five digit number called x and then add this new number to the original x. I need to be able to remove any of the digits and add the new …

Member Avatar for leegeorg07
0
4K
Member Avatar for vextorspace

Hello, I am trying to compile a working opengl project into an executable for windows. I ran into several import issues in the python imaging library, Numeric, and OpenGL. I managed to resolve all but the OpenGL ones. There is quite a bit of conflicting info on the subject out …

Member Avatar for vextorspace
0
174
Member Avatar for patto78

Hi, The following code (BLOCK 1) is intended to simulate a television by creating it as an object, and is it stands I am pretty happy with it. Having created a volume control however, I then wanted to add a brightness and contrast control. My first attempt at doing this …

Member Avatar for Mathhax0r
0
69
Member Avatar for luiss

Hello all, I recently started using Python to test a Bluetooth Push application prototype and everything was working great until threading. I wonder if someone knows how to start multiple threads of connectpush() with Obexftp running under Linux? So far with the code below I have to wait until the …

0
166
Member Avatar for OneDreamCloser

hi all, i have a file that contains the following data (just a sample) : [code]501 0 0.932 0.933 0.931 0.931 0.929 0.933 0.93 0.928 501 1 0.974 0.98 0.978 0.976 0.974 0.974 501 2 0.953 0.949 0.944 0.951 0.942 0.942 0.942 0.948 501 3 0.933 0.934 0.934 0.935 0.931 …

Member Avatar for OneDreamCloser
0
160
Member Avatar for A_Dubbs

I am having a little trouble grasping this subject in my book. The book gives the program : [CODE]def main(): fname = raw_input("Enter filename: ") infile = open(fname, 'r') data = infile.read() print data main()[/CODE] "as a program that prints the contentsof a file to the screen using the read …

Member Avatar for vegaseat
0
72
Member Avatar for s.praneeth

Write a unit conversion program that asks the user to identify the unit from which they want to convert and the unit to which they want to convert. Legal units are inches, feet, miles, millimetres, centimetres, meters, and kilometres. Convert from? Inches Convert to? Millimetres Value? 10 10 in = …

Member Avatar for jlm699
0
338
Member Avatar for chico2009

Hi folks I have just completed my first programme with help from yourselves. I cant understand why the code , if x ==1 or 2, wouldn't work in my programme below [code=python] # Convert C to F or F to C and return with result select = True while select: …

Member Avatar for chico2009
0
185

The End.