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)

-2
votes
0answers
27 views

Python code to find unique combinations of factors of a number [on hold]

I have the below code which prints the unique combination of factors of a given number. But I does not give the desired output. The code is a s follows: #Print the factors list for the given number ...
2
votes
2answers
60 views

subclass reference to another subclass

Imagine I have the following code: class A: pass class B(A): pass class C(A): def __init__(self): self.b = B() Is the above code correct in terms of correct inheritance? I ...
0
votes
0answers
6 views

Defining property and find substitution for copy function of python in cython

I want to cythonize a code in python to speed up the code. In the following you can see my attempt to make my python class understandable for cython: import numpy as np cimport numpy as np ctypedef ...
2
votes
1answer
43 views

Python API: Extension Module or Pure Module

We have a C++ application, with C++ interfaces changing regularly during development. We also have a C API which is designed to be stable in spite of such changes; the C API is tighly focused on ...
-3
votes
0answers
50 views

How to build an application(dash board) to monitor Sybase ase database server by python? If so please share details [on hold]

In this moment we are monitoring sybase ASE database server by shell script(cron job) these data we are pushing to other database server what we call is monitoring server.After business hrs we are ...
8
votes
2answers
115 views

Early attempt to remove Python GIL resulted in bad performance: Why?

This post from Python creator, Guido Van Rossum, mentions an early attempt to remove the GIL from Python: This has been tried before, with disappointing results, which is why I'm reluctant to ...
1
vote
1answer
53 views

Adding new functionality to all of shelve.Shelf's subclasses in Python

In order to avoid the overhead associated with the shelve module's writeback option I'm interested in putting together a shelf class that only accepts hashable values, with hashability being a proxy ...
-2
votes
0answers
20 views

Syntax error in visual studio [migrated]

I started Udacity's Intro to Comp Sci course today, and generated this code at the end of the first lesson: page = '<a href="http://udacity.com">Hello world</a>' start_link = ...
-4
votes
0answers
40 views

Which MVC framework to pick for my project and why? [on hold]

I'm building a reporting application that I expect to deploy in different financial organizations. The choices I have are Java on Play, Django or Ruby on Rails. I have played around with rails and it ...
1
vote
2answers
114 views

Can a version of Python's shelve module that knows when its entries have been modified be written in any programming language?

shelve is a Python module that makes it easy to persist a Python dictionary to disk (under the right conditions). The documentation for shelve gives this example to demonstrate one of the pitfalls of ...
-1
votes
0answers
139 views

Picking a language for writing code [on hold]

I'm in a situation, which I guess would've been encountered by all professional programmers at some point. For the same of rapid development, I chose to write modules in python. Soon, in our perf ...
-1
votes
0answers
70 views

Automatically expose large software library using web services? [on hold]

