15,185 Topics

Member Avatar for
Member Avatar for rastaberry

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 …

Member Avatar for rastaberry
0
85
Member Avatar for goldsm

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 …

Member Avatar for vegaseat
0
90
Member Avatar for Bouzy210

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 …

Member Avatar for Bouzy210
0
115
Member Avatar for ping24

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 …

Member Avatar for Gribouillis
0
75
Member Avatar for ccandillo

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 …

Member Avatar for Stefano Mtangoo
0
139
Member Avatar for tomtetlaw

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

Member Avatar for tomtetlaw
0
101
Member Avatar for payne_99

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 …

Member Avatar for lllllIllIlllI
0
124
Member Avatar for MaracKoMarac

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 …

Member Avatar for numonic
0
53
Member Avatar for mrkuchbhi

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

0
75
Member Avatar for overmind

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 …

0
63
Member Avatar for ihatehippies

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 …

Member Avatar for ihatehippies
0
119
Member Avatar for thanatosys

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 …

Member Avatar for thanatosys
0
159
Member Avatar for Stefano Mtangoo

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

0
72
Member Avatar for adam291086

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

Member Avatar for adam291086
0
121
Member Avatar for wangzi

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 …

Member Avatar for wangzi
0
95
Member Avatar for leegeorg07

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 …

0
47
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
137
Member Avatar for Devlan

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 …

Member Avatar for vegaseat
0
122
Member Avatar for Feenix45

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 …

Member Avatar for Feenix45
0
157
Member Avatar for ccube921

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

Member Avatar for ccube921
0
117
Member Avatar for DATA777

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 …

Member Avatar for jlm699
0
106
Member Avatar for jcafaro10

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 …

Member Avatar for jlm699
0
111
Member Avatar for chebude

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 …

Member Avatar for chebude
0
84
Member Avatar for Fionageo

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 …

Member Avatar for bvdet
0
149
Member Avatar for Devlan

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

Member Avatar for Devlan
0
98
Member Avatar for sangpenakluk

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 …

Member Avatar for Stefano Mtangoo
0
643
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
396
Member Avatar for Paramecium

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 …

Member Avatar for bvdet
0
104
Member Avatar for sma.arch

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 …

Member Avatar for jlm699
0
141
Member Avatar for wirth.jason

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 …

Member Avatar for jlm699
0
1K

The End.