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
3 views
How to save XLSM file with Macro, using openpyxl
I have .xlsm file with a Macro function. I'm loading it using openpyxl and write some data to the file and finally want to save as a different .xlsm file.
To save the file as XLSM file I have used ...
0
votes
0answers
4 views
How to add css style to GtkBox in Gtk+ 3
I wanna to create an Ubuntu application with GTK+ 3 and Python, but i'm new to GTK.
i have a css style of gtkbox in below image, but how can i add this style to my GtkBox/GtkVBox object to be like in ...
0
votes
2answers
22 views
Replace string element with split method
I need to change the number in a string like "Higher id: 38".
I can get "38" with string.split(" ")[2], do you know if there is a simple way to change this value?
I tried comment.split(" ")[2] = ...
0
votes
1answer
11 views
Unable to insert values to mysql using python
I am trying to insert values to mysql using python but the code is not working, its returning a blank page & no values written in database table, Please help me
import MySQLdb as mdb
con = ...
1
vote
2answers
24 views
how to copy class object in an array in Python
I have defined a Color class as below. Since I need to store multiple colors and their respective node ID (which has the color), I made a list colors to store them. However, every time a node color is ...
0
votes
0answers
3 views
pyBluez python server - phone don't see my server
first i'm sorry if my english is not very good because i'm french.
I'm a beginner on bluetooth development with pyBluez (i already know TCP and UDP sockets) and i have a little problem with the ...
0
votes
1answer
17 views
invalid literal for int() with base 10 ..reappearing white spaces?
I'm trying to plot data from a textfile.
My data is in the form of:
2 - 5 6 6
4 - 5 6 7
6 - 5 6 3
8 - 5 6 3
1 0 - 5 6 4
1 2 - 5 6 4
1 4 - 5 6 3
Here is my terminal report up to the error in ...
-1
votes
3answers
36 views
String Equivalency
What function can give me the result:
if "ABCDE" == "abcde":
return "ABCDE"
or
if "abcde" == "ABCDE":
return "abcde"
I know that these are not technically equal but I'm looking for ...
0
votes
0answers
12 views
Python Memcache
Hello I'm new to Memcache.I have 5 Memcache servers (version 1.22) and I'm using Python memcache library.When I use one server all works fine but when I use memc.set_servers(memcL) to configure the 5 ...
0
votes
1answer
7 views
Matplotlib: Two x-Axis with inverse scaling
I have an x-y pair, for which I want to plot y over one x-axes and under one x'-axes with different scalings. (x' = f(x)). Although there are several questions/answers for linear scaling on the net, I ...
-1
votes
1answer
13 views
How to use django-redis package?
I am new to redis(No-SQL). I am using django-redis package in my project. How to configure database settings in my django project. Is there any need to use other databases like MySql etc. If any one ...
0
votes
0answers
9 views
Open UDP-Links with Python?
I have a Python script here which should check if a stream works. First I wanted to check the Radio-Streams which are http-Links. I used urllib2 and it works perfectly.
working_streams = []
...
0
votes
0answers
5 views
Python opencv feature detector causes segmentation fault
I'm using Python 2.7 and opencv version 2.4.2. I'm having trouble with a segmentation fault.
Here is the code I try:
import cv2
img = cv2.imread(img_path)
img2 = cv2.cvtColor(img, ...
0
votes
0answers
23 views
Truncate file in front
Are there efficient possibilities to truncate the front of the file?
For example: I want to truncate the first 100 bytes of a file.
An inefficient approach would be to read the file, truncate the ...
0
votes
1answer
21 views
How do I refer indirectly to a method defined in a class when I have multiple ojects
Sorry for the clumsy title of the question but I can't think of a suitable way to express it. I am working on a calendar-type application in Python 2.7. I have a class Day which has a constructor of ...