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)

0
votes
0answers
23 views

Some help on passing variables to subprocess

I need some help on the logic here. I want to query the RPM DB in Linux and get information out of every .rpm and store it. Like this: for this.rpm: name:..., version:..., description:... In Linux I ...
4
votes
1answer
197 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 ...
0
votes
0answers
17 views

ajax request not being called from javascript function in django [migrated]

This is a full flow which has to be taken care here. I am coding in Django/Python/Web Development. I have an html page which has got a dummy button which is triggering all the functions that I want ...
-1
votes
0answers
33 views

Hi, is posible to create a Python code for Face Recognition(OPENCV), using MySQL as database? [on hold]

i want to create a Face Recognition code, using Python(OPENCV) and store their values on MYSQL database, then with other code, compare both. I don't want in my database, images, only values and ...
0
votes
0answers
18 views

What is a good language to do both CSV read/write and XMLHTTP requests? [on hold]

I'm looking for a language to use that has good libraries for reading and writing a CSV and for performing XMLHTTP requests. Right now, I'm looking at Python and Perl as my top choices. I know PHP ...
0
votes
0answers
6 views

How to determine the newly closed file within a continuous audit log rotation? [migrated]

I am attempting to find the best way to determine when the second file (of a matching criteria) is created. The context is an audit log rotation. Given a directory where audit logs are created every ...
19
votes
4answers
16k views

Is Python Interpreted or Compiled?

This is just a wondering I had while reading about interpreted and compiled languages. Ruby is no doubt an interpreted language, since source code is compiled by an interpreter at the point of ...
10
votes
2answers
166 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 ...
-2
votes
0answers
33 views

Develop own MVC for Python (User defined custom framework) [on hold]

I have been creating many PHP applications and have also developed many applications based on the custom MVC that I have developed. When I started learning PHP MVC, I learned it from JREAM MVC for ...
0
votes
0answers
12 views

remove stop words from arabic corpora [duplicate]

how to remove stop words from corpus in Arabic language using python? i tried to write code for that but the problem appear they couldn't find matching with stop words which read from other text file. ...
0
votes
0answers
32 views

Checking that a function is only run from __main__ in Python

I often end up with code files that can either be imported or run as __main__. It's easy to handle this by checking if __name__ == '__main__'. But sometimes if my main function gets too big I split ...
4
votes
2answers
190 views

What are the key differences between Java's and Python's OOP support? [on hold]

The only language I've ever used is Java. I like it a lot but decided it's time to learn another language :) . I'm interested in learning Python. It seems like a good choice because it's partly ...
-3
votes
0answers
25 views

python programming error - not printing out correctly [closed]

I have this code that is supposed to print out the least occurring vowel when a word is inputed, but it doesn't print out a vowel and the least value. here is my code: #Program to count the least ...
0
votes
0answers
20 views

How to extract the attributes of a function of an instance passed as a function? [migrated]

How can I extract the attributes of the "SimpleSubscriber object from the following method object? <bound method SimpleSubscriber.process of <__main__.SimpleSubscriber object at ...
0
votes
1answer
76 views

Javascript function should call python logic in django web development without additional triiger

I have been trying to solve this problem for sometime now. This is regarding django web development. I have an HTML page which has a Javascript function to upload an image file from the users local ...
-1
votes
0answers
33 views

removing stop words from unicode annotated arabic corpus in puthon [closed]

i want to remove stop words from Unicode annotated corpus in arabic language i have read the text from file but i couldnt find matching with stopwords? any one can help me please? Note: i'm using ...
0
votes
0answers
8 views

Python logging wont shutdown [migrated]

I have been learning the python logging module but have been having problems getting the logging to shutdown after it's done. Here is an example - import logging log = logging.getLogger() ...
0
votes
0answers
45 views

What other technologies/other skills should I develop in my hunt for a job in development/research? [closed]

The question up-top sounds fairly vague but bear with me... I have developed some intermediate-advanced skills in PHP/JavaScript/Python and a few other languages. I've done so through the course of my ...
-3
votes
2answers
185 views

A newbie in python trying to learn [closed]

Am trying to learn how to program before i go to uni and i stumbled upon a question which i have been unable to do. In the function write code to input two integers m and n and calculate and display ...
2
votes
2answers
67 views

where exactly should python business logic be placed in django

I have just begun to learn Django/Python/Web Development. This problem has been troubling me for a while now. I am creating an application with multiple templates in Django. I have a views.py which ...
0
votes
2answers
160 views

Google App Engine overview

I have gone through many Google App Engine tutorials, and I became quite familiar with how to do basic stuff like implementing a webapp2.RequestHandler, and using ndb.Models to manage your data. Now, ...
3
votes
1answer
51 views

optimize human-readable database with index

i need to store a large amount of data - about 10 million entries of the format unique hash (64 chars), value 1 (5 chars), value 2 (9 chars) i will be reading and deleting (but not updating) this ...
24
votes
6answers
8k views

Programming language usage at Google

I have heard Google uses Python, Java and C++. But what I don't know is how is each of those programming language is used. I mean what is Python, Java and C++ is used for at Google. Why would they ...
0
votes
0answers
19 views

How to deal with multiple output modes of multiple types?

Note: The business domain being a bit complicated to explain, I replaced the names of actual classes by more illustrative examples. I'm writing an application in which the business layer returns a ...
-1
votes
0answers
15 views

How to import mysql modules in Python? [migrated]

As you are aware, I am a complete noob on this. I am trying to use this reusable class to connect to mysql Python Connection with MySQL But whenever i try to run the python I am getting Traceback ...
0
votes
0answers
23 views

Abstracting away scrapy's parse() method - good idea or not?

We use Scrapy quite a bit at work, and recently it's been decided that the spiders we write with it are all too 'different' in the way they're written and could use a little bit of 'standardization' ...
2
votes
0answers
66 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 ...
2
votes
2answers
75 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
13 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
54 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 ...
1
vote
1answer
58 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 = ...
1
vote
2answers
119 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
100 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 ...
1
vote
1answer
389 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?
0
votes
1answer
69 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
307 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: ...
1
vote
1answer
493 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
56 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
66 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
79 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
28 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
99 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
66 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 ...
-2
votes
2answers
54 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". ...
-1
votes
2answers
45 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
405 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 ...