15,175 Topics
| |
Does anyone know how to convert an instance to unicode? I understand how to convert a string into unicode format u=unicode(s, 'ASCII', ignore), however this assumes that s is already a string and converting s by the str(s) method will kick back an error if s contains unicode unfriendly. The … | |
Ok I will post all of the code at the bottom, first thing however is the loop below starts at 0, then increments to 1, but never increments any further. [code=python] for counter1 in range(fieldlength): if self.__fields[counter1] == field: for counter2 in range(rowlength): #print self.__rows[counter2][counter1] if self.__rows[counter2][counter1] == value: return1 … | |
As simple as question is; What GUI toolkit do you use and why? Why didn't you used the rest? Here are GUIs I know of: [LIST=1] [*]TkInter [*]PyQT [*]PyGTK [*]Wxpython [/LIST] You can Add If you have one that isn't Listed | |
I am trying to create an authentication script. I am trying to use the PASSWORD function within Mysql but it wont work. Any ideas [CODE] #!/usr/bin/python # e begoli, python connector for mysql # import MySQL module import MySQLdb import cgi print "Content-type: text/html\n" # connection db = MySQLdb.connect(host = … | |
So here's my question. I'm new to python and am near lost. I've been through a few tutorials and still don't feel confident. Sure I can do whatever the tutorials say, but it's a different story when I do the whole thing myself. Here's what I would like to do … | |
| hi again i have two questions: firstly do you know if win32 and other add-ons for python are released for python 2.6? secondly my whole computer is messed up and i want to create a program that will search through a selected folder or folders and will move any items … |
I have code but when I want to gather my widgets under same wx.StaticBox I fail. I wonder what is wrong! Please someone to corrrect me! [CODE=python] #Add static box to hold related widgets--- it otherwise does nothing holder1 = wx.StaticBox(mpanel, -1, label="Transactions", pos = (10, 10), size = (300,300)) … | |
I'm trying to get to grips with using files, particurlarly saving a set of inputs from the user into a file and then load it all back up again. I have a program which, through a little object oriented interactivity, allows the user to pair up names and numbers in … | |
Its about the pay system of a shop. The user enters a product ID,the interpreter gets the details from the file and appends it to a list and continues till the products are over. If the user can't enter the ID he can add the product name directly which will … | |
I only made an on and addition button with actual functions[ICODE] #!/usr/bin/python # gridsizer.py import wx app = wx.App() class GridSizer(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(300, 250)) def On(self, event): x=input("") def add(self,event): return x y=input("") print x + y menubar = wx.MenuBar() file = … | |
I am learning to create a database with python. I am using this line of code to populate my table T.insert(2, 'Jones', 'Jack', 15, False, 0.0) And the table is created as follow: T = SDBTable('id=ui', 'last', 'first', 'age=i', 'married=b', 'salary=f') I have a class SDBTable and in it there … | |
Hello, I'm using Java and Python together with Jython and I'm having trouble with some python syntax. I have a custom listener that I want to add to an object. Usually I'd do it like this: class ballCollisionListener(animation.CollisionListener): def collisionDetected(self,event): if event.getSource()==boundary: if ball.getX()<=0 or ball.getX()+ball.getWidth()>=boundary.getWidth(): ball.setXSpeed(-ball.getXSpeed()) elif ball.getY()<=0 or … | |
I was trying to write the output of a loop on a file. The problem is the writing repeats for each loop. [ICODE]prev_line = "" while line: Total = 0 fields = line.split() N = len(fields) name = fields[0] #sum each 5 fields over the raw: for step in range … | |
Hello I am quite new programming in Jython, I am working with DB. I a send SQL Statements, but I want to handle the zero rows in Resulset. rs = dataSource.performQuery(sqlstatement) rs.moveFirst() I dont know which condition has to be set when the Resulset doesnt has any row. When I … | |
I've gotten a little bit furter in understanding the general workings of python, and currently I'm fidgeting with classes and objects. I was thinking of the possibilities of having a program with a whole bunch of user defined classes that the user can use (hey, almost a repetitive aliteration there...) … | |
Hello!! I desperately need help on event triggering across panels in wxPython! :( I have 2 classes that inherit wx.Panel: Leftpanel & Rightpanel Leftpanel consists of several buttons. Rightpanel consists of a graph (i.e. using matplotlib). I want to make the program so that pressing the button on Leftpanel will … | |
Hello All, Greetings!! I was thinking of making MP3 Encoder. This is because I cannot find Exact encoder so I was finding some bindings for Lame Mp3 encoder and CD extractor/any cd to wav Library Thanks all Steve | |
First of all, I'm a total beginner which is the reason that probably my code contains a few simple and dumb mistakes...but how you see I'm working on it ;) My task is to write a program that contains a queue which will be returned in reversed order. But my … | |
Hi, I have set up a basic HTTP server, using code similar to that on [url]http://fragments.turtlemeat.com/pythonwebserver.php[/url]. I have created a BaseHTTPRequestHandler, and modified the do_GET function. This server is linked to a FLEX GUI, which requires a crossdomain.xml file in order to get data from another domain. If the server … | |
I want to subclass a python dictionary to create a new class with dynamic keys. In other words the key value is 'property(fset, fget, fdel, doc)'. For some reason the when I get the d['b'] key, a property object is return instead of the function get_b. d['b'] should return the … | |
Hi there. Iv been searching (this forum and Google) for examples using the StyledTextCtrl, so that I can see how the thing actually works, but with no real joy. Iv found a couple of very basic examples but nothing that really shows the workings of the control. Iv seen the … | |
I have this assignment where I write certain lines from an input file. These lines I'm looking for in this case is only identified by its following line ("EOL"). It goes like (shortened): [CODE]while True: line = infile.readlines() if not line: break linesplit = line.split(",") line = line[:-1] if line … | |
hi all, glad I found this site. I hope you all can help me out with this little problem. First, my environment: Mac OSX 10.5.5 Python 2.6 (compiled from source, not using macports) basedir: /usr/local/bin/python; /usr/local/lib/python2.6 Following the proper directions on how to install setuptools (from here [url]http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other[/url]) [code] bash-3.2# … | |
Here I am again with new problem. I want to do some calculation on each field row after row. The for loop which I tried is not giving me what I expected [ICODE]#sum each 5 fields over the raw: for step in range (6, N, 5): for i in range … | |
Hi, I need to write a partial ocr for just 2 characters but I don't know where to start. The 2 chars are '8' and 'F'. The 8 is only comprised of two arcs and the F is one vertical stroke and 2 horizontal strokes. I cannot use pytesser for … | |
everything works fine on my app until I add a menu. Every button every field, everything ends up stacked in the top left corner. as soon as I set the menubar to the main frame and run it collapses. I have like 5 sizers that get added to a final … | |
Hi everyone, I am working on a checkbook balancer for school and my code looks like this: [B]def process(balance): trans_type= raw_input("Enter Deposit(d), withdrawal(w), print(p), or quit(q):") amount=input("Enter the amount:") if amount<0: print"You've entered an invalid number." if trans_type=="d": balance=int(balance)+int(amount) print"Your current balance is", balance elif trans_type=="w": balance=int(balance)-int(amount) print"Your current balance … | |
Hello, I'm trying to make a stereovision application using opencv. Thus I have to stream video from two webcams. My questions are: -How do open the two streams in a wx.Frame...I suppose I must have some form of container -How do I convert from a captured cvFrame to a wx.Image … | |
I have written a script that scrapes a particular website and returns the date of an article, description and url. I want to display this information on the console with clickable text so that when I click on text/link called "site" it will open the url of the article in … | |
I have a small WxPython app using the CalendarCtrl module, which works fine. I have it set to bring up a grid of times for a particular day's appointments when I click on one of the days. But I don't see how to detect which cell of a grid I … |
The End.