15,185 Topics
| |
Greetings, I would like to make a programm that would generate a long string of numbers or characters in the way that the user firts states how long the so called word should be (let's say 10 000) and will also state the rules for creating the word: i.e. 1 … | |
I am writing a program using Python and the PYOpenGL3 library. I am trying to use PY2Exe to create an executable version of my program. However PY2Exe does not support PYOpenGL3. Is there an alternative to PY2Exe I can use? Basically I need a way to create an executable version … | |
I am trying to write a script where it traverses the current folder and all subfolders and files and prints to screen the name of the files, filesize, and date last modified. e.g. test0.xml | 26 bytes | 11/21/08 23:35:28 (I can get it to do this) Folder/test1.xml | 26 … | |
Hi Guys, I want to write a parser in python. But I am not able to understand that what could be the starting point(some urls and references) so that I can write simple parsers. I just want to have some basic ideas on py parsing methods and techniques. Well I … | |
OK, this may be a dumb question but I'll ask anyway. I am starting to see the benefits of using classes. Most notably code reuse, inheritance and overloading. Shoud I still be writing fuctions in my scripts or do classes make them obsolete? Is there a rule of thumb that … | |
I'm making a text game and im making a save() and load() function i'v got the save function to work but i dont know how to change varyables in the program depending on the varyables in the text files. heres the code for the functions: [code=python] def save(): openfile = … | |
Hello! I'm trying to execute a simple script in the command line, and for some reason, it's not working. Shouldn't it be as simple as this? [code]python myscript.py[/code] And yet when I try that, I get "Syntax Error: invalid syntax" I've googled around, read through the docs--I have a feeling … | |
Hy all. I'm beginner in Python ( started to learn it before a week and a half), but since I already know MSWLogo, python is easy. So, I created a fighting-text game called: PythonFight. Features: -10 fights -4 normal kicks and 1 special -rage -bonuses after round. Please download and … | |
hi! i have a program which makes use of threads(threading module) it runs fine when i run it using python(2.6).. however when i create an exe of the file(using py2exe) and then run it, the following error occurs.. [code]Unhandled exception in thread started by error in sys.excepthook: original exception was: … | |
hi everyone, can you please help me out. what i want is to have a server that listens to a single port for clients to connect using tcp. this is located in a thread. if one client connects, it would relocate this connection to another thread so that the first … | |
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 … |
The End.