15,181 Topics

Member Avatar for
Member Avatar for jessica2009

[code=python]def main(): print (" PC : Hi there.whats your name?") userit = raw_input (" user :") print (" Pc : Nice to meet you " ) , userit , userit = raw_input(" Do you like python? (A=Its Great, B=Its Ok, C=Its Rotten)") if userit == A: userit = userit.upper() print …

Member Avatar for vegaseat
0
119
Member Avatar for jessica2009

python program to engage a user in conversation.requirements are a. firts question should ask the user for name .this name should then be used with the following questions b.Ask 4 more questions c. Each question should have 3 possible answers.That us option A,B or C(only) d. Have a different comment …

Member Avatar for jessica2009
0
99
Member Avatar for harrykokil

how can threading in python help me in my traffic simulation project? can i use it to detect other cars?

Member Avatar for scru
0
65
Member Avatar for lilkid

[ATTACH]9572[/ATTACH] Hello basically ive parsed a website's data into an object. I wrote it to file and read it back in to write to a dictionary. but when i read it in it reads it like 3 times. so im a bit confused as to why ad would like to …

Member Avatar for lilkid
0
125
Member Avatar for loren41

[B]I have a text file that contains multiple records. Within the records, I am able to locate the line containing the desired text and read it into a string. Inside the line, I know the number of the starting character for the words I need. The length of the substring …

Member Avatar for sneekula
0
255
Member Avatar for Darkangelchick

Hey guys I have to create a python version of Tic Tac Toe, but does anyone know if it's possible to make this using Tkinter? I think I have to have it nice and bright and colourful, therefore TKinter is the only solution i can think of using Python. Any …

Member Avatar for woooee
0
632
Member Avatar for mannclay

Hello, I am trying to make a desktop icon for a newbie script I wrote while Teaching myself Python. I wanted it to be a clickable desktop icon for OS X. Plus, I guess I can use Icon Composer to make it a pic. Any ideas?! Thanks...

Member Avatar for mannclay
0
80
Member Avatar for leegeorg07

hello, i just started a paper round and ive started doing what i do best : obsessing about it and i want to know if there is any way that i can open and close images of the different newspapers to learn them? i would prefer to do this with …

Member Avatar for leegeorg07
0
280
Member Avatar for andy121

There is a html page that has a form on it, with a text field named "text". When you enter text into that that field and submit it, it goes back to the python server, gets processed, and a new html page is sent out in response. I'm working with …

Member Avatar for alc6379
0
148
Member Avatar for schuerm

Hi I am desperately trying to get the text from a chat window. My idea was to use win32gui.GetWindowText(). I wrote a program to display any text with win32gui.GetWindowText() by iterating over all past and previous handles and as deep into each handle as there are children. Basically I tried …

Member Avatar for jworld2
0
368
Member Avatar for daniwebnewbie

I'm writing an application that needs to store a ton of objects and some attributes. I was wondering, based on python's inner workings, if it's more memory efficient to have one huge dictionary or many small dictionaries and then one dictionary that just references the smaller dictionaries? Any information would …

Member Avatar for paddy3118
0
255
Member Avatar for jascase901

Hello python is my first language, and i have read 1 book on it and gone through a tutorial, but i still don't feel like i have a firm grasp on python. I hear the best way to master a programing language is to actually program. So i want to …

Member Avatar for lllllIllIlllI
0
154
Member Avatar for docaholic

[ICODE]def selsort(l): if len(l)<=1: return l else: for i in range(len(l)): selsort(l[1:]) [/ICODE] Hey guys, this is what I have so far. I have trouble understanding recursion. Anyone know how to use it to do selection sort?

Member Avatar for Dhaneshnm
0
265
Member Avatar for FengG

I tried really hard on this one, finally came up with this, however, there's space between every number in my result because of the code 'print xxx,' , I want to find a way to delete those spaces. Program: let user enter say 555-GET-FOOD, convert it to 555-438-3663 [CODE]alph = …

Member Avatar for FengG
0
6K
Member Avatar for shailev

hi! i want to write a ftp server. i started writing: [CODE] from socket import * server= socket(AF_INET, SOCK_STREAM) server.bind(("0.0.0.0", 21)) server.listen(5) while(1): (client_s,client_addr)=server.accept() command=client_s.recv(1000) print command client_s.close() [/CODE] i run it and wrote in the internet explorer: [url]ftp://localhost[/url] but nothing happen.. it doesnt print the recieved command. what can …

Member Avatar for Gribouillis
0
55
Member Avatar for daniwebnewbie

