Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.

learn more… | top users | synonyms (2) | python jobs

0
votes
0answers
9 views

python no module name pika when importing pika

I installed pika for python running on a mac sudo pip install pika==0.9.8 I make sure is installed, this is the response when trying to reinstall, Requirement already satisfied (use --upgrade to ...
0
votes
0answers
6 views

import error in celery

this is the code which i am running: from __future__ import absolute_import from celery import Celery celery1 = Celery('celery',broker='amqp://',backend='amqp://',include=['tasks']) ...
0
votes
0answers
12 views

Save raw data as tif

I need to analyze a part of an image, selected as a submatrix, in a tif file. I would like to have the image in raw format, with no frills (scaling, axis, labels and so on)... How could I do that? ...
1
vote
0answers
12 views

Issue getting the beginning of a max subarray

I am trying to implement a method to get the maxSubArray sum and the associated beginning and end indices. For reference, the maxSubArray is the contiguous subArray whose integer sum is the largest ...
0
votes
0answers
10 views

How to *remove* Homebrew python from OS X?

tl;dr: How safe is sudo rm -rf /usr/local/Cellar/python? Having two installations of python on my Mac has been a horror-show. I started out when Mountain Lion's default installation of Python was ...
0
votes
3answers
29 views

Python spacing and %

I need to output this: Video Games: 8/8 (or 100.0%) This is the code for the mark out of 8: total = points+pointsTwo+pointsThree+pointsFour How would I write this code to output exactly what I ...
0
votes
2answers
31 views

is it possible to create a dictionary “template” in python?

I'm creating a recipe selector of sorts and am looking to create a unified dictionary template. I currently have something like this: menu_item_var = {'name': "Menu Item", 'ing': (ingredients)} ...
0
votes
3answers
27 views

my Tic tac Toe isn't Working

tic tac toe problem. a=0 def runx(): answer = int(input("answer:")) if answer == 1: if a==1 or a==2: print("nope") if a==0: ...
0
votes
1answer
20 views

Add to set within a set?

I'm using MongoEngine in Python to work with my data model. I have a data model which essentially looks like this as represented in BSON: { 'id': ... 'revisions': [ { ...
0
votes
1answer
13 views

How to change what an object is referring to within a function for all functions

I'm implementing rehashing of dictionaries, so i have 2 hash tables, and i am trying to set the old one to refer to the new one. i have something along the lines of: def fart(hashTable): ...
0
votes
0answers
6 views

UserWarning: X scores are null at iteration

I am trying to run CCA for a multi label/text classification problem but keep getting following warning and an error which I think are related warnings.warn('Maximum number of iterations reached') ...
0
votes
0answers
11 views

Portable way to start process upon system bootup in Linux and Solaris

What would be a decent portable way to start a process upon bootup in Solaris 10, Solaris 11, and various Linux distros? My understanding is that the "inittab" way became deprecated. Solaris now has ...
0
votes
1answer
23 views

how to calculate startdate and enddate from basic from multiple dictionaries to list of dictionary

How to get from multiple dictionary to list of dictionary and need to calculate startdate and enddate from basic [{'basic': 1000.0, 'end_date': '2011-01-31', 'start_date': '2011-01-01'}, {'basic': ...
0
votes
0answers
49 views

Python create dictionary

I am playing with BeautifulSoup and scraping bing search results. I don't plan on doing extensive scraping, I was just trying my hand at different data structures, etc. What I'm trying to do is ...
0
votes
0answers
10 views

In Sublime Python console, how can I locate a class and method that a console run command runs?

From the console >>> sublime.run_command('test_application_args',{'arg1':'5', 'arg2':'4'}) running TestApplicationArgsCommand arg1: 5 arg2: 4 I want to find what .py file has that command, ...

15 30 50 per page