text
stringlengths
226
34.5k
NSUserNotificationCenter.defaultUserNotificationCenter() returns None in python Question: I am trying to connect to the Mountain Lion notification center via python. I've installed pyobjc and am following the instructions [here](https://github.com/maranas/pyNotificationCenter) and [here](https://gist.github.com/baliw/4...
Plotting mathematica data with python Question: This question is related to my previous question on ["publication quality plots in python"](http://stackoverflow.com/q/15988413/957560). I am trying to write a post processor (a bash script/python combo) that would comb through the thousands (literally!) of data files I ...
Pythonic method to sum all the odd-numbered lines in a file Question: I'm learning Python for a programming placement test I have to take for grad school, and this is literally the first little script I threw together to get a feel for it. My background is mainly C# and PHP, but I can't use either language on the test....
Finding All Neighbours within Range using KD-tree Question: I am trying to implement a [KD-tree](http://en.wikipedia.org/wiki/K-d_tree) for use with [DBSCAN](http://en.wikipedia.org/wiki/DBSCAN). The problem is that I need to find all the neighbours of all points that meet a distance criteria. The problem is I don't ge...
tkinter attribute error Question: I have the class BankAccount that I am using to create a GUI that allows the user to make a deposit, make a withdrawal, and see their balance. This is the BankAccount class code: class BankAccount(object): """ creates a bank account with the owner's...
Webpage with Javascript executing Python script with arguments Question: I have three files in the same directory. One is a python script, which takes argumenet. One is a html page with javascript. And the last one is a source .wav file. ./myfolder/sound_manipulation.py ./myfolder/volume_slider.html ...
How to look up the entries added to a table in last 5 seconds using Pymongo in python for mongodb Question: I require to look up the entries added to my mongodb collection which were created or added in the past 10 seconds . At present I do not have timestamp as part of the documents i have inserted into the collectio...
Can't get past a Django ImportError after running manage.py sync.db Question: Very new to coding. I've been trying to install this tablestacker: <http://datadesk.github.io/latimes-table-stacker/> And I'm running into problems with manage.py syncdb, and I can't get past this particular error. My hunch is: I have both Py...
How to call numpy/scipy C functions from Cython directly, without Python call overhead? Question: I am trying to make calculations in Cython that rely heavily on some numpy/scipy mathematical functions like `numpy.log`. I noticed that if I call numpy/scipy functions repeatedly in a loop in Cython, there are huge overhe...
python3 datetime.datetime.strftime failed to accept utf-8 string format Question: python3 `datetime.datetime.strftime` failed to accept utf-8 string format what I did is:: # encoding: utf-8 import datetime f = "%Y年%m月%d日" now = datetime.datetime.now() print( now.strftime(f) ) ...
Reading files and regex with PYTHON Question: i'm beginner in python and in programming in general, I'd like to create a script in python that can tell if the message was sent or not. after reading log files I've noticed that each message has a **mid** so i got an idea but i'm not sure... if i save all the mid in a lis...
what's the type of read() function's return value in python? Question: I write a program in python here. I wanna read a binary file, read first 188 Bytes, and check whether the first character is 0x47. Code below: import os fp=open("try.ts","rb") for i in range(100): buf=fp.read(188) if...
Python - find average for columns with unique matching value in nested list Question: This is very similar to this question: [Finding minimum, maximum and average values for nested lists?](http://stackoverflow.com/questions/9858739/finding- minimum-maximum-and-average-values-for-nested-lists) The important difference ...
Python Game of inbetween - can't get if-elif to work Question: trying to make a game in Python.. although I can't seem to get a certain bit of code working?! It's driving me nuts! Any help is greatly appreciated! import random die1 = random.randint(1,10) die2 = random.randint(1,10) die3...
class PCA matplotlib for face recognition Question: I am trying to make face recognition by Principal Component Analysis (PCA) using python. I am using class `pca` found in `matplotlib`. Here is it's documentation: > class matplotlib.mlab.PCA(a) compute the SVD of a and store data for PCA. > Use project to project the...
Matplotlib cmap values must be between 0-1 Question: I am having trouble with the code below: import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np from pylab import * import sys s = (('408b2e00', '24.21'), ('408b2e0c', '22.51'), ('4089e04a', '2...
plotting orbital trajectories in python Question: How can I setup the three body problem in python? How to I define the function to solve the ODEs? The three equations are `x'' = -mu / np.sqrt(x ** 2 + y ** 2 + z ** 2) * x`, `y'' = -mu / np.sqrt(x ** 2 + y ** 2 + z ** 2) * y`, and `z'' = -mu / np.sqrt(x ** 2 + y...
libxml2.so.2: cannot open shared object file: No such file or directory Question: I am using Centos in which i had removed libxml2 accidentally now it was showing the folling error as follows There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: libxml2.so...
Runge–Kutta RK4 not better than Verlet? Question: I'm just testing several integration schemes for orbital dynamics in game. I took RK4 with constant and adaptive step here <http://www.physics.buffalo.edu/phy410-505/2011/topic2/app1/index.html> and I compared it to simple verlet integration (and euler, but it has very...
ImportError: The _imaging C module is not installed? PIL Python3 Question: root@syscomp1:~# cd Pillow-master root@syscomp1:~/Pillow-master# python3 selftest.py Traceback (most recent call last): File "selftest.py", line 8, in <module> from PIL import Image File "./PIL/Image.py", line 15...
smart way to read multiple variables from textfile in python Question: I'm trying to load multiple vectors and matrices (for numpy) that are stored in a single text file. The file looks like this: %VectorA 1 2 3 4 %MatrixA 1 2 3 4 5 6 %VectorB 3 4 5 6 7 The ideal solution wo...
2d matrix composed from 1d matrices in python Question: A newbie question and possible duplicate: How can one compose a matrix in numpy using arrays or 1d matrices? In matlab, I would use following syntax for the matrix consisting of three arrays treated as rows: A=[1; 1; 1]; B=[2; 2; 2]; C=[3; 3...
Having problems with making an .exe with cx_freeze with python and pygame, including additional files Question: I'm having trouble creating an .exe file with cx_Freeze. I'm trying to use [this](http://pastebin.com/kRFX0QEf "this") Pygame game which needs some .png's, .gif's and .ogg's to run. I have tried to compile a ...
Using re.findall in python outputting one set of parameters rather than a set of parameters for each line Question: I've used `readlines` to split all of the sentences in a file up and I want to use `re.findall` to go through and find the capitals within them. However, the only output I can get is one set of capitals f...
Trying to read information in a file into two lists in Python Question: I think this is a relatively simple question but i'm a beginner and having trouble. I have to read in information from a text file into two lists in python. This is an example of what the text file looks like, it is called 'ratings.txt' and the th...
Is it possible to replace a string (zipped) code from apk dalvik Question: I would like to replace a single string from the hex/dalvik apk code. I realize this would entail finding how the string gets encoded when it is converted from an Android class project into a signed apk file. Is this possible? Well, I know in c...
Bug or meant to be: numpy raises "ValueError: too many boolean indices" for repeated boolean indices Question: I am doing some simulations in experimental cosmology, and encountered this problem while working with numpy arrays. I'm new to numpy, so I am not sure if I'm doing this wrong or if it's a bug. I run: ...
Python - How to transform counts in to m/s using the obspy module Question: I have a miniseed file with a singlechannel trace and I assume the data is in counts (how can i check the units of the trace?). I need to transform this in to m/s. I already checked the obspy tutorial and my main problem is that i dont know how...
Correct way to install scikit-learn on OS-X using port Question: I'm tying to install scikit-learn using port on OS-X. Any idea what I'm missing here. port version Version: 2.1.3 OS-X 10.8.2 Build 12C60 Xcode Version 3.2.5 (1760) Python Pyt...
Change Windows password using Python Question: I am developing a little password manager tool using Python. It allows central password manager and single use passwords, therefor nobody will ever know the password of the server and we won't need to change all the passwords when an employee goes to an other employer. An...
Pass complex object to a python script in command line Question: I am beginner in Python programing, I want to pass a complex object (Python dictionary or class object) as an argument to a python script using command line (cmd). I see that **sys.argv** gets only string parameters. Here is an example of what I want: ...
Connecting to dropbox via python over a proxy Question: i am trying to connect to a Dropbox Account with python 2.7.4 (x64 win7) and their guide [here](https://www.dropbox.com/developers/core/authentication#python) helped me a lot. However when i am behind a proxy and this code just won't do it. (From home the code wor...
Sys.path.append("") Dosen't work on Debian.. :/ "no module named guess_language" Question: Just transferred my python project by ftp to my linux server and the project can't import files some what.. :/ sys.path.append("Functions\guess_language") import check_language sys.path.append("Functions\SL...
Error in installing mlabwrap in Windows Question: I tried to install mlabwrap in Windows by following the steps in [this article](http://obasic.net/how-to-install-mlabwrap-on-windows). After I completed all steps, when I typed `from mlabwrap import mlab` in Python, I got the following error: >>> from mla...
Read only lines that contain certain specific string and apply regex on them Question: Here's my code: I have a script that reads a file but in my file not all the lines are similar and I'd like to extract informations only from lines that have `I DOC O:`. I've tried with an if condition but it still doesn't work when...
Python TypeError: range() integer end argument expected, got float Question: I apologize in advance, I saw the answers already given for a similar kind of error but I couldn't make out anything out of it for my case. My python is quite basic and I am trying run that little piece of code: mybox = (17.0, -...
Building python packages Question: I am bitbaking a couple of python libraries and got this warning while adding second one of them: WARNING: The recipe is trying to install files into a shared area when those files already exist. Those files are: /home/ilya/beaglebone-dany/build/tmp/sysroots/beag...
Django: ImportError: No module named pocdebug_toolbar Question: I'm getting this error when starting Django from uWSGI and can't figure out what's wrong: ... File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 160, in _fetch app = import_module(appname) ...
Running test script scenarios in python Question: I'm developing a script to test another program. Basically I replicated a class with all the functions that the program I am testing have. To make things simple, assume I have only 2 functions: set(value) and add(value). set(value) sets an accumulator value and add(valu...
Can't get AndroidViewClient example code to run Question: [AndroidViewClient](https://github.com/dtmilano/AndroidViewClient) is a github repo that allows you to call on views directly, without specifying exact coordinates with monkeyrunner. I'm having trouble actually using it though. _Note: I'm using Windows_ In cmd...
Tweepy App Engine example raises 401 exception Question: I'm using the tweepy google app engine example here as the basis for my application: <https://github.com/tweepy/examples/tree/master/appengine> The get_authorization_url() method triggers the 401 unauthorized exception. template.render('oauth_exam...
Parse content from select menu, Python+BeautifulSoup Question: I am trying to parse data from a page using python which can be pretty straightforward but all the data is hidden under jquery elements and such which makes it harder to grab the data. Please forgive me as i am a newbie to Python and programming as a whole ...
django unit test class based view error No JSON object could be decoded Question: I want to test my class based view. Here is the models.py file: class TodoList(models.Model): todoitem = models.CharField(max_length=200) description = models.TextField() pub_date = models.Date...
Formatting Text in a Table in Python Question: I'm having issues creating a table that is dynamic to adjust to various results. I've written a screen scraper to pull stocks from <http://finance.yahoo.com> and print the company name, it's symbol, and it's current stock price. However the output looks like this: ...
Explicitly linking a local shared object library Question: I'm working on setting up a `Makefile` for compiling Python wrappers for a C library. The contents of the file are below (with library names altered for infosec reasons). The line numbers are for reference and are not included in the file data itself. ...
Python Module identifies as dict Question: Lets say I have a lot of key-pair data. I would like to have this data in a package so that it can be imported. Is there a way to make modules work like dicts, for performance and extendibility reasons? Example: common/pairs/ ├── BUILDINGS.py └── __in...
Python Comparing Lists Question: I want to compare two lists and want to know if a element corresponds to another element. example: 'a' should correspond to 'b' here, it will return True. list1 = [a,b,c,d] list2 = [b,a,d,c] 'a' and 'b' correspond to each-other (they share the same spot on list...
How do mixed definitions work in enum? Question: I am trying to use a C program (via dynamic libraries) with Python and the ctypes module. Several constants defined in a header file will be important for me, but I am unsure of how `enum` is being used to set their values. The obvious ones, I think I understand like: `...
calling dot products and linear algebra operations in Cython? Question: I'm trying to use dot products, matrix inversion and other basic linear algebra operations that are available in numpy from Cython. Functions like `numpy.linalg.inv` (inversion), `numpy.dot` (dot product), `X.t` (transpose of matrix/array). There's...
Python Relative import does not work from command line gives ValueError Question: My Directory structure is as follows microblog/__init__.py urls.py views.py wsgi.py settings/__init__.py testing.py base.py ...
Python: C for loop with two variables Question: I'm new to python. Is there a similar way to write this C for loop with 2 variables in python? for (i = 0, j = 20; i != j; i++, j--) { ... } Answer: Python 2.x from itertools import izip, count for i, j in izip(count(0, 1), count(2...
Python for loop using Threading or multiprocessing Question: All, I am rather new and am looking for assistance. I need to perform a string search on a data set that compressed is about 20 GB of data. I have an eight core ubuntu box with 32 GB of RAM that I can use to crunch through this but am not able to implement no...
Error while downloading images from Wikipedia via python script Question: I am trying to download all images of a particular wikipedia page. Here is the code snippet from bs4 import BeautifulSoup as bs import urllib2 import urlparse from urllib import urlretrieve site="http://en.wiki...
multiprocessing.pool context and load balancing Question: I've encountered some unexpected behaviour of the python multiprocessing Pool class. Here are my questions: 1) When does Pool creates its context, which is later used for serialization? _The example below runs fine as long as the Pool object is created afte...
Different type while calling an instance Question: I have following code: # def macierz(self, R, alfa, beta): # '''Definiuje macierz przeksztalcenia.''' # alfa=float(self.rad(alfa)) # beta=float(self.rad(beta)) # R=float(R) # B=self.array([[-self.cos(alfa), -s...
How to connect a webpage with python to mod_wsgi? Question: I am a total newbie when it comes to Python and incorporating it within html. I have spent many hours researching with no luck, so all I ask is a little help or an area where I can find the information required. I'm using AMPPS to develop a website as this ha...
py2app error: in find_needed_modules TypeError: 'NoneType' object has no attribute '__getitem__' Question: I have some troubles with py2app; for some reason I have always the same error for all scripts that I developed. At the moment I am using last MacPorts version and after two days of testing I cannot figure out wha...
Python - I'm trying to get the output of pwd and instead i get the exit status Question: I'm trying to get the output of `pwd`: #!python import os pwd = os.system("pwd") print (pwd) it prints 0 which is the successful exit status instead the path. How can i get the path instead? Answe...
Python - Summing a list of dictionaries with a condition Question: Let say I have a list: l = [{"num1":3, "num2":8, "num3":5, "type":"A"}, {"num1":2, "num2":5, "num3":5, "type":"B"}, {"num1":5, "num2":2, "num3":1, "type":"A"}, {"num1":4, "num2":4, "num3":9, "type":"B"} and I want to create 2 dictio...
Correct way to generate random numbers in Cython? Question: What is the most efficient and portable way to generate a random random in `[0,1]` in Cython? One approach is to use `INT_MAX` and `rand()` from the C library: from libc.stdlib cimport rand cdef extern from "limits.h": int INT_MAX ...
Get data for specific date range from yahoo finance api via python Question: I'm trying to fetch data from the Yahoo finance API via Joe C's method described here: [Download history stock prices automatically from yahoo finance in python](http://stackoverflow.com/questions/12433076/download- history-stock-prices-automa...
Iterating based on list of strings in Python Question: With a list of YouTube videoIDs in a text file, the code below aims to loop through these while getting the comment feeds from all these videos. Could anyone spot the looping error(s) I must have made, but cannot find? # Set the videoID list f = ...
issue with vtk python wrapping: can't import vtk in interpreter but can import in console Question: I compiled vtk with python wrapping and I can us it on the command line. However, I am using eclipse IDE and want to use vtk but no matter what I do with my PYTHONPATH variable, I still get the errors below: ...
IPython Notebook Sympy Math Rendering Question: I have just started with using IPython Notebook and have been fascinated by its power. I have been using a few examples available on the net to get started with. I was following this tutorial: <http://nbviewer.ipython.org/url/finiterank.com/cuadernos/suavesylocas.ipynb> b...
no newlines for python interactive console over socket Question: In a C program embedding the python interpreter, I spawn a python interactive console over a TCP socket. import socket import code import sys s = socket.socket() s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) ...
SQLAlchemy __init__ not running Question: I have the following code: session = scoped_session(sessionmaker(autocommit=False, autoflush=True, bind=engine)) Base = declarative_base() Base.query = session.query_property() class CommonBase(object): created_at = Column(DateTime, de...
creating JSON in python from string not working Question: i am trying to create and display arrays from a string value. First i try to create a JSON value from the string, then i try to display key/values from it. I get the error: Invalid syntax on last rule... busy whole evening, but can't find dit out:( Python3 cod...
minimum distance from an array Question: I followed this method from my other post [distance between a point and a curve[([find the distance between a point and a curve python](http://stackoverflow.com/questions/16158402/find-the-distance-between- a-point-and-a-curve-python/16158876#16158876)) but something is wrong. T...
Get an error message from a SQL query back into Python Question: I need to be able to tell if SQL queries kicked off by Python have failed. So far I have: import subprocess p = subprocess.Popen(['sqlcmd', '-E -m-1 -S 1070854A\AISP -i NewStructures.sql >>process.log'], stdout=subprocess.PIPE, stderr=s...
How to use easy_install to install locally? Question: I try to install [PyTables package](http://www.pytables.org) using easy_install. My problem is that I am not root on the system and am not allowed to write to `/usr/local/lib/python2.7/dist-packages/` directory. To solve this problem I decided to install locally. ...
Python Tkinter Grid issue - user error? Question: I am trying to create a basic layout for a Python gui using Tkinter. #!/usr/bin/env python from Tkinter import * #create root root = Tk() banner = Frame(root, width=500) body = Frame(root, width=500) banner.grid() bod...
nginx with websocket and https content on same url Question: My server provides on a root url, in https: * files, rest resources * websocket I would like my configuration to support websocket but it does not work. I use nginx 1.3.16 which supports websocket proxy. Here is part of my nginx configuration: ...
Python - reading data from file with variable attributes and line lengths Question: I'm trying to find the best way to parse through a file in Python and create a list of namedtuples, with each tuple representing a single data entity and its attributes. The data looks something like this: UI: T020 ...
solaris python setuptools install Question: I have a solaris host: SunOS blah 5.10 Generic_147441-27 i86pc i386 i86pc and I have python at `/usr/bin/python` $ /usr/bin/python Python 2.6.4 (r264:75706, Jun 26 2012, 21:27:36) [C] on sunos5 Type "help", "copyright", "credits" or...
Using any other values in pyaudio for rate / format / chunk give me the error: [Errno Input overflowed] -9981 Question: OS: Mac OSX 10.7.5 Python: Python 2.7.3 (homebrew) pyaudio: 0.2.7 portaudio: 19.20111121 (homebrew - portaudio) **The following script outputs the following and displays the issues I am having:** ...
Reference to value of the function Question: At beginning i wanna say i'm newbie in use Python and everything I learned it came from tutorials. My problem concerning reference to the value. I'm writing some script which is scrapping some information from web sites. I defined some function: def MatchPatte...
Sort CSV File Python/Linux Command Question: I need to sort the CSV File by the Temp5 column which contain Following format.In my specific case,Temp5 column contain failed value. In other words, it does not contain any value and present only Failed. So, I need to perform sort operation on value in Temp5 and ignore F...
how to read data from clipboard and pass it as value to a variable in python? Question: how to read data from clipboard and pass it as value to a variable in python? For example: I will copy some data {eg: 200} by pressing ctrl+c or through rightclick. and pass it to a variable. c = 200 ..can any1 tel me how to do ...
Python Tkinter scrollbar for frame Question: My objective is to add a vertical scroll bar to a frame which has several labels in it. The scroll bar should automatically enabled as soon as the labels inside the frame exceed the height of the frame. After searching through, I found [this](http://stackoverflow.com/questio...
"error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType" Question: Sometimes, mostly on heavy load, I am getting these errors: 2013-04-23 23:53:13.595 MusicPlayer[74705:6303] unrecognized type is -2 2013-04-23 23:53:14.686 M...
How to execute one program's output in some different terminal Question: My last question was also same thing, but did not get proper suggestion, so I am asking again. I have a GUI which will connect to ssh. After it connects to ssh I am not able to do anything , so I have to open new terminal through script do rest o...
Read an SQLite 2 database using Python 3 Question: I have an old SQLite 2 database that I would like to read using Python 3 (on Windows). Unfortunately, it seems that Python's sqlite3 library does not support SQLite 2 databases. Is there any other convenient way to read this type of database in Python 3? Should I perha...
Python Memory leak when accessing GetCurrentImage() from DirectShow comtype Question: I have to debug someone elses code that has a memory leak. It uses up all the RAM and then eventually crashes (at a rate of 4Mb/s). I isolated it down to a call that grabs a screen shot of a video filter and saves it to a object named...
Python & CV2: How do i draw a line on an image with mouse then return line coordinates? Question: I'm looking to draw a line on a video which I'm stepping through frame by frame so I can calculate the angle of the line. I've made a very simple script which steps through the video and tries to collect the points clicked...
Python counter key value Question: My question is similar to my previous question: [Python list help (incrementing count, appending)](http://stackoverflow.com/questions/16172268/python-list-help- incrementing-count-appending). My accepted answer works well. However, this time I have a different question. I'm parsing a...
How can I retrieve environment variables from remote system in Python? Question: I'm trying to retrieve environment variables of a remote Linux server in Python. Alternatively, if I could use the variable name in the command I'm executing, that'd be great as well. The calls I'm making should work, as far as I can tell,...
Python Requests library returns wrong status code Question: The Python code below returns '403': import requests url = 'http://bedstardirect.co.uk/star-collection-braemar-double-bedstead.html' r = requests.get(url) print r.status_code But this page is valid and the script should return ...
Best way to distinguish between scalar, list and dict arguments in Python? Question: I want a function that normally takes in an argument of type X where X is either a scalar, a list, or a dict, and returns a list of X's with the same key values, based on other information. def foo(info, k): retur...
python subprocess issue with Nmap Question: Im trying to get a linux binary to send its standard output to a variable by using subprocess. But just keep getting tracebacks. >>> import subprocess >>>nmap -sn -Pn todd.ns.cloudflare.com --script dns-check-zone --script-args='dns-check-zone.domain=www.ma...
Get array of Map's keys Question: I am trying to learn Java with a Python basis, so please bear with me. I am implementing a Sieve of Eratosthenes method (I have one in Python; trying to convert it to Java): def prevPrimes(n): """Generates a list of primes up to 'n'""" primes_dict = {i :...
Python/BeautifulSoup - how to remove all tags from an element? Question: How can I simply strip all tags from an element I find in BeautifulSoup? Answer: With `BeautifulStoneSoup` gone in `bs4`, it's even simpler in Python3 from bs4 import BeautifulSoup soup = BeautifulSoup(html) text = so...
Python: 'NoneType' object has no attribute 'get_username' Question: I'm working on a hangman program that also has user accounts objects. The player can log in, create a new account, or view account details, all of which work fine before playing the game. After the game has completed, the user's wins and losses are upd...
SNMP Agent in Python Question: I required a SNMP agent in python, which listen on a particular port and and responds to basic SNMP command (like GTE, SET, GETNEXT ...etc) If any one have code please reply on this post. Answer: There's a collection of SNMP Command Responder scripts at [pysnmp web- site](http://pysnmp...
Python/Django 1.5 DatabaseWrapper thread error Question: Throwing the following DatabaseError in Django 1.5.1 (and 1.5.0) and mysql when I runserver and attempt to load a local version of the web app: > DatabaseError at / > > DatabaseWrapper objects created in a thread can only be used in that same > thread. The objec...
how to use a variable with a GUI in python 3 Question: I'm trying to get this so when you press 'HELLO' five time the text turn red just its not adding any thing on when i add anything to the viable.this is the code. from tkinter import * class application(Frame): global t t=1 ...
Problems in connecting to MusicBrainz database using psycopg2 Question: I am trying to connect to the MusicBrainz database using the psycopg2 python's module. I have followed the instructions presented on <http://musicbrainz.org/doc/MusicBrainz_Server/Setup>, but I cannot succeed in connecting. In particular I am using...
Calling upon data in just 1 cell from sqlite in python Question: My question is essentially twofold. Firstly, I have a database using SQlite, which I'm running with Python. My database is: CREATE TABLE cards (id integer primary key autoincrement not null, ref text unique check(ref!=''), name text, d...
Python unpacking binary stream from tcp socket Question: ok, So I thought it would be a good idea to get familiar with Python. (I have had experience with Java, php, perl, VB, etc. not a master of any, but intermediate knowledge) so I am attempting to write a script that will take a the data from a socket, and transla...
Python - Import module based on string then pass arguments Question: Ive searched the web and this site and cant find an answer to this problem. Im sure its right in front of me somewhere but cant find it. I need to be able to import a module based on a string. Then execute a function within that module while passing ...
How to combine python lists, with shared items, into new lists Question: I am new to python and I hit a roadblock. I have a python list that contains a single list on each line. Basically, I would like to combine lists that share values among lists. For example, below is what my python list looks at the moment and what...