Hi. I just started python programming tonight and am trying to use good practices such as list comprehensions etc. However, I'm trying to get a list of all files in a directory (and subdirectories) and only add the filename to my list if its extension matches one of the extensions …

Member Avatar for daniwebnewbie
0
150
Member Avatar for crumpet

Hi folks, Just hoping someone can point me in the right direction with this one. Say I have these key:value pairs in a dictionary, d1: [CODE="Python"] d1 = {fruit:['apples', 'bananas','oranges','tomatoes'], vegetables:['carrots','lettuces']} [/CODE] And I wanted to remove a list (containing tomatoes, oranges) from the value of the key fruit and …

Member Avatar for daniwebnewbie
0
137
Member Avatar for devstudio.2007

Dear All, Everytime i want to logg off or restart to set python path so how to avoid this logg off or restart options. Actually iam using two Softwares using this different Pythonpath if iam using second software means again i want to restart Pc how to avoid this Situation. …

Member Avatar for sneekula
0
102
Member Avatar for tehbrozor

hi, Im running debian/ubuntu linux and am trying to get a script/module that runs each time python is called from terminal. I am trying to write scripts that use Scipy,numPy,pyLab, etc and am trying to have all those packages import automatically each time python starts. I am not new to …

Member Avatar for tehbrozor
0
130
Member Avatar for dilipkk

Hi, I am downloading url using urllib2, the problem I am facing is some times server goes down and then read will take indefinite time. I dont want that, I want to raise a exception after 20 secs in this case. There is solution using signal.alarm but it works only …

Member Avatar for dilipkk
0
4K
Member Avatar for ls129

Hello Python gurus! I need to subclass the built-in type "int" and to add a method that resets the value to what it was when the class was first instantiated. here is what i want to achieve: a = my_int(4) print a ---> prints 4 (works ok) a += 5 …

Member Avatar for Gribouillis
0
156
Member Avatar for lakhan.p
Member Avatar for amarmasic21

I would appreciate any help with the following exercise, I have no idea how to really start this it'd not like any of the previous exercises I've done so any help would be great :) Define a class Set that keeps track of a collection of distinct objects. Inernally, you …

Member Avatar for woooee
0
150
Member Avatar for fuatm16

Hello All ! I m writing a scanner in python. I ve achieved to write scan results into a word file. But still not achieved to view results in my text box. My Text Box Codes: ----------------------------------------------------------------------------------------- metin = Text() metin.place(relx=0.3, rely=0.4, width=300, height=300) ----------------------------------------------------------------------------------------- A part of my Scanning …

Member Avatar for woooee
0
298
Member Avatar for lakhan.p

file f:\\pulldpto.ini hold following data... 101;Activaciones;Virginia Aláez;C/ Isabel Colbrand, 22 , Edif D Planta 4º ;28050 ( Madrid) what will be out put of variables. [python] fINI='f:\\pulldpto.ini' fINI=open(fINI,'r') while 1: linea=fINI.readline() if not linea:break linea=string.split(linea,';') variabl1[string.strip(linea[0])]=0 variable2[string.strip(linea[0])]=string.strip(linea[1]) fINI.close() [/python]

Member Avatar for woooee
0
80
Member Avatar for Gribouillis

Consider the following script [code=python] #!/usr/bin/env python # foo.py import sys print sys.argv [/code] When I run this in a terminal with arguments, here is the output [code] $ ./foo.py -h hello -m "this is a string" ['./foo.py', '-h', 'hello', '-m', 'this is a string'] [/code] My question is: is …

Member Avatar for Gribouillis
0
166
Member Avatar for karenmaye

Does anyone here have a wxPython code that converts a folder of images to a .wmv file just by clicking a button? What I did in my program was I load an Image-to-Video Converter Software by clicking a button but I feel that it would be better if I can …

Member Avatar for sneekula
0
2K
Member Avatar for JeyC

What is the easiest way to search a text file for a particular string? I have text files resembling the following : FILE A HAS 2266 LINES OF WHICH 951 WERE IGNORED FILE B HAS 2193 LINES OF WHICH 878 WERE IGNORED THERE WERE 2 DIFFERENCES Can anyone help me …

Member Avatar for JeyC
0
117
Member Avatar for alicem

Hello, I have just started learning Python. Please can you tell me if there is a way to read in a file one bit or byte at a time (i.e. in binary). Thank you!

Member Avatar for jlm699
0
6K
Member Avatar for harrykokil

is pygame used for games only? or it is used for some application like traffic simulation? can we produce a slide bar in pygame?

Member Avatar for lllllIllIlllI
0
84

The End.