15,175 Topics

Member Avatar for
Member Avatar for loki1234

hi, i got a problem for doing a proxy for binary files with python please kindly help #! python import cgi, os file_r = open('x.jpg', 'rb') file_w = open('y.jpg', 'wb') image_data = file_r.read() file_r.close() file_w.write(image_data) file_w.close() it works fine for duplicating x.jpg to y.jpg however, it doesn't work for me …

0
34
Member Avatar for kingofkya

near the bottom of the code you see print statements there. The code executes fine however if they are removed the application locks until the operations finishes. It dos not destroy or add the appropriate widgets until it is completely done. Effectively defeating the purpose of changing them in the …

Member Avatar for kingofkya
-1
136
Member Avatar for girishmsampath

HI GUYS, I HAVE A PROBLEM IN FINDING OUT AN INTERFACE FOR PYTHON 2.6.3 AND MYSQL-5.1.31. IS THERE ANY COMPATIBLE VERSION FOR BOTH THE ABOVE???? WHEN I RAN THE setup.py file of MySQL-Python1.2.2 version, i got the following error. -[COLOR="Red"]-------------------------------------------------------------------------- [COLOR="Green"]This script requires setuptools version 0.6c5 to run (even to …

Member Avatar for Stefano Mtangoo
-2
244
Member Avatar for Megabyte89

Every time I try to save data to my contacts database I get an error. The script runs fine, but when it come to clicking save I get this error. Traceback (most recent call last): File "C:\Users\Panic\Desktop\EminentGeekTechnology\Looking For Who\addnew.py", line 71, in OnSave self.database.execute('INSERT INTO contacts (fname) VALUES (null,?),' [fname]) …

Member Avatar for Stefano Mtangoo
0
477
Member Avatar for SoulMazer

So, I have a rather simple question today. I'll try to explain it by using an example. Let's say there is a line of HTML in the page "www.mywebsite.com/py" that says "<tr colData0='Friday'>". However, this line of code can change to be "Sunday", "Tuesday", etc. What would be the easiest …

Member Avatar for SoulMazer
1
158
Member Avatar for skylar

ok so i was recently playing a game called ZORK a lot of older people will know what that is if you dont its a text based rpg that is realy addicting and amuseing so i wanted to attempt to figure out how they could have done something like this, …

Member Avatar for lllllIllIlllI
0
98
Member Avatar for scrace89

I'm stuck trying to figure out how to find out which number in a range entered for a hailstone sequence has the longest length of numbers total including the starting number itself. This is what I have so far: elif choice is apart of a menu getValidInt() is a function …

Member Avatar for scrace89
0
263
Member Avatar for marshall31415

Hi, There is a lot of code - so I have attached the entire thing as a zip file. This is for a function plotter. Basically, I need to track the changes in the root window size so I can resize the canvas and redraw all the plots. I'm very …

Member Avatar for marshall31415
0
3K
Member Avatar for Dlsqueak

I have this example code of a program I am writing at the place I work as a 'time clock' of sorts. I want to come in, run the program and clock in. When I clock in, I want to write this to a csv file so I can send …

Member Avatar for Dlsqueak
0
78
Member Avatar for etypaldo

I am trying to make a program that reads from a "integers.txt" file which contains: 1 2 3 4 11 13 15 16 18 20 33 39 42 48 50 51 and finds all the even numbers in "integers.txt" and writes them to a new file "evens.txt" then finds all …

Member Avatar for woooee
0
104
Member Avatar for qadsia

Hi, I have a problem. I basically have this python code, that generates a file. I'm trying to get it to output a html file with a chosen name (chosencategory) but the problem is the chosencategory variables are already defined so it attempts to name the html file the contents …

Member Avatar for qadsia
0
261
Member Avatar for mahela007

Why does this raise an error? I'm trying to add a value to the [0] index for the list [CODE]mylist=[] mylist[0]='hello'[/CODE]

Member Avatar for mahela007
0
74
Member Avatar for zyrus001

Hi! I have a list of class objects, each object contrains a dictionary. Is it possible to sort my list based on a value within each object's dictionary? Can I use the list.sort() method to do this? Thx!

Member Avatar for jice
0
242
Member Avatar for SuperMetroid

The html code of the form, and my code are below. I can't get the value to post/submit. Can anyone help? HTML Code of Form: [code]<form method='post' autocomplete='off'> <input type='hidden' name='action' value='grant-revoke' /> <input type='hidden' name='creator_badge_index' value='1' /> <input type='hidden' name='token' value='92dcd92a8bc16f73f330d118ae1ed891' /> <input type='hidden' name='do-grant' value='1' /> <div id='grant-div'><span …

Member Avatar for SuperMetroid
0
171
Member Avatar for thehivetyrant

Hi there, I'm trying to create a class with whats below. I made it and it works but i need to be able to withdraw an amount from the balance. I'm just having trouble with the layout and whether i got the right idea? Is the underlined area on the …

Member Avatar for Gribouillis
0
137
Member Avatar for james27

hello im learning twill,but have some problem with unicode. whenever i use twill's follow function which emulate webbrowser link click function,it can work well with english link,but can't work with unicode. does anybody some know about this probelm? thank in advance follow is sample # -*- coding: cp949 -*- import …

-1
60
Member Avatar for fallopiano

hi everyone. to put it plainly, I was writing some python code that used the itunes scripting interface to control itunes. so I got all of my functions down, and now I wanted to have these actions occur on a specific mouse press. thanks to Tech B, I used the …

Member Avatar for fallopiano
0
101
Member Avatar for fallopiano

hi everyone. just recently I've been messing around with controlling itunes with python (you should check it out on google; some pretty fun stuff to mess with :D). I've already got all of my functions down, but my questions is that how would I go about grabbing keyboard/mouse input (mouse …

Member Avatar for fallopiano
0
325
Member Avatar for AutoPython

I'm having a problem sizing down this block of code: [CODE] if POS == 1: POS1 = "->" else: POS1 = " " if POS == 2: POS2 = "->" else: POS2 = " " if POS == 3: POS3 = "->" else: POS3 = " " if POS == …

Member Avatar for AutoPython
0
144
Member Avatar for james27

hello i have some problem to send POST value by use mechanize. i can't write my article to my blog site. here is full source. and what i want to do is, im posting my article to my blog site. thanks in advance. [code] # -*- coding: cp949 -*- import …

0
60
Member Avatar for Mensa180

Hello! I've been messing with tkinter and now have tried to make a MPG calculator using sliders. My problem is that no matter how I move the sliders it does not update the mpg, I'm not sure what to tell the label to do for it to update. I know …

Member Avatar for Mensa180
0
115
Member Avatar for Joop!

I have an application running on a server, which can be accessed through a web interface. For that I use the module BaseHTTPServer. On my LAN, this all works perfect without any flaw. However, when accessing throught the internet, only the first requested page is reaching the server (and honoured). …

0
49
Member Avatar for kenmeck03

I need to prompt a user to type in a text file name and then take that file and and count the amount of words in the file. I have this code which counts the words in a file(that may not be "perfectly" written). I cannot figure out how to …

Member Avatar for bumsfeld
0
122
Member Avatar for wotthe2000

Hi How do you find out the first letter or number of string in a list? I have a list and I want to find whether any of the strings in the list start with a capital or little C. The code I have is: [ICODE] def isCMD(self): for word …

Member Avatar for bumsfeld
0
2K
Member Avatar for txwooley

I am making a poker game using pyGTK. My problem right now is that the other players won't let me play! Each player has a function for betting and they go in order such as amandaBet(), playerBet(), billBet()... where player is you. Since this is a GUI game, I am …

Member Avatar for txwooley
0
271
Member Avatar for Stefano Mtangoo

Hi all, I plan to make a PRACTICAL dictionary and need help on just ideas. basically you can use dict datatype for simple dictionary and use dicy->key to retrieve but does that work for larger data queried from database? Or should I implement a database of key --->value? Any Idea …

Member Avatar for Gribouillis
0
176
Member Avatar for persianprez

Hi, I'm brand new to Python and am completely clueless in this assignment. This is the 3rd assignment, but the first without hints on how to import, etc.. The objective of this assignment was to decode a file we are supposed to use the python hw.py < code.txt command with. …

Member Avatar for ov3rcl0ck
-1
290
Member Avatar for BattlingMaxo

I want to make my characters move in realtime with NO pre-existing animation. The characters will move according to what is in front of them or if a enemy enters, etc. Are there any examples of this? Battlingmaxo

Member Avatar for BattlingMaxo
0
101
Member Avatar for darkbow

Hi i have this section of code that looks for user info on another table... this code works fine querying the database locally... but i need it to work remotely can anyone see what im doing wrong... [CODE]from sqlite3 import dbapi2 as sqlite import MySQLdb as mysql from mud.common.persistent import …

Member Avatar for jice
0
123
Member Avatar for kingofkya

Ok trying to work with zipFile library how do you flatten the file hierarchy what works [CODE] zipFile = zipfile.ZipFile(imgSetup[0]+'/'+zipName, 'w') for picId, pathname in enumerate(pic_list): if start <= picId and picId <= end: zip.write(filedir+'/'+pathname) zip.close() [/CODE] what i am trying [CODE] zipFile = zipfile.ZipFile(imgSetup[0]+'/'+zipName, 'w') for picId, pathname in …

Member Avatar for kingofkya
0
200

The End.