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.
0
votes
0answers
4 views
Sum values in a Python dict?
How to sume in ptyhon dict when I add the same key?
d = {'key1':10,'key2':14,'key3':47}
d['key1'] = 20
I would get sume of key1 - 30
It is possible?
0
votes
0answers
4 views
Python Bottle how to pass parameter as json
I created an api for openerp using bottle
It works well while access using browser
I don't know how to pass it as json parameters
The Problem is
how can i call using api and pass json parameters ...
0
votes
0answers
7 views
If I send a a Signal from a function, what should the “sender” argument be?
If I send a Signal from a module function (a django view function as it happens), that is not inside a Class, it's not obvious (to me) what the sender should be - if anything? Is sender=None ...
0
votes
0answers
9 views
Set color to be used for an array masked values plotted with matplotlib contourf
When I plot an array with masked values, using matplotlib countourf, the masked values appear white. I want them to appear grey.
I tried the set_bad method, but it seems countourf doesn't recognize ...
-2
votes
0answers
31 views
Does anyone knows which is the best book for learning Python? [closed]
I know a l'il bit of C++, but now I am thinking to learn Python as well. So, is there any good book that teaches all the concepts of Python from the ground?
Thanks, in advance!
0
votes
0answers
8 views
Preserve exif data of image with PIL
When I try to resize (thumbnail) an image using PIL, the exif data is lost.
What do I have to do preserve exif data in the thumbnail image? When I searched for the same, got some links but none seem ...
1
vote
1answer
27 views
Python: Special characters encoding
This is the code i am using in order to replace special characters in text files and concatenate them to a single file.
import os
import codecs
dirpath = "C:\\Users\\user\\path\\to\\textfiles"
...
0
votes
0answers
5 views
resize wx.ListCtrl after creation
so I have a listctrl created and added to sizer.
import wx
class myFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, parent=None)
panel1=wx.Panel(self)
...
0
votes
0answers
9 views
loop http client python , twisted
I have A simple Client which sends a request to server and receives a response :
from StringIO import StringIO
from twisted.internet import reactor
from twisted.internet.protocol import Protocol
...
0
votes
3answers
30 views
writing multiple out files from for loop
out_file = open('result.txt', 'w')
A = [1,2,3,4,5,6,7,8,9,10]
B = [11,12,13,14,15]
for a in A:
for b in B:
result = a + b
print (result, file = out_file)
out_file.close()
The ...
0
votes
1answer
17 views
synchronize access to python object
I am looking for a general and simple way to synchronize the methods of a python class that does not use asynchronous calls by itself.
Some possibilities come to my mind:
First, the use of decorators ...
1
vote
1answer
9 views
Creating a sparse index with pymongo
I need to create a sparse index from the python script using pymongo.
It seems like both collection.create_index and collection.ensure_index don't support sparse option.
According to the mongodb ...
1
vote
1answer
35 views
How Could Python iterate the directoriy and detect the new files?
How can I iterate all files and subdirs in a Dir,
and can detect new file when put there?
Thank you for your help!
0
votes
0answers
11 views
How to customise Django admin for subclasses depending of its type?
I have a simple inheritance at one of the models
class ParentClass(models.Model):
attribute1 = models.CharField()
attribute2 = models.CharField()
......
child_type_choices = (ChildClass1, ...
1
vote
0answers
11 views
selenuim python bindings - mouse over action
Related to selenuim python bindings - mouse over action
Hi all,
Tried this code to perform hover action,still not working
from selenium import webdriver
from selenium.webdriver.common.action_chains ...