15,181 Topics
| |
Is there a way to limit size of a list in Python, so it does not use all memory? | |
Hi, my friends, I am new to python. I am trying to user csv module to read and write the data in csv. Here is data format. # of columns in each row are the same. 1st row is a header. how I can pass the data into 2-D array? … | |
Can someone tell me what is the different between default_age and self.default_age? Only one default_age variable is created for all instance of class Student and self.default_age means very instances of class Student gets a variable default_age? How do you specify a static class(singleton class) in python? [code=python] class Student: default_age … | |
hello i'm new here but i have made a little python calculator and was wondering, if i wanted to give a copy to my friend how would i change it from a python file to a umm .zip(just an example) file where my friend can just unzip it and use … | |
Why can't I have two different link objects? I create _link and _link2 as empty objects. When I do this: _link2 = _link, it just creates alias _link2 to link object. Same object have 2 aliases _link2 and _link. Is there a way to copy the content of _link to … | |
I'm having problems with storing a wxDateTime object from a wxDatePickerCtrl in a file and then reading it again when the program starts (so I can set the date picker's value to what it was the last time the program was run). When I get the value from the date … | |
I created a function that creates smiley faces. I want to print more than 1 (with different size and location) on 1 window. How do I do it? Here is the code: [code=Python] from graphics import * def main(): print drawface(Point(40, 40), 20, GraphWin) print drawface(Point(90, 90), 30, GraphWin) print … | |
Hi all, I see a lot of books teaching beginning Python students to code like this: [code="Python"] def func1(): ... def func2(): ... class Blah(object): ... def main(): ... main() [/code] It strikes me that having people "def main():" and then call main() is a bit silly. In fact, it … | |
Hi, i am having trouble with the While Loop for my homework, I am suppose to write a program that says you owe someone money and then with the beginning balance, interest rate and monthly payment entered, I am suppose to use the While Loop to make sure that the … | |
Hello, I am new to python. I have been trying to connect to telnet and feed some data from a server. Its working properly. I used the connectionObj.read_until() method to read the data from the server and made the connection as [code] self.conn = telnetlib.Telnet(so.telnetHost, so.telnetPort)[/code] thats too fine. But … | |
hi all, i would like to know the all possible command line options of GGCOV tool... ex:1. ggcov program name 2.ggcov -o dir if anyone of you know this,plz send me the details... Thanks in advance..... RajasekharReddy.B | |
Hey. any help wud be greatly appreciated. I have just tranferred into the second year of a multimedia course in which they have been doing python programmes. Problem is i have never programmed anything before and have been asked to complete this assignment.:( i dont even know what it is … | |
I'm trying to give python a list of numbers like this (5 6 7) and I want it to square each number (or as many numbers as I input). I'm trying out a list comprehension on this. I'm not sure where I'm going wrong. Any help would be great. [code="Python"] … | |
ok so heres the thing, ive got to to do this program for college but the lecturer is a numpty and wont help anyone. so im stuck. ive only got so far into the program and cant get the most important bit to work where it is supposed to. its … | |
Hi, this is my first post here. And I am new to python. I have script which supposed to read in a series of files in the format "myfile.*.obj" where "*" is a sequential no. (001,002...) but when I run the script, it seems that it have difficulty recognizing the … | |
hey ive been working on a txt game... btw im using python 2.3. i am trying to have a requirement for each 'room' or function, i want it so the user has to pick up an object into their inventory before they can go on to the next room. here … | |
So I've written a code to get an acronym of the phrase inputed by the user. The only problem is that it insert an extra line in the result which I don't need. I'm not sure what is causing it. Here is the code and the results: import string def … | |
I'm trying to get a grasp of inheritance in Python but am having problems. I am trying to create a derived class but want the derived class to only provide an initialized instance of the base class. Specifically I would like to inherit from [inlinecode]OrderedDict[/inlinecode] as shown in the following … | |
Hi, I have made a parser in python (using Dparser). I have stored the parsed syntax tree in a dictionary. Now, i want to draw a tree to display the tree. I found out that you can use svg.py in Imagemagick to draw such a tree. But, I have no … | |
I'm writing a lesson on debugging for my students. They will have already had a lesson on how to read code and do walkthroughs, either manually or using the debugger. They currently know about [B]if[/B], [B]while[/B], types, math operators, and have some experience with but no formal training in functions … | |
Hi, this is my first forum message so I'll make a brief introduction. I'm from Canada and I am Computer Science student. I enjoy working with computers, specially web programming. It has come to my attention (and also a school requirement) to learn Python. So here I am with my … | |
HI! I have a problem: I want to initalize a class by a condition. For example: [CODE] class something: def __init__(self,a): self.a = a if self.a == 0: #break initalization else: #continue initalization [/CODE] How do I break the initalization? Thank u and sorry for my english! | |
Hi everyone, I'm new here and I'm looking forward to seeing how everyone codes in python. I'm a complete newbie, who has never done any programming in his whole life (except for the past 2 week). I read the guidelines about asking for help on assignments, and I wouldn't have … | |
Hi, Once I press S(to start), I would like to make only one IP (that I entered manually) to be ping each 60 secondes, and print Hello at each second or 2(whatever) and If I press Q, than it`s stop. Can somebody provide me a syntaxe that can help me … | |
I began to learn about Python perhaps an hour or two ago. In a Python tutorial, I came across the below text (between lines of equal signs) regarding default function arguments. This makes no sense to me at all. What is the scope and lifetime of L? It appears that … | |
Hello, I am a newbie in Python and maybe this is a stupid question, but when I run this code I receive a very strange output. [code] status = 0 for i in range(10): status = status + 0.1 if status == 0.1: print status elif status == 0.2: print … | |
Hey everyone. Noob poster here so bear with me. So the code below makes a drawing of a face move around the graphics window. However, the face is noseless. My dilema is that I absolutely can't figure out how to add a nose to the face and have it move … | |
Hi, I'm having trouble removing objects from a list. It seems that when I remove single objects in a loop, the loop kind of skips elements in the list, not continuing from the point where the last removal occurred. I want to remove only certain elements from a list, and … | |
Hey guys trying to compile code, and heres the error I receive. im fairly new to python programming so any help would be appreciated. thanks in advance. ms7538@ms:~/Desktop$ ./test.py Traceback (most recent call last): File "./test.py", line 10, in <module> class Panel1(wx.Panel): File "./test.py", line 22, in Panel1 bmp = … | |
The End.