15,181 Topics

Member Avatar for
Member Avatar for Miyuki

I want to let users select a line of text by triple-clicking anywhere on that line. How can I use the API to support the feature?

Member Avatar for Scuppery
0
60
Member Avatar for joshuabraham

hi guys,when i run my program which contains the following portion of code in the mainloop Code: ( text ) [CODE] 1. clock=pygame.time.Clock() 2. while True: 3. sound1.play() 4. clock.tick(60) 5. pKeys = pygame.key.get_pressed() 6. Eves=pygame.event.get() 7. villian.face() 8. villian.hert() 9. if Eves[KEYDOWN] and pKeys[K_UP]: 10. hero.moveup() 11. if Eves[KEYUP] …

Member Avatar for jlm699
0
155
Member Avatar for programmingnoob

Expected Output Your goal is to be able to create a python script like example.py that will: 1. Read input.bin byte by byte 2. Convert the value of each byte in input.bin into a string 3. Save the output into a file output.txt For example, given an input.bin that contains …

Member Avatar for jlm699
0
113
Member Avatar for tweak

I started this hangman game as a suggestion for beginners but now I am stuck. The code runs with out any errors but I need some way to put a certain amount of turns that the user can have but I am not sure how I could add this to …

Member Avatar for tweak
0
99
Member Avatar for tzushky

Hello hello, I am writing to you because I am having trouble obtaining something: I know it should be doable, but can't seem to make an example. I need to be able to run scripts from another central script. And as i' ve been reading, apparently they mustn't be imported …

Member Avatar for woooee
0
85
Member Avatar for pravdexter

I am using python 2.2 and want to make use of the library PyUsb. I tried a lot but couldn't get it right. Can anyone please help how to do that.

Member Avatar for pravdexter
0
168
Member Avatar for Scuppery

Hey there everyone I need a little help. Right now I am in the process of writing a program that uses subscripts and superscript but I dont have a clue how to get them. I am not even sure if they can be used in python so if any of …

Member Avatar for jrcagle
0
5K
Member Avatar for ymf

Hi, I have a code that creates a class 'Person' : [ICODE] class Person: def __init__(self, fname, lname): self._fname = fname self._lname = lname def fname(self): return self._fname def set_fname(self, fname): self._fname = fname def lname(self): return self._lname def set_lname(self, lname): self._lname = lname def name(self): return self._fname + ' …

Member Avatar for jrcagle
0
145
Member Avatar for adarshvp

Hello All, Currently, I have a static setup between Server and Clients. Server IP is hardcoded into the configuration file, so that clients connect to the server using this configuration file. In our network there are many server machines that can serve these clients and balance the load. I am …

Member Avatar for jrcagle
0
9K
Member Avatar for leegeorg07

im quite new to python and have made a few programs to help me in school but i dont know how to compile them. i have found a tutorial and have copied the code correctly but python says that the 'import' syntax is incorrect. this is the code: [ICODE]from distutils.core …

Member Avatar for jlm699
0
102
Member Avatar for VelcroMan

Any way to get info about the battery in a laptop? Like how many % is left, and for how long that will last?

Member Avatar for VelcroMan
0
76
Member Avatar for leegeorg07

i started learning python about a week ago. and have a understanding of essential python, i want to try design a visual game do you think i should start now or learn more if learn more what do you think i should learn and where could i learn it?

Member Avatar for jrcagle
0
75
Member Avatar for cheesedoodle

I started trying to teach myself how to program in python just a few days ago. I have been using a wikibook for non programmers and it has this piece of code as an example. I CAN NOT for the life of me figure out why it outputs the value …

Member Avatar for vegaseat
0
130
Member Avatar for TheOneElectroni

Hi everyone, I have a problem to insert text into a text widget in Tkinter. I want to be able that each time some text is inserted (by means of an action -not directly by the user-) that text is displayed into a new line. However I can't figure out …

Member Avatar for TheOneElectroni
0
4K
Member Avatar for kasunc

hello pals, I need a help with using re module to search and convert uppercase words in a string to title case Eg: [code] mystr='Hello everybody. Some times THERE ARE upper case words' #Results should be 'Hello everybody. Some times There Are upper case words' [/code] Hope you can give …

Member Avatar for kasunc
0
272
Member Avatar for docaholic

Hi, I have a question about lists and tables... So far, i've managed to take a list and make a table like so: 23 764 12 54 83 2 543 890 1235 453 98 the list being [23, 764, 12, 54, 83, 2, 543, 890, 1235, 453, 98]. i need …

