15,175 Topics
| |
Hi everyone, I just started working with Python and programming in general (i chose it as a school subject for this year) and i received a task(scroll a bit more down).. since im a total newbie with Python in general.. i was hoping someone could please explain this task in … | |
well, after the help i have had already tonight, i thought i might come ask another issue i am having with saving the file with the .txt extention. i can save each file as the car model first name for each entry, however it wont put the .txt extention on … | |
listText=["Car","Bike"] for intkLoopIndex in range(0,2) f.write(str(listText[intkLoopIndex])+ '\n') i am using the above code to write a string onto a document. How can i display the text in [B]bold [/B]in the document? Can i set the font property when i write? | |
Hi I was wondering if there was any way i could use a module or some code to enable and disable my wireless network becuase i often have the problem that it wont connect and enabling and disabling it a number of times nearly always fixes it and i was … | |
This function arranges a list of number. If we try z= [4, 4, 2 ] the result will be after some steps 4,3,2,1 but my list is z = [ 1, 1] and I want if a cycle of number coming up again and again the main program will discover … | |
Iterating over a list, possibly deleting elements. It's the bane of my existence. Suppose, for instance, we have a list of numbers, and want to iterate over it and delete each and every odd one. Sounds simple, right? Sorta. It's trivial, but the code you end up with is pretty … | |
Hi All, first of all thanks to all for helping me out till now, whenever i got stucked somewhere that time u all helped me out.I need some more help of u all.I am using python 2.5 along with wxpython,and i need to increase the visibility of the dialogs and … | |
Greetings, I am trying to do a reconnect type of thing for when sqlserver disconnects me i check and reconnect to execute a query. here is some code that i wrote, I really don't know what to use since there is not isconnected method or reconnect method in pymssql. Any … | |
can someone show me some code to convert rankine temperature to kelvin? rankine is in the same scale as fahrenheit, but it starts at absolute zero. so 0R = -459.67F, heres is what I have convert to kelvin [code=python] def __init__(self, value=0): Fah=value-459.69 Cel=(Fah-32)*5/9.0 value=Cel-273.15 Temperature.__init__(self, value) [/code] convert back … | |
I am not sure how to word this question. If I am defining function() to be a user input prompt, does the [code] name_of_prompt = raw_input("") [/code] name of prompt equal the name of fucntion or could it be prompt_funct1? If so, when using if...elif statements to call on other … | |
Hi all, I have a little project that I think would be possible to accomplish using python. I'm a beginner at this sort of thing, so I am posting the basic information in the hopes that someone out there could help me get started or point me in the right … | |
hello, I have to write a program that draws a chart from dictionary entries. I am able to make a draw a chart however it is unsorted. How can i get it sorted. Please help asap. THANKS in advance. [CODE]from random import shuffle from graphics import * def main(n): win … | |
os version =windows xp hi guys i'm having problems using pygame the following code just does not seem to work. Code: ( text ) 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() … | |
I am still reading the learing python o'reilly book and not sure the best way to approch my problem. Given c:\dir1\dir2\dir3. I want to zip all files in dir3 if those files are older than 30 days using 1 zip file (ie. dir_3_files.zip). If all files in dir3 are older … | |
hey everybody I'm taking a computer class right now and one of the projects I need to do is create a very simple pizza-ordering menu. At this pizzeria, there is only one kind of pizza you can order: regular (cheese) with no toppings. Your choices are what size of pizza, … | |
I would like to convert word document .doc tp acrobat .pdf using Python. Please help. | |
hi pythoners, i have problem in understanding bind method of socket module i have read many articles and even pythons help and docs but i couldnt feel what it really is so anyone can help me please? | |
Hello, I wanted to know if Python can be bundled with any C++ project so that it can be installed when the executable of the project is run. I use Python 2.4 and PyXML-0.8.4 on Windows XP SP2. | |
Just noticed an odd little problem. Instead of explaining it, take a look at this IDLE run: [code]>>> ================================ RESTART ================================ >>> class test: eggs = True >>> var1 = test() >>> var2 = "text" >>> type(var2) <type 'str'> >>> type(var2) == str True >>> type(var1) <type 'instance'> >>> type(var1) … | |
Hey, Does anyone know how to pickle classes that have classes within them? I get back the top level attributes, but not the attributes under them. For instance: [code] import pickle class authorObj(): class authors(): pass q = authorObj() q.authors.name = 'somebody' output = open('test.pkl', 'wb') pickle.dump(q, output) output.close() [/code] … | |
Can someone please tell me what I am doing wrong with this loop. I want to end the loop when either one of the tanks armour reaches zero. Also if I wanted to add more tanks how can I have the loop end? Thanks import random class Tank (object): def … | |
Hey, this time I'm back with a threading error! I need to write code that gets the address of a message sender while at the same time letting the user know that the pygame didn't freeze, so I started a thread to keep control of the screen while searching for … | |
Okay i'm probably majorly over thinking this but i need to create a counter that counts how many weeks a certain value gets exceeded, except i honestly don't know how to do it. I thought of find the end max value and taking it away from the first max value … | |
Hi I have been working on a blackjack program and i have hit a brick wall as one of my Global assignments isn't working for some reason [code] import random class Cards(object): def __init__(self): global cards global player global comp global comp_tot global playert cards = {2:4,3:4,4:4,5:4,6:4,7:4,8:4,9:4,10:16,'ace':4} player = [] … | |
I just downloaded and installed ActivePython on my windows PC (XP). I can bring up the editor and can write very beginner lines of code in the editor and save and run the program. However, when I create any function the interpreter says there is an error, no matter how … | |
Hey I'm just trying to develp some code for some coursework i've got to do. I am wondering is it easier for me to write the code for what I want to do and then integrate the PyQt GUI after I've written the code, or is it best practice to … | |
| Can anyone help me with a python script I'm writing to change a password in a batch file. I need to replace the old password with the new one. I can do this by getting the old password from the user by raw.input, but I'd really like to just replace … |
I have a function when I use it outside the class as a function it works perfectly but when I want to use I as a method in a class I get a TypeError massage : [COLOR="Red"]Traceback (most recent call last): File "H:\python\prototyp_01.py", line 122, in <module> manupacians.koor(z) File "H:\python\prototyp_01.py", … | |
I am working on the odd number magic square problems. I start the first number in the last row and center column. It worked on the 3x3 square, but not on any other odd numbers. Can anybody check my code? [code] def magic(n): if n > 2 and n % … | |
Hi, I wanted to ask if you can help me with my example-sourecode to Wrap an C++ Object. I know Boost, but I don't want to use it cause of several points. Does someone knows an example code for an Object Wrapper? Thanks A LOT!!! [code=c] #include <Python/Python.h> #include <string.h> … |
The End.