473,554 Members | 2,917 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.
43
2,643
thread by: Mladen Adamovic | last post Feb 24 '06 by: Ben Wilson
Hi! I wonder which editor or IDE you can recommend me for writing Python programs. I tried with jEdit but it isn't perfect.
43
3,342
thread by: Tim Chase | last post May 5 '06 by: Mel Wilson
Just as a pedantic exercise to try and understand Python a bit better, I decided to try to make a generator or class that would allow me to unpack an arbitrary number of calculatible values. In this case, just zeros (though I just to prove whatever ends up working, having a counting generator would be nice). The target syntax would be...
43
2,693
thread by: michael.f.ellis | last post Jun 5 '06 by: Alex Martelli
The following script puzzles me. It creates two nested lists that compare identically. After identical element assignments, the lists are different. In one case, a single element is replaced. In the other, an entire column is replaced. --------------------------------------------------------------------------------------- ''' An...
43
4,281
thread by: parallelpython | last post Feb 5 '07 by: parallelpython
Has anybody tried to run parallel python applications? It appears that if your application is computation-bound using 'thread' or 'threading' modules will not get you any speedup. That is because python interpreter uses GIL(Global Interpreter Lock) for internal bookkeeping. The later allows only one python byte-code instruction to be executed...
43
1,474
thread by: Sergey Dorofeev | last post Feb 22 '07 by: greg
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win32 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate tuple (not "list") to tuple Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError:...
43
6,391
eof
thread by: braver | last post Dec 8 '07 by: jjnoakes
I'd like to check, for a filehandle f, that EOF has been reached on it. What's the way to do it? I don't want to try/except on EOF, I want to check, after I read a line, that now we're in the EOF state. In Ruby it's f.eof: In Ruby: =#<File:jopa> ="jopa\n" =true
43
3,185
thread by: kenneth | last post Oct 21 '08 by: David C. Ullrich
Dear all, I have encountered this weird problem. I have a class definition with an __init__ argument 'd' which defaults to {}. This argument is put in the 'self.d' attribute at initialization I create two independent instances of this class; the code is as follows.
44
2,594
thread by: Will Stuyvesant | last post Jul 18 '05 by: Ionutz Borcoman
Suppose you have the time and the money to start a new project in Python. What would you like to do? I can think of: - A civilization like game in Python, with multiplayer support via twisted. - An easy to use tool for drawing diagrams, typically various kinds of arrows and circles and boxes, that produces nice .eps and .svg files.
44
3,372
thread by: Carl | last post Jul 18 '05 by: Jacek Generowicz
"Nine Language Performance Round-up: Benchmarking Math & File I/O" http://www.osnews.com/story.php?news_id=5602 I think this is an unfair comparison! I wouldn't dream of developing a numerical application in Python without using prebuilt numerical libraries and data objects such as dictionaries and lists. I have been experimenting with...
44
3,299
thread by: seberino | last post Jul 18 '05 by: Timo Virkkala
Tuples are defined with regards to parentheses ()'s as everyone knows. This causes confusion for 1 item tuples since (5) can be interpreted as a tuple OR as the number 5 in a mathematical expression such as x = (5) * (4+6). Wouldn't it have been better to define tuples with <>'s or {}'s or something else to avoid this confusion?? ...
44
2,491
thread by: Iwan van der Kleyn | last post Jul 18 '05 by: Robert Kern
Please ignore if you are allergic to ramblings :-) Despite a puritan streak I've always tried to refrain from language wars or syntax bickering; call it enforced pragmatism. That's the main reason why I've liked Python: it's elegant and simple and still dynamic and flexible. You could do worse for a clean and pragmatic language. I do know...
44
4,004
thread by: Xah Lee | last post Jul 18 '05 by: alanwo
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are identical with which. Write a program that prints out which file are redundant copies. Here's the spec. -------------------------- The program is...
44
3,716
thread by: flyingfred0 | last post Jul 19 '05 by: Cameron Laird
A small software team (developers, leads and even the manager when he's had time) has been using (wx)Python/PostgreSQL for over 2 years and developed a successful 1.0 release of a client/server product. A marketing/product manager has brought in additional management and "architecture" experts to propose moving the entire thing to a Java...
44
2,725
thread by: gregory.petrosyan | last post Nov 22 '05 by: Peter Otten
Hello everybody! I have little problem: class A: def __init__(self, n): self.data = n def f(self, x = ????) print x All I want is to make self.data the default argument for self.f(). (I
44
4,163
thread by: Tolga | last post Dec 16 '05 by: Brian van den Broek
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a good concept?
44
2,087
thread by: Joe | last post Jan 17 '06 by: Dave Hansen
Is Python going to support s syntax the does not use it's infamous whitespace rules? I recall reading that Python might include such a feature. Or, maybe just a brace-to-indentation preprocessor would be sufficient. Many people think Python's syntax makes sense. There are strong feelings both ways. It must depend on a person's way of...
44
4,150
thread by: Christoph Zwerschke | last post Jan 25 '06 by: Fredrik Lundh
In Python, it is possible to multiply a string with a number: >>> "hello"*3 'hellohellohello' However, you can't multiply a string with another string: >>> 'hello'*'world' Traceback (most recent call last): File "<interactive input>", line 1, in ?
44
3,663
thread by: jiang.haiyun | last post Nov 6 '06 by: John Henry
Now i began to learn GUI programming. There are so many choices of GUI in the python world, wxPython, pyGTK, PyQT, Tkinter, .etc, it's difficult for a novice to decide, however. Can you draw a comparison among them on easy coding, pythonish design, beautiful and generous looking, powerful development toolkit, and sufficient documentation,...
44
4,966
thread by: bg_ie | last post Aug 10 '07 by: Jay Loden
Hi, I'm in the process of writing some code and noticed a strange problem while doing so. I'm working with PythonWin 210 built for Python 2.5. I noticed the problem for the last py file processed by this script, where the concerned tmp file is only actually written to when PythonWin is closed. In other words, after I run this script, one of...
44
2,899
thread by: Steven D'Aprano | last post Sep 28 '08 by: Ben Finney
I have a class which is not intended to be instantiated. Instead of using the class to creating an instance and then operate on it, I use the class directly, with classmethods. Essentially, the class is used as a function that keeps state from one call to the next. The problem is that I don't know what to call such a thing! "Abstract class"...
45
2,543
thread by: Edward K. Ream | last post Jul 18 '05 by: Shalabh Chaturvedi
Hello all, First of all, my present state of mind re pep 318 is one of sheepish confusion. I suspect pep 318 will not affect Leo significantly, but I am most surprised that an apparently controversial feature is being added without a notice, say, in comp.lang.python.announce. I say sheepish, because everyone knows that one should make...
45
2,638
thread by: It's me | last post Jul 18 '05 by: Peter Hansen
I am new to the Python language. How do I do something like this: I know that a = 3 y = "a" print eval(y)
45
2,989
thread by: Joh | last post Jul 18 '05 by: Francis Girard
hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = would like to produce : , , , ,
45
2,747
thread by: Jordan Rastrick | last post Jul 19 '05 by: Steven D'Aprano
Can anybody please give me a decent justification for this: class A(object): def __init__(self, a): self.a = a def __eq__(self, other): return self.a == other.a s = A(3)
45
1,617
thread by: n.estner | last post Feb 14 '06 by: Christos Georgiou
Having read previous discussions on python-dev I think I'm not the only Python programmer who doesn't particularly like python's "self" parameter: class Foo: def bar(self, a,b): return a+b Foo().bar(1,2) => 3 The main reason (at least for me) is that there's simply too much

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.