15,181 Topics
| |
I need to add a column to a list of strings and then print it back to a new text file without [] or "". I tried this below but it is not the result I wanted. infile looks like this: 23 CL 006 2004 DBA8ORPU 41 8Y S0111P 2 … | |
Hello everyone, Can someone kindly explain me what is the basic difference between python statements and expressions? I'm too much confused about them and cannot upgrade my knowledge about Python until I get a full grasp on them because they are everywhere! Some explanation with example may help me a … | |
I am trying to make a 8 x 8 grid of boxes to manipulate for a matching game. I started with wxPython since I have no experience with pygame. I have it laid out with: [code] WINDOW_WIDTH = 1200 WINDOW_HEIGHT = 1200 class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, title = … | |
I am a complete beginner to python (I have only used it for a statistics class in the past). I want to develop a program that is kind of like [URL="http://en.wikipedia.org/wiki/FreeMind"]FreeMind[/URL] - it will allow the user to create Ishikawa diagrams for a particular purpose. So essentially I want the … | |
I ask the user in my program to enter up to four types of income, with 0 filling the unused income slots. Then, the program is supposed to add up the incomes. It goes like this: user defines values for incomes 1, 2, 3 and 4. Program adds together the … | |
I have a start date and an end date and I'd like to know how many months that occurrence fell in. For example if my start date was 2009, 01, 31 and the end date was 2009, 02, 01 I'd like to calculate that the occurrence fell in 2 different … | |
Using curses, how can I echo and capture input at the current cursor position? I have moved the cursor using scr.move(y,x) and turned on echoing. I can type into it and have it displayed. How can I capture this data as a string after the user presses enter? | |
Hi, I am trying to write a script that takes in a user inputed Excel file and adds/deletes/edits a row and re-saves it. Because xlrd and xlwt dont work together I am forced to combine them together and copy the xlrd workbook to an xlwt workbook. I am using python … | |
am i correct in assuming that when a computer behind a router with port forwarding opens a port (port 1337, when i run my server), that the router automatically notices and sets itself up to send all port 1337 traffic to that computer? i've got two simple applications, a client … | |
Well this is probably a really stupid question but i was doing pygame tutorial and i dont know what a vector is and they keep talking about them, there were special vector classes and things like that, im rather confused, so if someone could teach me what a vector is … | |
Having trouble with the final loop in this craps program. Any suggestions. Problem starts on line 28. Was thinking about breaking the whole thing into functions but I don't exactly know where to call them at. When I do call them I get accessed before argument errors or something to … | |
Hey, I got an array with float values from 0 - 120. How can I find the first element over 100 and which element it is? | |
Why wont my cookie set in firefox [CODE]#!/usr/bin/python import Cookie print "Content-type: text/html\n" C = Cookie.SimpleCookie() C["number"] = 7 C["string"] = "seven" print C["number"].value print C["string"].value print C print "Set-Cookie: string=seven; " [/CODE] | |
I have a simple rational number class which looks roughly like: [CODE] class Rational: def __init__(self, numerator,denominator): self.numerator= numerator self.denominator= denominator more functions... [/CODE] but when I work with really large numbers such as the following example: [CODE] >>>a= Rational(2**64, 1) >>>a [/CODE] python crashes telling me Rational instance has … | |
First I like to thank everyone that helped me with my work... Please bear with me I don't know how to explain my problem. Trying to get the random number to remain the same through out the length of the program. When the player guess the right number the player … | |
Hi, how would I get the timer() class to change time display()'s self.time I'm new to threads and classes and have been sitting here thinking about it for the last half hour and still have know idea Thanks heaps for any help. [code=python] # Count down timer import time import … | |
First of all I apologize for my bad english I am beginner in writing GUI apps with Glade and python, i am having problem with libglade.. well I know that glade-3 hasn't yet good implementation with gtkbuilder, so python users are saving projects in libglade format, and then we convert … | |
I have too collect a daily rainfall data from a certain model output. The model ouput gives out each stations daily data separately which I have to collect together and further analyse. [I have tried the following, it works but my data - thousands of pcp_#.txt which makes the process … | |
| i looked at the python 3k print module from griboullis and i want to use it for python 2.5 without having to import it every time, i think it needs to be builtin but how can it do this, i don't mind if the old print is still there but … |
hi im trying to write a python script for a telnet client. So far im able to establish a connection with a server. My problem is that i want to print (at the client) all the activities at the server end. Let me put it this way. Suppose i send … | |
Hi, so I just have a question that I at least think will be pretty easy. So, I am making a script that basically gives you a "vocabulary test". There is just one feature I would like to implement that I need help with. I would like to make it … | |
I am preparing for my a+ exams, and am turning all of my notes into a test. I plan on doing this in python, of course. But, I am a little lost at what would be best. Should I create each question as a specific function, calling the next question … | |
for example if i write hello on one line and then wanted to write goodbye right underneath what do i have to do? as when i press the enter key it just prints hello | |
Can someone please look at my code and see if I'm writing it efficiently using parameters and return values. Thank you for your support [code] PAY_RATE = 12.75 #This program ask the user for: hours worked, then calculates gross pay. def get_hours(): hours = input("How many hours did you work?: … | |
Hey just wondering if you can do something like that with variables for example [CODE] class test(object): a = 55 def dispmenu(self): print self.a instance = test() [/CODE] How would i be able to call "instance.dispmenu()" without having to type that. Some things i have tried [CODE] action1 = instance.dispmenu() … | |
| hi again ive got more questions for ides i have been using UliPad but it keeps on closing and uninstalling itself im looking for something that can: run code in ide debug syntax lightweight all round simple to use preferably i would like it to have a module lib what … |
This is my code its to calculate book club points earned. i cant see where the error is if any one can help me i would be very gratefull. thank you def main(): books = getBooks points = getPoints printPoints def getBooks(): books = input("enter the books purchased") return books … | |
Are there any equivalent classes in python for the for the following java classes import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.protocol.Protocol; Thanks | |
This may be a stupid question but.. I am trying to do something like this.... [code] if not something and not somethineElse and not someOtherThing and not thisThing: print "asdf" [/code] and i get an invalid syntax error. so how do you do that properly? google wasn't much help. | |
hello everyone I am working on my application that deals with photos. well i have created my UI using Qt designer and converted it to python classes using pyuic4 but i am facing problem with the file dailoug where i can browse my directory and choose photos but i can't … |
The End.