473,554 Members | 3,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
41
2,491
thread by: Petr Jakes | last post Jan 28 '06 by: Petr Jakes
Hello, I am trying to study/understand OOP principles using Python. I have found following code http://tinyurl.com/a4zkn about FSM (finite state machine) on this list, which looks quite useful for my purposes. As this code was posted long time ago (November 1998) I would like to ask if the principles used in this code are still valid in the...
41
2,321
thread by: km | last post Sep 6 '06 by: lcaamano
Hi all, Is there any PEP to introduce true threading features into python's next version as in java? i mean without having GIL. when compared to other languages, python is fun to code but i feel its is lacking behind in threading regards, KM
41
3,348
thread by: rick | last post Oct 23 '06 by: DaveM
Why can't Python have a reverse() function/method like Ruby? Python: x = 'a_string' # Reverse the string print x Ruby: x = 'a_string' # Reverse the string
41
2,077
thread by: Carl J. Van Arsdall | last post Feb 1 '07 by: Steve Holden
Hey everyone, I have a question about python threads. Before anyone goes further, this is not a debate about threads vs. processes, just a question. With that, are python threads reliable? Or rather, are they safe? I've had some strange errors in the past, I use threading.lock for my critical sections, but I wonder if that is really good...
41
13,802
thread by: Chris Lasher | last post Apr 10 '07 by: Bruno Desthuilliers
A friend of mine with a programming background in Java and Perl places each class in its own separate file in . I informed him that keeping all related classes together in a single file is more in the Python idiom than one file per class. He asked why, and frankly, his valid question has me flummoxed. I tried to rationalize this Python...
41
2,507
thread by: none | last post Nov 29 '07 by: Hendrik van Rooyen
Hello, IIRC, I once saw an explanation how Python doesn't have "variables" in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? Thanks, Ami
41
1,584
thread by: process | last post Oct 5 '08 by: greg
I have heard some criticism about Python, that it is not fully object- oriented. What is not an object in Python? Why isn't len implemented as a str.len and list.len method instead of a len(list) function?
42
2,702
thread by: Jeff Wagner | last post Jul 18 '05 by: Fredrik Lundh
I've spent most of the day playing around with lists and tuples to get a really good grasp on what you can do with them. I am still left with a question and that is, when should you choose a list or a tuple? I understand that a tuple is immutable and a list is mutable but there has to be more to it than just that. Everything I tried with a...
42
3,652
thread by: Bicho Verde | last post Jul 18 '05 by: Mirko Zeibig
I have now free time and money to do what I want :-) I have some basic skills in programming (C, Pascal, Macromedia Actionscript) but don't know exactly what to do in the world of programming. And also I don't know exactly why would I learn Python rather than C#, C++ or Perl. Basicaly I don't know where to start, if there is much to do or if...
42
4,041
thread by: Fred Ma | last post Jul 18 '05 by: Fred Ma
Hello, This is not a troll posting, and I've refrained from asking because I've seen similar threads get all nitter-nattery. But I really want to make a decision on how best to invest my time. I'm not interested on which language is better in *general*, just for my purpose. My area of research is in CAD algorithms, and I'm sensing the...
42
2,193
thread by: j_mckitrick | last post Jul 18 '05 by: Mel Wilson
Yes, it's a silly question, but given how far we have come, why is it that a natural looking, easy to read, incredibly powerful language has appeared only recently, from a tech standpoint? I can't *believe* how much more productive I am with the built in data types and powerful expressions Python offers. It made me want to quit my C++ job....
42
2,583
thread by: Alan McIntyre | last post Jul 18 '05 by: Raymond Hettinger
Hi all, I have a list of items that has contiguous repetitions of values, but the number and location of the repetitions is not important, so I just need to strip them out. For example, if my original list is , I want to end up with . Here is the way I'm doing this now: def straightforward_collapse(myList):
42
1,469
thread by: RM | last post Jul 18 '05 by: Robert Kern
For all you GUI developers, things just got a little more interesting. Trolltech will soon be offering the QT GUI toolkit for Windows under the GPL license. That means that PyQt may become a much more popular option in the near future. Unfortunately, some things available for the commercial customers of Trolltech are not available to the GPL...
42
2,554
thread by: Irmen de Jong | last post Jul 18 '05 by: Paul Rubin
Pickle and marshal are not safe. They can do harmful things if fed maliciously constructed data. That is a pity, because marshal is fast. I need a fast and safe (secure) marshaler. Is xdrlib the only option? I would expect that it is fast and safe because it (the xdr spec) has been around for so long. Or are there better options (perhaps...
42
2,408
thread by: Gary Kshepitzki | last post Nov 30 '05 by: Alex Martelli
Hello I would like to create an API for a piece of Python code. The API is for use by non Python code. It should support interaction in both directions, both accessing functions on the API and the ability for the API to raise events on its client. What is the best way to do that? I though of doing it as a python COM server but I am not...
42
2,463
thread by: redefined.horizons | last post Apr 24 '06 by: bruno at modulix
I'm coming from a Java background, so please don't stone me... I see that Python is missing "interfaces". The concept of an interface is a key to good programming design in Java, but I've read that they aren't really necessary in Python. I am wondering what technique I can use in Python to get the same benefits to a program design that I...
42
3,408
thread by: Holger | last post May 8 '06 by: Holger
Hi guys Tried searching for a solution to this, but the error message is so generic, that I could not get any meaningfull results. Anyways - errormessage: ---------------------------------------------------- TypeError: addFile() takes exactly 1 argument (2 given) ----------------------------------------------------
42
3,826
thread by: kenneth.m.mcdonald | last post Sep 1 '06 by: paron
First, I don't intend this to be a flame war, please. Python and Ruby are the only two languages I'd willingly work in (at least amongst common languages), and TurboGears and Rails seem roughly equivalent. I'm much more knowledgable about Python, but that's a minor issue--I've been intending to learn more Ruby anyway. Here are the pros...
42
5,420
thread by: John Doty | last post Oct 16 '06 by: Elizabeth D Rather
I realized that I have a little job on the table that is a fine test of the Python versus Standard Forth code availability and reusability issue. Note that I have little experience with either Python or Standard Forth (but I have much experience with a very nonstandard Forth). I've noodled around a bit with both gforth and Python, but I've...
42
2,399
thread by: Hakusa | last post Oct 30 '06 by: ben.hamilton
Recently I've had some problems with PythonWin when I switched to Py2.5, tooka long hiatus, and came back. So now I'm without my god sent helper, and I'm looking for a cool replacement, or some advocation to reinstall/setup PyWin. But the Python website's list is irrefutably long. It would take a month or two to test all of those products. So...
42
4,829
thread by: psbasha | last post Mar 27 '07 by: inderjeetkalra
Hi, Is it necessary in Python to close the File after reading or writing the data to file?.While refering to Python material ,I saw some where mentioning that no need to close the file.Correct me if I am wrong. If possible could anybody help me with sample code for reading and writing a simple text file.I have seen there are many ways to...
42
1,749
thread by: Armin | last post Sep 18 '08 by: Steve Holden
Hi, just a dumb question. Let a = Why is the value of a.append(7) equal None and not ?? --Armin
43
2,999
thread by: 3seas | last post Jul 18 '05 by: Dang Griffith
If you are not interested, then don't bitch, its a short message. http://www.matrixcommunity.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=8;t=000918 I don't know if that link got broken. -- 3 S.E.A.S -- Virtual Interaction Configuration (VIC) Changing how we preceive and use computers email @ translate not to net, remove capitol letters,...
43
2,472
thread by: Dan Perl | last post Jul 18 '05 by: Steve Christensen
Here is a python feature that I would like: to be able to import modules from an archive like the jar files in Java. Maybe a regular tar file? Maybe a python specific file type, let's call it a 'par' file? It would be useful in packaging an python library. Sure, there's always the python packages, but a single file instead of a whole...
43
2,778
thread by: Roger L. Cauvin | last post Jan 28 '06 by: Armin Steinhoff
Say I have some string that begins with an arbitrary sequence of characters and then alternates repeating the letters 'a' and 'b' any number of times, e.g. "xyz123aaabbaabbbbababbbbaaabb" I'm looking for a regular expression that matches the first, and only the first, sequence of the letter 'a', and only if the length of the sequence is...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.