15,190 Topics
![]() | |
I am some-what new to programming in python, and i'm trying to make a game but I need to know some of theses thing. Sprites I have sprites created, but how do I import them and print them on the screen? Movement I am completely clueless on how to make … | |
[CODE]#Python code: import csv # first we need import necessary lib:csv file=open("dinesh.csv") #prepare a csv file for our example testWriter = csv.writer(open('dinesh.csv', 'w'), delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL) spamWriter.writerow(['Test'] * 5 + ['Wow'])[/CODE] [B]Error:-[/B] <type 'exceptions.IOError'>: invalid mode: w args = ('invalid mode: w',) errno = None filename = None message … | |
Hi, I am using Django 1.0 and Python 2.5.2 on Ubuntu Hardy Heron. My Python application must load a large amount of data - an object that represents a huge non-hierarchal network. Once this lengthy loading process is completed, calculations can be performed very quickly from then on. In my … | |
hey guys im trying to get my html and python cgi script working together to show the users selections of the checkboxes of bulbs and add them up aswell plus the method they wana pay once they pretty the submit form button.. here is my html code: [CODE]<html> <body> <form … | |
This is my code [code=python] import urllib.request, urllib.parse,http.cookiejar url="http://localhost/test.php" cs=http.cookiejar.FileCookieJar("cookies.txt") cs.load("cookies.txt",ignore_discard=False, ignore_expires=False) opener=urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cs)) y=opener.open(url) print(y.read()) [/code] It seems to be correctly according to the Python 3.0 documentation (which is very,very poor). However i get an error: FileCookieJar has not attribue '_self_load'. Please help. | |
I was looking over some code for an open source project and I saw some strange whitespace stuff that I didn't even think would run. The thing is, it runs just fine. I was wondering if someone could explain what I'm missing. I don't want to copy the exact code, … | |
Hi, Something new from me: I have an application which can act as server and client (launch them on separate PCs). I need the server stdout because it displays some data for evaluating their communication. I start the server through a [B]subprocess.Popen[/B] giving its stdout to [B]PIPE[/B] [CODE=Python] from subprocess … | |
I am creating a script that allows me to calculate the future value of an investment at the end of x years, but I am having a little trouble writing the summation syntax in my script. I am not familar with the sum syntax so I do not know how … | |
Im trying to figure out a python script where, If there is no user input, it generates a form which asks for the user's name and email address by using the action form. any ideas ? any help much appreciated..thanks guys | |
Hi all, I have been trying to write and retrieve data from SQLite Database. So far I can make connection, cursor; but cannot get table populated(fails to execute SQL statement). Since I read somewhere that it is recommended to use ? instead of % then I tries it but I … | |
Hi i am a php programmer. Kindly let me know a good book for begin python from its basic ??? Thanks | |
Can anyone simplify this for me? I don't know if it is going to work I tried to adjust the code to fit on the page. Might have to delete the extra [ICODE]+\[/ICODE] [CODE=python]def main(): try: infile = open('text.txt','r') files = infile.readlines() lower,count,blank,dig = 0,0,0,0 #Counting uppercase for line in … | |
I'm sure this is either easy or impossible. :) I have a Windows command console window open with a Python 2.5 interpreter running. I also have a text editor open on a module I'm debugging. What I'd like to do is make some changes in the editor, save the file, … | |
Hi, i'm having some trouble using the built-in apply function. I want to take a string in an external definition then apply definitions on it which are in a class. The code I have is: [ICODE] global msgstr def create_message(message, msgstr): if msgstr[0:3].upper() == 'CMD': return apply(message, (msgstr)) elif msgstr[0:3].upper() … | |
Hi I am using to design flow to launch 3 Vmware images using queue. Can you please help me. I have just started. If you have links or help related to Vmware launching i.e. 3 images at a time. thanks in advance Regards, Mahesh | |
What part of the HTTP header is always provided as part of the response of a CGI program? thanks guyss | |
Dear all, I am having a lot of trouble using programs I programmed in python 2.5 - having upgraded to 2.6 I find that every function/class that makes use of SSL receives this error: Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> import ssl File "C:\Python26\lib\ssl.py", line … | |
I have a simple Rectangle drawn on Canvas. How can I retrieve the color on the Canvas AFTER the Oval is drawn without using Image, say, at the coordinate (100,100) ??? could anyone help plz... | |
I would be pleased if some could help me with a scripts using telnetlib to enable save web pages. Hope to hear from you soon | |
The following function returns a list of all prime numbers up to the figure supplied to it (n). Example: [code=python] import math def prime(n): answer = [] if n < 2: return answer for loop in range(2, n+1): isPrime = True upper = int(math.sqrt(loop))+1 for i in range(2, upper): if … | |
![]() | hey again i started to look at the time module a lot and i made this program: [ICODE]import time time.clock a = 0 print('hello') while a < 10000: print(a) a+=1 a = time.clock() print(a) [/ICODE] but i dont understand what a means so can you help me please |
I need help understanding classes better. [CODE=Python] class person: def sayHi(self): print('hello world!') p=person() p.sayHi() [/CODE] here what is the use of 'self'?, I've read two tuts on this but don't quite understand fully.... [CODE=Python] class person: def _init_(self, name): self.name=name def sayHi(self): print('hello, my name is', self.name) p=person('rs') p.sayHi() … | |
I'm trying to run a program using a python program. The program is supposed to run the program, get the output, and write it to a text file. The program being run (which is an exe), takes one argument, so I used: subprocess.call(["path", "arg"]) This works fine, but the problem … | |
Hi all, I'm relatively new to python (I've been writing python code for about half a year now) and I'm trying to figure out how to use "seek" on larger files. I'm doing some work with large hard disk image files, and the raw devices themselves. I need the ability … | |
I'm trying to get the content of a web page that is written in pdf format. The following code worked very well for me when I tried to read a regular web page, but it prints all kinds of weird letters when I try it on a pdf page like … | |
Hello colleagues, I wan't to upgrade to python 2.5.4 from 2.5.2 but I don't want to lose my modules. Is it possible to upgrade without removing those modules? Thanks | |
In python, a "function object", that is to say an object which can be called as a function, is simply an instance of a class which has a [icode]__call__[/icode] method. An example is [code=python] class FuncObj(object): def __call__(self, *args): print("args were %s." % str(args)) func = FuncObj() func(1,2,3) # output … | |
This is my first official python program/scrip which I've done my self;) yay!:D. Im sure most of you guys know the 21 card trick where you guess what card a person is thinking of accurately. anyway, I have trouble passing information between modules within modules and functions within functions. this … | |
Hello friends. This is Bhanu from [COLOR="Red"][B]INDIA[/B][/COLOR]. I am working in a software company. Here, we are working on [COLOR="Red"]Macintosh Operating Systems[/COLOR]. It is very new to us. And we would like to work on [COLOR="Red"]Python Language for our Project with back end as MySql.[/COLOR] We referred so many tutorials … |
The End.