15,175 Topics
| |
I have a serious problem with my game right now, after each kill I get the game starts lagging more and more. I thought it was because he was drawing the same thing twice and stuff and went trough some functions that was useless. But I cleaned it up as … | |
Hello how can i make a change calculator? for exmaple i want to buy an item thet cost 5.89$ and in canada no more 1 cents so how can round the number to 5.90? | |
Hello, Has anyone ever repeatedly wrote to the same text file, using the append mode, and when examining the text file, several lines were missing? Here are the specifics to my code: 1. Each line in the output, the text file, contains data from one experimental session (e.g. the session … | |
Hello , I wanted to ask if It is possible to create a Python programm that turnes on a server , with interfaces on users machines , connecting to a database ? Actualy , i'm asking about a better way to use databases with Python , thank you . | |
Please Help me to convert this python code to C# # avg_visits = [75, 30, 18, 17, 26, 40, 67, 82] mixes = [0]*50001 mixes[0] = 1 for n in avg_visits: for i in range(0,50001): if (i+n <= 50000): mixes[i+n] = mixes[i]+mixes[i+n] print mixes[500] print mixes[2000] print mixes[50000] | |
hi, I have the following dict which I want to write to a file in binary: data = {(7, 190, 0): {0: 0, 1: 101, 2: 7, 3: 0, 4: 0}, (7, 189, 0): {0: 10, 1: 132, 2: 17, 3: 20, 4: 40}} I went ahead to use the … | |
# This is an advanced guess the number game. import random # The very basis of this game. import math # Used for math.ceil import time # Used to split up long portions of text. def errorDisplay(errorCode): if errorCode == '1': print('\n\n\nError ' + errorCode + ': unlockedGameModes outside of … | |
This, of course, is not my code. It's from my object oriented programming course book. During class I ran the program and it worked a good 75% of the time without making any changes. For some reason, when I run it at home(either on python 2 or python 3) it … | |
Okey so I need help with how to make a health bar that starts out full with green color but then when I lose hp it get's smaller and smaller. I have now that my hp is 100, and then when I get hit by a bullet from the boss … | |
Hi, I have a simple editor with wx.textCtrl MULTILINE as my editing area. Nothing fancy, except I can't do a "PrintPreview" or a "Print". On the preview it shows a blank screen and the Print prints out a blank piece of paper. The "text" appears on my editor and a … | |
Using latest versions of Python (2.7) and wxPython(2.8) I get the folowing error when I "PreviewText" using "HTMLEasyPrinting". In the __init__ I have tried "parentWindow=None", "parentWindow=frame", etc. No Luck. Does anyone have a workaround for this annoying problem. (It is documented elsewhere => "FRAME_FLOAT_ON_PARENT") RR C:\K>Print_Dialog.py Traceback (most recent call … | |
Could anyone help me in understanding what does below Python code do? Also please help me in converting it into Java. import random howMany = random.randint(0,1000) stats = {} for i in range(howMany): value = random.randint(0,500) stats.setdefault(value,0) stats[value]+=1 for item in stats: if stats[item] > 1: print item | |
I have a method that does not return anything , but it makes a call to another method that returns a value like def apply(): #set some defaults try: script = _getScript() except Exception, ex: raise Exception(ex) node = [xyz for xyz in myLst] # myLst is a global list … | |
Im making a 2D platformer-ish shooter its really simple and not much effort put in it, it is my first game Im making in python and its for a school project and needs to be finnised really soon. Everything is working just fine but Im having problem with some collision … | |
I am using django1.3.7 for developing a web application.How to display a datepicker using jquery.I am having jquery datepicker which is working fine with html.The only requirement is i am using model form,so how to render the datepicker is my question.Kindly help me in this problem. Thanks | |
Ich habe hier folgendes Teilstück, wo Daten aus einer Sonde empfangen werden: for i in range(12): err,data=dev.GetData() print data f.write(data) Wenn cih das ausführe bekomme ich die Fehlermedung: expected a character buffer object | |
Hi to all, I'm looking for a solution to create a front-end in python for an app. I've some experience with Tk (but it's not fundamental i would like to use wxpython) and standard widget, but now i'm in a project too complicated for me. The app is like a … | |
Hi I'm new to Python and have the following problem. I have a excel file (csv format) that I want to open and display as a 2d list. I can read the file but can not get anyother output other than the colum headings as a single letter [h][e][a][d][i][n][g] I … | |
Here is a short Python program using the module pygame that lets you play a midi music file. Midi files are instrumental music files that pack a lot of good sound into a small file. They are very popular with web page designers. | |
I want to print the time in one of my program's but the time is an hour wrong, this is what i'm using. from time import gmtime, strftime strftime("%Y-%m-%d %H:%M:%S", gmtime()) it gives '2013-05-06 09:06:25 ' where the current time is 10:06:25. | |
Hello, I am creating a GUI program with PyQt4 in python. The purpose is to be an efficiency tool for my company. I have a GUI, but put all the code in one thread. I have not dealt with threads yet and after 2 weeks of reading up, I still … | |
I am very new to python. I am making a program to see if certain part of current line is same as that of next line for example perter's age is 16 john's age is 16 Craig's age is 18 I want to see if people's ages are the same … | |
Hi Any one know how can I install pyHook module?I get just error Im using python 2.7.3 >>> import pyHook Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import pyHook ImportError: No module named pyHook C:\Users\bt\Desktop\pyHook-1.5.1\pyHook-1.5.1>python setup.py install running install running build running build_py running build_ext building … | |
I am trying to install pyHook 1.5.1 for my windows 7 64 bit operating which has python 2.7 installed , but i get this error " python not found in registry" , when i try to type the python path,it does not allow me type into the modal gui ,please … | |
A somewhat newer look at Peter Parente's pywin32 based speech engine. It will read text on your computer. | |
It seems like a simple problem but I can't seem to find the solution. Basically I have a wx.TextCtrl on a wx.ScrolledWindow and I want to expand the TextCtrl to fill the window - a simple editor if you will. I have the "Proportion" as "1" and I've used a … | |
I was trying to come up with a dictionary of functions, but get it not to work. | |
Hi. I have a Foo class that stored a dictionary attribute called _data. I'd like the Foo class to have a dictionary interface, and defer most basic dictionary operations down to the _data attribute. I am currently overwriting the magic methods one by one: def __getitem__(self, item): return self._data[item] def … | |
I am currently working on a translator which translates one document from English to German, I had created it as a GUI application using Tkinter and python 2.7, Here I am facing some problems like 1. Assume that if a person uploads a document 'samp.txt' in the using the upload … | |
Hi there. I am fairly new with python and programming altogether. I'm having a problem dividing elements of two lists, and appending the results to a new list. The problem is, the second list may contain a zero, and obviously we can't divide by zero. If it happens that we … |
The End.