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
5 views

Can I get a list of the variables that reference an other in Python 2.7?

Imagine I have: X = [0,1] Y = X Z = Y is there a function like referenced_by(X) that returns something like ['Y','Z']? And a function like points_to(Y) that returns 'X'? I know there is is to ...
0
votes
0answers
4 views

String to float and regex

I have a problem with regex and my string... I need a solution in my regex code for take a float number of a string. I don't know why this code doesn't work. from bs4 import BeautifulSoup import ...
0
votes
0answers
2 views

HCI Socket with Python on Windows

In Linux i can easily get a raw HCI socket to a bluetooth adapter: import socket s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_RAW, socket.BTPROTO_HCI) which does not work in windows. First of ...
0
votes
0answers
14 views

branch and bound code in python

I found that code in stackoverflow: import Queue class Node: def __init__(self, level, profit, weight): self.level = level # The level within the tree (depth) self.profit = profit # ...
0
votes
0answers
10 views

comparing dynamic number of lists (non-equal length) for common entries in Python

I'm trying to compare lists of different number and length that have been generated dynamically by user input and pattern matching. I haven't included all the matching code, but you should get the ...
0
votes
3answers
29 views

Converting comment // with /* with Python re

In my C program, I should convert every "// comment" with "/* comment */" I thought of the code below with Python re, but could't come up with any idea of how to insert */ before at the end of the ...
0
votes
0answers
7 views

Terminate processes create by python subprocess (zombie)

I have the following code: cmd = ["sudo", "-u", "user", "python3", "/path/to/project.py"] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ...
0
votes
0answers
14 views

use list item as table name

I have a dict containing the table name and some of its columns. queryValues = {'severity': ['minor'], 'product' : ['foobar'],'tableName' : ['myTable']} I would like to use the tableName value as a ...
0
votes
2answers
15 views

is it possible to change working directory when executing a .py file in different folder?

For example,here is my directory tree: +--- test.py | +--- [subdir] | +--- another.py test.py: import os os.system('python subdir/another.py') another.py: import os ...
0
votes
1answer
18 views

nested list filtering in python?

is it possible to create nested filtering for list? I have a list of bookmarks that contains a list of tags. I want to filter for bookmarks with a specific tag. def filterListByTag(bookmarkList, ...
-1
votes
0answers
27 views

Convert this PHP script to PYTHON

I want to use this upload form in my website : http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/ However I can't use PHP. I would like to call a script python (upload.py) : <form ...
0
votes
0answers
7 views

Django-facebook importing middleware facebookconnect.middleware error

I developed a django application,for my application the user login is based on facebbok account.i download facebookconnect and integrate with my application and create the database and run the sever ...
1
vote
0answers
17 views

Please clarify the following Python numpy array initialization and splicing examples

I am using Python version 2.6 and learning numpy version 1.3. I have tried out several numpy array initialization and column splicing examples below, and added some inline questions as comments and a ...
1
vote
2answers
21 views

How to backup and restore python current working environment?

I want to write a function 'backup(filename)' to store all the working data (objects?) under current environment of Python, and 'restore(filename)' to restore the data/object again. Just like R's ...
0
votes
0answers
3 views

How does one make a twistedmatrix subprocess continue processing after the client disconnects?

I`m creating a twisted tcp server that needs to make subprocess command line call and relay the results to the client while still connected. But the subprocess needs to continue running until it is ...

1 2 3 4 5 13541
15 30 50 per page