15,190 Topics
![]() | |
I was wondering if you could add new fonts to pygame and how you should do it. Does any one know how to do it? | |
Hey, I'm beginning to write a MIDI-sequencer/sampler kind of application (ie: LMMS, FL Studio, RoseGarden) that relied solely on ALSA. Not JACK. However, if I distribute the application, I wouldn't want a huge application due to uncompressed WAV samples in the piano roll (this would be a pseudo-synth). So does … | |
Greetings, I have this date string that is given to me from somelses code 20080326 and I want to convert it to be MMddYYYY and I get this error: Caught Exception: ValueError:time data did not match format: data=20080326 fmt=%m%d%Y File "/home/gateway/scripts/python/py-allston.egg/main_template.py", line 91, in decorated_main File "db.py", line 24, in … | |
I'm trying to make something that once it is disconnected will automatically try to reconnect. I'll add some more features in later so it doesn't hammer the server but right now I just want to keep it simple and get that part working. The problem is that when I use … | |
Okay, so I am creating a password storage system. I have everything but a few last functions. I need to be able to search for different sites and view all sites in a choicebox. for editting. I've tried a few different things but I just can't get it. the first … | |
I am undergoing a school project, which is a projectile calculator and graphing. Now I do not want any code or tips or anything as I think I am going well however one issue I am unable to resolve is how to generate a graph. I have spent an hour … | |
Bonjour, Dans la communication serveur client que je traite je veux faire de telle sorte que lorsque le client envoye une commande le serveur lui envoie la réponse appropriée. Les commandes et les réponses appropriées seront stockées dans un fichier .txt. Au démarage du serveur, il doit stocker les données … | |
Hi friends, I have written a function which inverts a dictionary. The code is as follows: [code=python] def histogram(s): d={} for c in s: #print c, d.get(c,0) d[c]=d.get(c,0)+1 return d def invert_dict(d): inv={} for key in d: val=d[key] if val not in inv: inv[val]=[key] else : inv[val].append(key) return inv hist=histogram('parrot') … | |
On the risk of sounding extremely stupid, Does anyone know how to print a string representation of an exception. i.e. just the type of error? I have code that catches all errors and would like to then print the type of error as a string. My code is: [CODE=perl]def catchException(): … | |
Howdy, hoping I can get alittle help today. First off I have a real bad habit of learning one thing, and getting very fascinated by it and going off on a tangent using what i learned in as many ways as I can think of. Im a very new person … | |
Hi Guys, Im having trouble with my prog.. basically i have a file with lots of details in it. I want to find every time the file says for example "blah" Than i want to find the next occurence of "notblah" and i want to use the information between these … | |
Hi friends, I am trying to write a histogram function in Python. This is what I have managed so far: [code=Python] def histogram(s): d={} for c in s: if c not in d: d[c]=1 else: d[c]+=1 return d h=histogram('brontosaurus') print h [/code] However, I want to use the get() function … | |
Howdy, Im a beginner to programing and Ive chosen python as my first language to learn. I have recently completed my first "non-tutorial" code. I wrote a book modeled after the old "Choose Your Own Adventure" books. When ran it asks for your name, and puts you into the story, … | |
Greetings once more. I have been working on a script to convert a user provided number in basetwo and convert it to baseten. What I've got so far: [code=python] myinput = raw_input("Enter a binary real number: ") (myint, myfrac) = myinput.split(".") x = int(myint[0]) y = 0 t = len(myint) … | |
I have a question about reading array from file. I wrote some array at file like below. file name: xy0.dat [2, 4, 6] [4, 8, 12] ... ... Now, I want to read this array(not string) at my original file. I want to define x0[0] = [2,4,6] and x0[1] = … | |
I'd like to be able to make a slider widget without the knob that users can click and drag -- that is, I want the user to simply click somewhere on an empty slider and *then* have the knob appear where clicked. Is this possible with either Tkinter or wxPython? … | |
I need to convert .docx files to .doc (on Linux and Windows). I'm planning to use the zip mod to access all of the internal XML documents. Then I'll the /word/document.xml and I need to parse it so that it will read all of the text in the tags, place … | |
Hello, I want to add the 'did you mean' feature (like on Google) on my shareware site, where a lot of users have mistypes, and they get 0 results... so they exit the site very fast. Do you have any idea how I could implement such a thing? Does it … | |
I am having a problem reading a date format in a file I am trying to count the difference between two dates. the format I have is 010108. I tried to break up the date mmddyy but have run into other errors. [CODE=python]import datetime as dt # US format month/day/year … | |
Hi, The following works. import maya.cmds as cmds def importImage( fileName, fileType): cmds.file( fileName, i=True ); return 1 cmds.fileBrowserDialog( m=0, fc='python("importImage")', ft='image', an='Import_Image', om='Import' ) However in the following situation it does not work. The error is ================================================== ==== Cannot find procedure "importImage". Start of trace: (command window: line 1). … | |
I'm currently writing a set of small scripts for a web page. I've retrieved the GET variables using cgi.parse_qs and the query string, but can't figure out how to access the POST variables. I know you can use FieldStorage to access both GET and POST variables, but would like to … | |
Hi, I'm writing in python for s60 (nokia cell.) and working with Canvas and Image, while i'm moving through the image using: [CODE]canvas.blit(image, source=((sourceLocX, self.sourceLocY), (sourceLocX+ canvas.size[0], sourceLocY+self.canvas.size[1])))[/CODE] i can't seems to zoom in/out, I looked into Image and Canvas documentation and still don't understand how to do that... anyone … | |
I am very new to programming in general, and of course, it follows: to Python. Yet, I am in desperate need of a particular database program, and I am attempting to write it via objects, since I need to learn the ways of OOP anyway. I am currently trying to … | |
Hi All, I am writing a little program that i should be able to get working i think! basically i have this file full of content and i want to search it for a list of words. And add to a score variable each time i find a word [CODE] … | |
my Python program retrieves an html doc containing a link that looks like: [href="" onclick="return somefunc('someid')"] where somefunc is embedded in the html doc downloaded How can my program "click" in such link and get the new html doc.? Tx | |
when I wont to inser (anyting I print) to the textbox it will not inser it just print then hanging [CODE]# a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, # ctrl+v to paste, and ctrl+/ to select all # count words … | |
I am very new to both programming and Pyhton and while trying to do some practice using A byte of python an Error pops up on the IDLE shell. I am using windows XP. PLease see below. [code=python]number = 30 guess == int(raw_input("enter an integer:")) if guess == number: print … | |
Here they are -= and +=. What do they mean? | |
During my quest to learn pygame I came across a tutorial that was really helping me through. However I came across a piece of code that has confused me. Being that this tutorial has a very vague explanation on each of the snippets, I need someone to explain this to … | |
I was wondering if it's possible to show videos via a python GUI -- preferably quicktime videos, but any format would be a start. If it's not possible to play them from within the GUI, is it possible to at least have the person press a button that will automatically … |
The End.