Python is a dynamic, high-level language. Its design focuses on clear syntax, an intuitive approach to object-oriented programming, and making the right way to do things obvious. Python supports modules, exceptions, had an extensive standard module library. Python can also be embedded in other ...

learn more… | top users | synonyms (1)

5
votes
4answers
661 views

How to familiarize myself with Python

I'm a Python beginner. I started programming with Python 1.5 months back. I downloaded the Python docs and read some parts of the tutorial. I have been programming on codechef.com and solving ...
2
votes
1answer
389 views

How to approach web app development?

I have been going through Flask and it seems that now I have a decent understanding to go ahead and build a web application. However I want to know how would I approach the problem. For eg: I decide ...
15
votes
4answers
8k views

Purpose of `return self` from a class method?

I came across something like this in an open-source project. Methods that modify instance attributes return a reference to the instance. Would you trust code that is written like this? class ...
12
votes
2answers
2k views

SQLite with two python processes accessing it: one reading, one writing

I'm developing a small system with two components: one polls data from an internet resource and translates it into sql data to persist it locally; the second one reads that sql data from the local ...
9
votes
4answers
979 views

Python decorators and Lisp macros

When looking Python decorators someone made the statement, that they are as powerful as Lisp macros (particularly Clojure). Looking at the examples given in PEP 318 it looks to me as if they are just ...
8
votes
4answers
710 views

When to import names into the global namespace? (using x::y, from x import y etc.)

I've been programming in various languages for about 10 years now. And I still haven't figured out when it is a good idea to import something into the global namespace (using x::y in C++, from x ...
5
votes
10answers
4k views

Newbie, deciding Python or Erlang [closed]

I'm a Administrator (unix, Linux and some windows apps such as Exchange) by experience and have never worked on any programming language besides C# and scripting on Bash and lately on powershell. I'm ...
26
votes
4answers
3k views

Concrete examples of Python's “only one way to do it” maxim

I am learning Python and am intrigued by the following point in PEP 20 The Zen of Python: There should be one-- and preferably only one --obvious way to do it. Although that way may not be ...
12
votes
5answers
3k views

Is monkeypatching considered good programming practice?

I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd ...
12
votes
8answers
903 views

Thinking of simultaneously coding the same project in two languages. Good Idea?

Is this a good way to learn a new language? Or to develop a preference of one language? I was thinking of coding a project in both Python and Java. The only foreseeable problem is trying to transfer ...
9
votes
5answers
526 views

How is the JVM and Java's WORA different from other high level languages?

In the Java world, we often talk about the JVM, and when Java was new it had the supposedly killer feature of "Write Once, Run Anywhere." From the way people talk and write, this seems different from ...
8
votes
2answers
315 views

Why don't Python and Ruby make a distinction between declaring and assigning a value to variables?

Two of the most popular dynamically typed scripting languages, Python and Ruby, do not make a distinction in syntax between the declaration of a variable and assignation of a value to it. That is in ...
7
votes
1answer
1k views

Duck typing, data validation and assertive programming in Python

About duck typing: Duck typing is aided by habitually not testing for the type of arguments in method and function bodies, relying on documentation, clear code and testing to ensure correct use. ...
7
votes
9answers
5k views

Is there any good reason for someone who knows Python to learn Perl? [closed]

Reading the answers to Python vs. Perl in ten years time here on SE, most people seem to say go with Python. I agree (sorry Perl fans ;-) ). I already know Python, and I think it is a very good ...
4
votes
2answers
1k views

Caching factory design

I have a factory class XFactory that creates objects of class X. Instances of X are very large, so the main purpose of the factory is to cache them, as transparently to the client code as possible. ...
3
votes
1answer
2k views

Is it possible to use python as a shell replacement? [duplicate]

Recently I was looking at python's shutil and subprocess etc... And I started wondering: wouldn't it be ok to use python instead of e.g. bash? What am I missing?
2
votes
2answers
201 views

Changing __class__ in a factory?

I'm parsing a set of XML files of different kinds (these kinds are known in advance). These are my requirements: I want an object to represent each XML document (object-xml mapping) I'd rather ...
2
votes
3answers
555 views

How should I go about learning Python for website development? [closed]

