15,181 Topics
| |
when are we supposed to use StubOutWithMock() ? | |
I need to convert python code to javascript. do anyone here know javascript? please give your mail id i will sent the python code to your mail! thanks in advance :) | |
I want to learn about `def` because that looks very the most intriguing how you can make it kind of like reusable but when I was learning I had come some problems with understanding def main(): #renewable code main() if __name__ == "__main__": main() I don't understand what `__name__` and … | |
Hi I downloaded keyboard event and its work very fine. Its capture all keystroke and print it. My question is how can we do it to save to file (for example C: \log.txt) instead to print out . To write out f=open('c:\log.txt','w') but where can I put it :)? import … | |
I have a qucik question for you guys. Is there a way to change the taskbar icon? Im done with my game and im gonna show it in class on tuesday 14 and I just thought it would be cool to have an icon that represents the game and not … | |
Here I am using askopenfile to upload a (text)file, I also wanted to display the file name next to the upload button and then I want to read its contents and convert it to another language. Say for example if the document is in English I want to convert it … | |
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 … |
The End.