15,181 Topics

Member Avatar for
Member Avatar for krystosan
Member Avatar for siss

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 :)

Member Avatar for TrustyTony
0
172
Member Avatar for nouth

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 …

Member Avatar for nouth
0
504
Member Avatar for tony75

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 …

Member Avatar for tony75
0
779
Member Avatar for Necrozze

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 …

0
173
Member Avatar for Varunkrishna

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 …

Member Avatar for woooee
0
2K
Member Avatar for Necrozze

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 …

Member Avatar for Necrozze
0
1K
Member Avatar for vadimak

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?

Member Avatar for vadimak
0
431
Member Avatar for Social_psych

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 …

Member Avatar for Social_psych
0
219
Member Avatar for Ismatus3

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 .

Member Avatar for Ismatus3
0
233
Member Avatar for tengmat

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]

Member Avatar for Lucaci Andrew
0
1K
Member Avatar for ggsr45

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 …

Member Avatar for ggsr45
0
366
Member Avatar for Aethir

# 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 …

Member Avatar for Aethir
0
279
Member Avatar for dp121307

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 …

Member Avatar for dp121307
0
526
Member Avatar for Necrozze

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 …

Member Avatar for Necrozze
0
1K
Member Avatar for robinlrandall

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 …

Member Avatar for robinlrandall
0
2K
Member Avatar for robinlrandall

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 …

Member Avatar for robinlrandall
0
359
Member Avatar for aadarsh_khare

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

Member Avatar for JasonHippy
-1
273
Member Avatar for krystosan

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 …

Member Avatar for krystosan
0
3K
Member Avatar for Necrozze

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 …

Member Avatar for Lucaci Andrew
0
559
Member Avatar for Sivaram R

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

Member Avatar for Sivaram R
0
262
Member Avatar for manja.her

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

Member Avatar for TrustyTony
0
180
Member Avatar for gbonline

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 …

Member Avatar for slate
0
264
Member Avatar for goatroxley

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 …

Member Avatar for rrashkin
0
359
Member Avatar for vegaseat

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.

Member Avatar for diliupgabadamudalige
0
5K
Member Avatar for aVar++

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.

Member Avatar for Schol-R-LEA
0
244
Member Avatar for mad5245

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 …

Member Avatar for mad5245
0
955
Member Avatar for ytbyun

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 …

Member Avatar for snippsat
0
202
Member Avatar for tony75

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 …

Member Avatar for tony75
0
11K
Member Avatar for zaphoenix

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 …

Member Avatar for tony75
0
3K

The End.