Member Avatar for woooee
0
83
Member Avatar for ratperson

I am programming for the first time...trying to make a game in pygame. I need to know how to design a really good background. All I can do at the moment is draw lines and change the background colour. Please help!! I am making this for my boss and I …

Member Avatar for ratperson
0
78
Member Avatar for Mazille

Hi I'm a python beginner! I'm trying to make a list of 3 numbers per line but I get an error. =( Here's my code: [CODE=python]list2 = [23, 764, 12, 54, 83, 2, 543, 890, 1235, 453, 98] k = 0 while list2[k] != -1: first = str(list2[k]) k = …

Member Avatar for Mazille
0
1K
Member Avatar for aot

Can python programs with GUIs (such as Tkinter) be embedded into web pages? I have looked into CGI programming before, but despite a search, I have found no books relating how to do this with python. Is it possible? Can anyone recommend a good book? If not, what would you …

Member Avatar for Jon Pierce
0
180
Member Avatar for Shadow14l

I am using this function to download files: [code=python]def download(url): urllib.urlretrieve(url, url.split("/")[-1])[/code] I am downloading files from a site, but I don't know the EXACT filename... All I know is the id for them... Example: download("http://site.com/files/489411/") When i am to do that, it automatically resolves the appropriate filename and it …

0
82
Member Avatar for arkane

Hello I have written code using python and C extensions which performs object detection on 3D data sets. The code was originally developed under Linux and has since been used under Windows XP where I continuously get MemoryError crashes when assembling a list of 78566400 integers. There is nothing wrong …

0
44
Member Avatar for muddpigeon

ok i know i have posted the same request before but i am still completley stuck with where to go from what i have got so far. the program i have to do is basically a very simple atm program. the user has to enter a pin number between 1000 …

Member Avatar for teddies
0
225
Member Avatar for dinilkarun

data='115Z2113-3-777-55789ABC7777' I have a string in the above format. I want to remove 'ABC7777' from it. If there are any characters other then numbers after the right most '-' symbol, then only the string preceeding it should be retained.i.e., '115Z2113-3-777-55789ABC7777' should be stored in data. 'ABC7777' should be stripped off. …

Member Avatar for woooee
0
414
Member Avatar for brianez21

Hi all, I am writing a multi-threaded application in Python. On the client, there are 2 threads, a GUI thread that contains PyGTK functions, and a networking thread, which contains the listener loop below. The problem is this - If the server sends the client a large amount of commands …

0
42
Member Avatar for ub007

Hi, Absolute newbie to python,infact just started learning it from yesterday.... I have installed Apache2,mysql,php and an ecomm software(osCommerce) on to my ubuntu machine. I downloaded a tool -funkload based purely in python,installed it by easy_install method,searched for the egg file in site-packages and could run the demos. I have …

Member Avatar for AceofSpades19
0
96
Member Avatar for Luckychap

Hi python guys, I just started to dig in Python. I am new to this. I came close to Python when I got a project to be done with Django. I got stuck when I was fetching data from database(mysql). the data was fetched in variable 'rows' which have Id, …

Member Avatar for Luckychap
0
143
Member Avatar for linip

hello everbody, can someone please help me, how do i turn a list like a=[0,1,2,3,4] into 01234 i tried for i in range (len(a)) print a[i], but thats give me 0 1 2 3 4 thanks, fabio

Member Avatar for bvdet
0
73
Member Avatar for megazear7

Is it posible to delay the program for a certain time period. I know in blitz basic you could type "delay 5" and at that spot in to the program theere would be a 5 second delay when you run it. Can you do that in Python???

Member Avatar for mengqing
0
469
Member Avatar for k.wiseman

I'm still grappling with the concept of passing parameters and returning responses. See code below: [CODE]#Measurement Converter # Converts Common Chinese Units of Measurements (Practicing function return) # Convert "cun" to "inches" def cun_to_inches(cuntoinchesQ): cuntoinchesUR = None while cuntoinchesUR == None: cuntoinchesUR = float(raw_input(cuntoinchesQ)) cuntoinchesUR *= 1.31 return cuntoinchesUR # …

Member Avatar for k.wiseman
0
120
Member Avatar for LaurenceB

Hi, I have written a program in python, and am looking to translate it into c++ code, here is the program: import random # You've got to guess 4 numbers between 0 and 30, if you get it right the program will output "WINNER" and tell you the computer's numbers …

Member Avatar for hacker9801
0
174

The End.