(Edited from initial post) Lets say I want to automatically generate web-service wrappers for some large arbitrary source code library (it doesn't matter which language). The aim is touch-free ...
-1
votes
0answers
98 views

Python service oriented application vs. non-service one

I'm looking forward starting a new web application with Python and I have some doubts before starting. My idea is building a web application and later maybe an Android/iOS mobile app. I am considering ...
-5
votes
0answers
34 views

Mixing arrays of different types in python [closed]

I'm trying to accomplish a certain task in Python that can be best described in short through the following example scenario. Suppose I want to calculate an array representing the polynomial ...
1
vote
1answer
385 views

Is there a module for writing low level code on Python?

Can you manipulate bits and memory directly using Python? If yes, wouldn't that be a best option to dealing with performance-critical spots than C bindings?
-1
votes
0answers
35 views

Forging SSL/TLS packets with Scapy (python) [closed]

My question is barely short and simple. I am trying to forge some SSL/TLS packets but I didn't found any librairies on Scapy so far. Are they some public SSL/TLS libs for Scapy? By SSL/TLS packets, I ...
0
votes
0answers
40 views

Why 'find' works but 'in' does not in this program [closed]

Some of you will recognize this from the EDX MIT 6.00.1x Course. So the idea is it checks a list of letters against a word and prints out letters that are found and leaves underscores where letters ...
-1
votes
0answers
18 views

how to create a SIP request with specific header fields values [closed]

I'm an intern at a telecommunications operator and my task is to create an application that enables me to send sip (session initiation protocol) requests with the header fields values that i specify , ...
0
votes
0answers
93 views

Using Python to traverse a parent-child data set [migrated]

I have a dataset of two columns in a csv file. Th purpose of this dataset is to provide a linking between two different id's if they belong to the same person. e.g (2,3,5 belong to 1) e.g 1. COLA ...
0
votes
1answer
64 views

Making a sldprt to PDB file converter?

I wanted to create a parser that can read a solidworks file and turn it into a protein data bank file. This has already been done in a program called DiamondCAD. ...
10
votes
5answers
2k views

Is it considered Pythonic to have multiple classes defined in the same file?

In working with python for the first time, I've found that I end up writing multiple classes in the same file, which is opposed to other languages like Java, which uses one file per class. Usually, ...
0
votes
1answer
286 views

Front-end structure of large scale Django project

Few days ago, I started to work in new company. Before me, all front-end and backend code was written by one man (oh my...). As you know, Django app contains two main directories for front-end: ...
-3
votes
0answers
61 views

High level programming or event driven programming? [closed]

In your opinion, which do you find more effective, event driven programming or high level programming? Please explain your answer simply (I'm not a genius!)
-1
votes
0answers
59 views

Python Script running without installing python [closed]

I am a beginner in Python/Web development/Django Framework. I have python installed in my local computer (A).I have written an application in Python language using the Django framework which works as ...
-4
votes
1answer
178 views

High level languages compared with visual programming environments [closed]

Could I have a professional view on the effectiveness of visual block-based programming environments ( a program such as 'blockly' or 'scratch' or 'app inventor') in comparison to high level ...
1
vote
1answer
482 views

scons and python unit tests best practices

I am using scons to build a large project containing a mix of C++ and Python. I would like scons to run Python unit tests either using nose or not. Currently, we have a long list of tests files and ...
0
votes
1answer
49 views

Measuring performance of a network simulator?

I have written a python program to test a new network routing algorithm, that uses a Content Centric Network Approach for handling requests (CCN), where the CCN router keeps 3 data structures: A ...
1
vote
1answer
62 views

Using class like an object in Python

I am learning from Learn Python the hard way where I have come across a study drill where they want to know that whether a class can be used like an object. As I have experimented: class A(object): ...
1
vote
2answers
77 views

How would I change the precision of a variable in Python?

I'm working on a 2D-physics engine, and I need a certain variable to be precise only to the hundredths. Are there any methods for basically shaving off all of that unneeded precision? I have tried ...
0
votes
0answers
25 views

API providing function to be run in a thread vs. thread that runs this function

I'm writing a Python library which exposes a certain event listener interface. The user can register callbacks to handle different types of events. There is also a function which handles the actual ...
3
votes
2answers
74 views

Object identification in Python

In learning Python, I found that when two "names" (or "variables") are assigned to the same value, both of them point to the same memory address. For example >>> a = 10 >>> b = 10 ...
0
votes
1answer
79 views

How to avoid Memory Error

I am working with quite large files (pytables) and I am having problems with the Memory Error when I try to load the data for processing. I would like some tips about how to avoid this in my python ...
24
votes
4answers
4k views

Should I stick with or abandon Python to deal with concurrency?

I have a 10K LOC project written in Django with quite a deal of Celery (RabbitMQ) for asynchronicity and background jobs where needed, and have come to the conclusion that parts of the system would ...
2
votes
1answer
62 views

Random forest ML algorithm suitable for use on cluster based HPC?

I need help in identifying a better algorithm. I have developed a script using pythons scipy package to analyse a rather large model that I wish to solve. The model contains over 12GB of data ...
0
votes
0answers
14 views

How to change the content of a string in python [migrated]

I have a blog in the following website http://ecosdobigbang.com/ where I'll post material that is relevant to Physics students that speak portuguese (the target audience of this post are physics ...
-2
votes
2answers
53 views

Is the tool pywebsocket suited for production? [closed]

Is it a good idea to use pywebsocket in a production environment, since it is so widely used, but their google developer page states "pywebsocket is intended for testing or experimental purposes". ...
2
votes
0answers
59 views

The inheritance argument of zope.interface (providedby vs isinstance)

What limitations does inheritance of an interface through an abstract base class present that are addressed by zope.interface? In the following talk given in 2010 by Jeff Rush about interfaces, at ...
-1
votes
0answers
4 views

Cookies in python [migrated]

I am trying to write a script in python which uses the Cookie library to set cookies. I have written the following method: import uuid import Cookie import sys import os def send_cookie(key, value, ...
-1
votes
2answers
42 views

Minima of a convex list using binary search [closed]

A list is strictly convex if its elements first decrease then increase. How can I write a function in python that accepts a convex list and returns its minima in time complexity O(log(n)), n being the ...
5
votes
3answers
401 views

Multiple sites with the same codebase in Python

I am trying to run a large amount of sites which share about 90% of their code. They are simply designed to query an API and return the results. They will have a common userbase / database but will be ...
0
votes
0answers
131 views

Extending user registration in Django site that uses both site admin tables and my own module?

I'm writing a Django site that registers a particular type of user and this is done by the resources that come with the framework, the site administration. The issue: I'd like to create a new model ...
1
vote
1answer
90 views

Is it possible to have a mutable type that is not garbage collected?

I'm wondering if such a thing can exist. Can there be an object that is mutable but not flagged as garbage collected ( specifically, tp_flags & Py_TPFLAGS_HAVE_GC ) I have a C++ struct-like ...
1
vote
4answers
398 views

Multiple attribution in Python, JS, …?

I accidentally discovered this a=b=c=d=e=f=2 in python(2.7)(and JavaScript a few minutes later) interpreter . Is this a feature or just the way the interpreter works, if is a feature how it is ...
36
votes
7answers
3k views

Are small amounts of functional programming understandable by non-FP people?

Case: I'm working at a company, writing an application in Python that is handling a lot of data in arrays. I'm the only developer of this program at the moment, but it will probably be ...
-3
votes
1answer
150 views

Is it recommended to use more than one language at a startup? [closed]

I work for a mobile startup where, for historical reasons, our chosen language was C#. I was recently assigned to a small project to build a tool that would be used by us internally. When I explained ...
0
votes
1answer
252 views

Why isn't there a python compiler to native machine code?

As I understand, the cause of the speed difference between compiled languages and python is, that the first compiles code all way to the native machine's code, whereas python compiles to python ...
2
votes
1answer
65 views

Single python file distribution: module or package?

Suppose I have a useful python function or class (or whatever) called useful_thing which exists in a single file. There are essentialy two ways to organize the source tree. The first way uses a single ...
4
votes
0answers
175 views

Creating a bare bone web-browser: After the html parser, javascript parser, etc have done their work, how do I display the content of the webpage? [closed]

This is a personal project to learn computer programming. I took a look at this: https://www.udacity.com/course/viewer#!/c-cs262 The following is the approach taken in it: Abstract Syntax Tree is ...
0
votes
0answers
53 views

Converting large files in python

I have a few files that are ~64GB in size that I think I would like to convert to hdf5 format. I was wondering what the best approach for doing so would be? Reading line-by-line seems to take more ...
0
votes
1answer
290 views

Sprite Sheets in PyGame?

So, I've been doing some googling, and haven't found a good solution to my problem. My problem is that I'm using PyGame, and I want to use a Sprite Sheet for my player. This is all well and good, and ...