15,175 Topics

Member Avatar for
Member Avatar for Potty391

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 …

Member Avatar for woooee
0
98
Member Avatar for JA5ONS

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 …

Member Avatar for Ene Uran
0
44
Member Avatar for dinilkarun

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?

Member Avatar for woooee
0
103
Member Avatar for lllllIllIlllI

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 …

0
48
Member Avatar for Mackjan

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 …

Member Avatar for Mackjan
0
82
Member Avatar for FreezeBlink

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 …

Member Avatar for jrcagle
0
115
Member Avatar for sarabhjeet

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 …

Member Avatar for sarabhjeet
0
85
Member Avatar for msaenz

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 …

Member Avatar for jrcagle
0
2K
Member Avatar for bf2loser

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 …

Member Avatar for jrcagle
0
1K
Member Avatar for mruane

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 …

Member Avatar for slate
0
297
Member Avatar for turnerca902

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 …

Member Avatar for woooee
0
153
Member Avatar for clouddragon

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 …

Member Avatar for vegaseat
0
166
Member Avatar for joshuabraham

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() …

Member Avatar for joshuabraham
0
175
Member Avatar for ccandillo

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 …

Member Avatar for woooee
0
1K
Member Avatar for jimbox123

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

Member Avatar for vegaseat
0
1K
Member Avatar for dinilkarun
Member Avatar for Ene Uran
0
111
Member Avatar for s_jmp

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?

Member Avatar for a1eio
0
64
Member Avatar for gReaen

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.

Member Avatar for Ene Uran
0
51
Member Avatar for FreezeBlink

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

Member Avatar for Ene Uran
0
260
Member Avatar for i_saw_some

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

Member Avatar for Ene Uran
0
113
Member Avatar for budstar

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 …

Member Avatar for bumsfeld
0
96
Member Avatar for Azurea

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 …

Member Avatar for Azurea
0
106
Member Avatar for stabler_rocks

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 …

Member Avatar for woooee
0
95
Member Avatar for lllllIllIlllI

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 = [] …

Member Avatar for lllllIllIlllI
0
177
Member Avatar for ABSOR

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 …

Member Avatar for ABSOR
0
90
Member Avatar for dangermini

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 …

Member Avatar for dangermini
0
140
Member Avatar for saywell

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 …

Member Avatar for saywell
0
78
Member Avatar for Mackjan

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", …

Member Avatar for Mackjan
0
147
Member Avatar for ivy47469

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

Member Avatar for BearofNH
0
138
Member Avatar for donnerCobra

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

0
63

The End.