15,190 Topics

Member Avatar for
Member Avatar for Aue
Member Avatar for Apollo64

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 …

Member Avatar for jlm699
0
111
Member Avatar for dineshjaju

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

Member Avatar for jice
0
102
Member Avatar for i_saw_some

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 …

0
19
Member Avatar for jvignacio

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 …

Member Avatar for jvignacio
0
191
Member Avatar for babanner

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.

Member Avatar for jlm699
0
83
Member Avatar for mn_kthompson

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

Member Avatar for sneekula
0
134
Member Avatar for tzushky

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 …

Member Avatar for Gribouillis
0
14K
Member Avatar for red999

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 …

Member Avatar for paddy3118
0
184
Member Avatar for jvignacio

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

Member Avatar for Freaky_Chris
0
66
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for rajeesh_rsn

Hi i am a php programmer. Kindly let me know a good book for begin python from its basic ??? Thanks

Member Avatar for Stefano Mtangoo
0
80
Member Avatar for Ghostenshell

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 …

Member Avatar for Stefano Mtangoo
0
967
Member Avatar for Radly

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

Member Avatar for Radly
0
86
Member Avatar for wotthe2000

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

Member Avatar for wotthe2000
0
93
Member Avatar for maheshmaks

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

0
41
Member Avatar for jvignacio

What part of the HTTP header is always provided as part of the response of a CGI program? thanks guyss

Member Avatar for jvignacio
0
113
Member Avatar for wheatontrue

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 …

Member Avatar for wheatontrue
0
99
Member Avatar for Luckymeera

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

Member Avatar for vegaseat
0
120
Member Avatar for romilana

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

Member Avatar for jlm699
0
106
Member Avatar for san245

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 …

Member Avatar for jlm699
0
142
Member Avatar for leegeorg07

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

Member Avatar for mn_kthompson
0
120
Member Avatar for revenge2

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

Member Avatar for sneekula
0
218
Member Avatar for gsingh2011

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 …

Member Avatar for BearofNH
0
467
Member Avatar for int3grate

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 …

Member Avatar for woooee
0
285
Member Avatar for noamjob

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 …

Member Avatar for Stefano Mtangoo
0
6K
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
88
Member Avatar for Gribouillis

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 …

Member Avatar for Gribouillis
0
178
Member Avatar for revenge2

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 …

Member Avatar for Murtan
0
328
Member Avatar for bhanu1225

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 …

Member Avatar for Stefano Mtangoo
0
81

The End.