I want to learn about developing websites with Python; how should I go about this? I am not new to programming, as I have knowledge in C#, ASP.NET, HTML, and CSS. What resources should I explore? I ...
2
votes
2answers
4k views

How to properly understand django framework? [duplicate]

I have decent knowledge of php, i.e., I can take a framework, read its code and if the docs are adequate, understand what its doing. Main reason for that is that php is actually a very easy language ...
2
votes
1answer
1k views

Python web frameworks comparisons

I recently asked a question on SO about Python web frameworks: http://stackoverflow.com/questions/4909306/python-web-frameworks-vs-java-web-frameworks-how-is-web-development-in-python-do I want to ...
0
votes
1answer
369 views

What are the external dependencies of a Python executable?

I guess there is a tool called Py2Exe to convert a Python application into an executable file. Since I am also using PyQt4 for GUI apps., what are the external dependencies for such an executable? ...
20
votes
5answers
1k views

Will Python 3.0's backwards-incompatibility affect adoption?

I visited Slashdot this morning to find out that Python 3.0 has been released. I know C# and Perl, but have wanted to learn Python for some time, especially after I saw its ease of use to create ...
17
votes
18answers
1k views

How do I “ease into” programming coming from a designer background?

Is there a way I can 'ease in' to programming. Like learning to use/modify CGI scripts to add some functions to a basic html site? Even if it's the only thing I learn it's still useful, right?. Unlike ...
11
votes
3answers
537 views

How is type checked in a dynamic language interpreter/compiler, such as JavaScript?

In dynamic languages, such as JavaScript or Python, the type of a variable is determined at runtime. This is one reason why they are slower than typed languages such as Java. How is type checking ...
10
votes
9answers
898 views

Omitting inheritance in programming languages

I am developing my own programming language. It's a general purpose language (think staticlly typed Python for the desktop, i.e. int x = 1; ) not intended for the cloud. Do you think it's okay not ...
9
votes
6answers
4k views

Would Python be too slow for client-side use in Browsers?

I've heard the statement that Python would be too slow to be of any use in browsers. I reckon Javascript is only superior in this aspect because of companies like Google who need it fast (and made it ...
7
votes
2answers
164 views

When profiling a function for time use, what information is desirable?

I'm writing a program similar to Python's timeit module. The idea is to time a function by executing it anywhere from 10 to 100,000 times depending on how long it takes and then report results. I've ...
4
votes
2answers
2k views

Python threading vs. multiprocessing: Should I learn one before the other?

I'm looking to dive into multithreading or multiprocessing in Python. Question: should I be learning one before the other (for any reason)? If so, which one and why? I've read the pro's and con's in ...
2
votes
2answers
611 views

One boilerplate class or many similar classes?

Lets say I'm trying to model a variety of objects that are virtually identical, the only difference being their class variables. Am I better off creating one boilerplate class and just calling the ...
2
votes
2answers
375 views

What was the need of introducing Python 3 when we already had Python 2 [duplicate]

I am still learning python and I started with Python 3. This question not Python 2 vs 3 or difference between them like print() is a function and not language construct and 3/2 = 1.5 My question is ...
2
votes
1answer
1k views

What should I think about when switching from Python to Java? [duplicate]

Possible Duplicate: Java dev learning Python: what concepts do I need to wrap my head around? I was a Java developer in the early 2000s, switched to Python in 2008 and now I am working in ...
1
vote
1answer
1k views

sorting using a custom definition of “>” and “< ” in python

suppose I have a custom function such as def greater(a, b): if (a % b) % 2 == 0: return 1 return 0 It defines how to compare two numbers and determine which is greater. In this ...
0
votes
3answers
235 views

How to balance programming projects between feasibility and usefulness [closed]

I've become fairly competent as a programmer, but I would not say I am a master. I work independently, most as a hobby, although I have done some freelance PHP work. I tend to find myself dabbling in ...
-1
votes
1answer
994 views

python login form vulnerability?

<HTML> <HEAD><TITLE>Login Page</TITLE></HEAD> <BODY> <CENTER> <FORM method="POST" action="http://yourserver/cgi-bin/login.py"> <paragraph> Enter ...