text
stringlengths
226
34.5k
How to delete an entry object object Question: I can create a form with Django that has a mysql background. I wonder if it is possible to create a code that allows you to delete an object. So supposing I had a client called "Tony", and I wanted to create some python code that allowed me to delete Tony. How would I do t...
Twitter API: simple status update (Python) Question: I've been looking for a way to update my Twitter status from a Python client. As this client only needs to access one Twitter account, it should be possible to do this with a pre-generated oauth_token and secret, according to <http://dev.twitter.com/pages/oauth_singl...
Django redirect using reverse() to a URL that relies on query strings Question: I'm writing a django application with a URL like 'http://localhost/entity/id/?overlay=other_id'. Where id is the primary key of the particular entity and overlay is an optional query parameter for a second entity to be overlaid in the displ...
Python generate dates series Question: How can i generate array with dates like this: Timestamps in javascript miliseconds format from 2010.12.01 00:00:00 to 2010.12.12.30 23.59.59 with step 5 minutes. ['2010.12.01 00:00:00', '2010.12.01 00:05:00','2010.12.01 00:10:00','2010.12.01 00:15:00', ...] ...
Unable to import pylab? Question: I've installed numpy/scipy/matplotlib on Snow Leopard with python 2.6. Importing pylab does not seem to be working.. Upon calling 'import pylab', I get the following: File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/...
Using Tornado with Pika for Asynchronous Queue Monitoring Question: I have an AMQP server ([RabbitMQ](http://www.rabbitmq.com/)) that I would like to both publish and read from in a [Tornado web server](http://www.tornadoweb.org/). To do this, I figured I would use an asynchronous amqp python library; in particular [Pi...
Python subprocess Popen Question: Why its not working? :| import subprocess p = subprocess.Popen([r"snmpget","-v","1","-c","public","-Oqv","","-Ln","192.168.1.1 1.3.6.1.2.1.2.2.1.10.7"],stdout=subprocess.PIPE).communicate()[0] print p Run script: root@OpenWrt:~/python# py...
Python Message Box Without huge library dependancy Question: Is there a messagebox class where I can just display a simple message box without a huge GUI library or any library upon program success or failure. (My script only does 1 thing). Also, I only need it to run on Windows. Answer: You can use the [ctypes](htt...
How to get an HTML file using Python? Question: I am not very familiar with Python. I am trying to extract the artist names (for a start :)) from the following page: <http://www.infolanka.com/miyuru_gee/art/art.html>. How do I retrieve the page? My two main concerns are; what functions to use and how to filter out use...
Increasing the depth of cProfiler in Python to report more functions? Question: I'm trying to profile a function that calls other functions. I call the profiler as follows: from mymodule import foo def start(): # ... foo() import cProfile as profile profile.run('start()', o...
How to test for situation where a specific library is missing in Python Question: I have some packages that have soft dependencies on other packages with a fall back to a default (simple) implementation. The problem is that this is very hard to test for using unit tests. I could set up separate virtual environments, b...
Python filter list to remove certain links from html source code Question: I have html source code which I want to filter out one or more links and keep the others. I have set up my filter with "*" as the wildcard: <a*>Link1</a>‚ <a*>Link2</a>‚ or <a*>Link3</a> <a*>A bad link*</a> some text* <a*...
With regards to urllib AttributeError: 'module' object has no attribute 'urlopen' Question: import re import string import shutil import os import os.path import time import datetime import math import urllib from array import array import random filehandle = urllib...
Voodoo Code In Python Question: I was going through Zed Shaw's Learn Python The Hard Way and something in Chapter 15 struck me. In the extra credit exercises he asks us to delete the latter part of the code [everything after print txt.read() ] and then execute it, but the interpreter behaves as if nothing has happened....
Python: Pickle derived classes as if they were an instance of the base class Question: I want to define a base class so that when derived class instances are pickled, they are pickled as if they are instances of the base class. This is because the derived classes may exist on the client side of the pickling but not on ...
Django app throws spurious exception when importing views from third-party app Question: I'm working on a Django app that occasionally throws a `ViewDoesNotExist` exception when trying to import modules from a third-party app (Solango, to be specific). By "occasionally", I mean often enough to be annoying, but definite...
sorting lists of list to get unique ids for last column Question: I have this data saved in a file: ['5',60680,60854,'gene_id "ENS1"'] ['5',59106,89211,'gene_id "ENS1"'] ['5',58686,58765,'gene_id "ENS1"'] ['5',80835,93381,'gene_id "ENS2"'] ['5',55555,92223,'gene_id "ENS2"'] ['5',73902...
Reading request parameters in Google App Engine with Java Question: I'm modifying the default project that Eclipse creates when you create a new project with Google Web Toolkit and Google App Engine. It is the GreetingService sample project. How can I read a request parameter in the client's .java file? For example, ...
Python GTK "Getting started" tutorial problem Question: I have a problem with compiling a basic and really simple example of PyGTK usage listed on pygtk's website. This is the first example from this site: <http://www.pygtk.org/pygtk2tutorial/ch-GettingStarted.html> My code looks like this: #!/usr/bin/...
Python: saving objects and using pickle. Error using pickle.dump Question: Hello I have an Error and I don´t the reason: >>> class Fruits:pass ... >>> banana = Fruits() >>> banana.color = 'yellow' >>> banana.value = 30 >>> import pickle >>> filehandler = open("Fruits.obj",'w') ...
Query by non-ascii charachters Question: I am using Python, on Google App Engine platform. Let's say I have in my Data Store the following code : class names(db.Model): name = db.StringProperty(multiline=True) and there are names like : name1 = Beyoncé name2 = El Súper Cl...
django.db.utils.DatabaseError Question: I'm setting up a django model to store regions, like USA, Germany, etc. I made the region name unique for the table. I have a script that populates the database from a list and if there is a duplicate region name IntegrityError is thrown as expected but then another error happens...
What is the best way to keep an almost static data for web application? Question: I'm building a web application in python. A part of this application is working with the data that can be described as follows: Symbol Begin Date End Date AAPL Jan-1-1985 Dec-27-2010 ... Th...
Troubleshooting Facebook's graph.put_object that returns error 400 Question: I am using Facebook Python's SDK along with Google App Engine, and making a call to do a checkin: graph.put_object("me", "checkins", message="Hello, world", place="165039136840558", coordinates='{"latitude":"38.2454064", "longit...
Google App Engine: how to send html using send_mail Question: I have a app with a kind of rest api that I'm using to send emails . However it currently sends only text email so I need to know how to modify it and make it send html . Below is the code : from __future__ import with_statement #!/us...
How come my Python code doesn't work? Question: from celery.decorators import task from celery.decorators import task @task() def add(x, y): r = open("./abc.txt","w") r.write("sdf") r.close() return x + y That's my tasks.py file. >>> import tas...
How to get current date and time from DB using SQLAlchemy Question: I need to retrieve what's the **current date and time for the database I'm connected** with SQLAlchemy (not date and time of the machine where I'm running Python code). I've seen this functions, but they don't seem to do what they say: >...
Python urllib2 http -1 error Question: I have this code, that supposed to work but I'm getting strange errors, for other user this code works fine. # -*- coding: utf-8 -*- import re, sys import urllib2 import urllib2_file user_hash='MTggMzc6T1dZgggggzWXpWbVptggggHTXlOV1F5WW...
Fastest way to swap elements in Python list Question: Is there any any faster way to swap two list elements in Python than L[a], L[b] = L[b], L[a] or would I have to resort to [Cython](http://cython.org/) or [Weave](http://www.scipy.org/Weave) or the like? Answer: Looks like the Python compiler o...
Python imports issue Question: I have a Utilities module which defines a few functions which are repeatedly used and am also adding in some constants. I'm running into trouble importing these constants though... Let's say I'm working in class A, and I have a class in my constants also named A from Utils...
Web Python Question Question: Can anyone assist me in getting a Python script running on Hostgator Shared hosting? I work with PHP mostly, but have taken a liking to Python, and would like to try to get it going on the web. The only way I've ever ran Python is with either the interpreter, or through a terminal, with >P...
abstract test case using python unittest Question: Is it possible to create an abstract `TestCase`, that will have some test_* methods, but this `TestCase` won't be called and those methods will only be used in subclasses? I think I am going to have one abstract `TestCase` in my test suite and it will be subclassed for...
Python and the self parameter Question: I'm having some issues with the self parameter, and some seemingly inconsistent behavior in Python is annoying me, so I figure I better ask some people in the know. I have a class, `Foo`. This class will have a bunch of methods, `m1`, through `mN`. For some of these, I will use a...
How do I make a GUI that behaves like this? Question: This is difficult to explain without illustration, so - behold, an illustration, cobbled together from screenshots of a few hello-world examples and a lot of Paint work: ![GUI mockup](http://i.stack.imgur.com/12nPd.png) I have started out using Windows Forms on .N...
Python glob multiple filetypes Question: Is there a better way to use glob.glob in python to get a list of multiple file types such as .txt, .mdown, and .markdown? Right now I have something like this: projectFiles1 = glob.glob( os.path.join(projectDir, '*.txt') ) projectFiles2 = glob.glob( os.path.j...
Which is quicker? Memcache or file query? (using maxmind geoip.dat file) Question: I'm using Python on Appengine and am looking up the geolocation of an IP address like this: import pygeoip gi = pygeoip.GeoIP('GeoIP.dat') Location = gi.country_code_by_addr(self.request.remote_addr) (pygeoip...
List of names and their numbers needed to be sorted .TXT file Question: I have a list of names (never over 100 names) with a value for each of them, either 3 or 4 digits. > john2E=1023 > mary2E=1045 > fred2E=968 And so on... They're formatted exactly like that in the .txt file. I have Python and Excel, also wil...
Strange PYTHONPATH problem Question: I recently updated my python installation to 2.7 (previously 2.5), and I've noticed a strange problem where I cannot import certain modules that I created. I had no problem before. Normally, I edit the PYTHONPATH and add the directory I want to import modules. For some strange reaso...
Django book question: Database config problem. Getting Operational Error Question: I am on chapter 5 of the django book and trying to proceed, but I'm stuck on one part: Link to exact chapter: <http://www.djangobook.com/en/2.0/chapter05/> Problem: testing database configurations When I: 1. Run python manage.py sh...
python equivalent of filter() getting two output lists (i.e. partition of a list) Question: Let's say I have a list, and a filtering function. Using something like >>> filter(lambda x: x > 10, [1,4,12,7,42]) [12, 42] I can get the elements matching the criterion. Is there a function I could use...
IronPython and Nodebox in C# Question: **My plan:** I'm trying to setup my C# project to communicate with Nodebox to call a certain function which populates a graph and draws it in a new window. **Current situation: [fixed... see Update2]** I have already included all python-modules needed, but im still getting a >...
More than one profile in Django? Question: Is it possible to use Django's user authentication features with more than one profile? Currently I have a settings.py file that has this in it: AUTH_PROFILE_MODULE = 'auth.UserProfileA' and a models.py file that has this in it: from django...
Get parts of html code as a new string in python Question: I was wondering how I could get a value, between some html tags, from some html code using python. Say I wanted to get the price of a product in an amazon page: I've got up to: url = raw_input("Enter the url:\n") sock = urllib.urlopen(url) ...
Unexpected end of archive Question: Hey there, I'm pretty new to programming and I've got a problem with the Python Challenge; and I've removed the exact url in hopes avoiding any heavy spoilers. Anyway, my problem is that I'm trying to open the file I've created, in WinRAR after I've ran the following code, and it te...
file walking in python Question: So, I've got a working solution, but it's ugly and seems un-idiomatic. The problem is this: For a directory tree, where every directory is set up to have: * 1 `.xc` file * at least 1 `.x` file * any number of directories which follow the same format and nothing else. I'd like t...
python thread error Question: obj = functioning() from threading import Thread Thread(target=obj.runCron(cronDetails)).start() print "new thread started..." I am runnning this, this should run as new thread for runCron function and should print new thread started. but this is not printing ne...
Canonical embedded interactive Python interpreter example? Question: I would like to create an embedded Python interpreter in my C/C++ application. Ideally this interpreter would behave exactly like the real Python interpreter, but yield after processing each line of input. The standard Python module `code` looks from ...
Django ImportError while adding guardian module Question: Being a beginner of using Django, i am trying to add some module for the purpose of testing Django, but I've got a problem regarding the importError which I've googled for solution with no success. Below is my situation The project is created to my PC J:\ while...
Twisted server for multiple clients Question: I want to write a server that can accept multiple clients in python (twisted). I am already quite familiar with socket programming with the standard python socket module but here comes the trouble.. I think twisted is really hard to get into and i have read some tutorials a...
Python: strip html from text data Question: My question is slightly related to: [Strip html from strings in python](http://stackoverflow.com/questions/753052/strip-html-from-strings-in- python) I am looking for a simple way to strip HTML code from text. For example: string = 'foo <SOME_VALID_HTML_TAG> s...
Compiling a SWIG Python wrapper for a static library? Question: This is a noob question. I'm trying to learn how to use SWIG to make a python interface for a C++ library. The library is a proprietary 3rd party library; it comes to me in the form of a header file (foo.h) and a static archive (libfoo.a). To simplify mat...
Interpretation of range(n) and boolean list, one-to-one map, simpler? Question: #!/usr/bin/python # # Description: bitwise factorization and then trying to find # an elegant way to print numbers # Source: http://forums.xkcd.com/viewtopic.php?f=11&t=61300#p2195422 # bug with large numbers s...
Python 256bit Hash function with number output Question: I need a Hash function with a 256bit output (as long int). First I thought I could use SHA256 from the hashlib but it has an String Output and I need a number to calculate with. Converting the 32 Byte String to a long would work also but I didn't find anything....
Python: Convert Relative Date String to Absolute Date Stamp Question: There are several questions along the same lines in Stackoverflow but this case is different. As input, I have a date string that can take three general formats. Either a) January 6, 2011 b) 4 days ago c) 12 hours ago I want the script to be able ...
Jython script implementing a class isn't initialized correctly from Java Question: I'm trying to do something similar to [Question 4617364](http://stackoverflow.com/questions/4617364/how-to-get-from-jruby-a- correctly-typed-ruby-implementation-of-a-java-interface) but for Python - load a class from python script file, ...
How do I set up the python/c library correctly? Question: I have been trying to get the python/c library to like my mingW compiler. The python online doncumentation; <http://docs.python.org/c-api/intro.html#include-files> only mentions that I need to import the python.h file. I grabbed it from the installation director...
Pairs from single list Question: Often enough, I've found the need to process a list by pairs. I was wondering which would be the pythonic and efficient way to do it, and found this on Google: pairs = zip(t[::2], t[1::2]) I thought that was pythonic enough, but after a recent discussion involving [...
Why can't I use __getattr__ with Django models? Question: I've seen examples online of people using `__getattr__` with Django models, but whenever I try I get errors. (Django 1.2.3) I don't have any problems when I am using `__getattr__` on normal objects. For example: class Post(object): def _...
Django ViewDoesNotExist error on deployment only Question: I'm working on a Django app that I thought was nearly ready to deploy. Everything works on the development server, but when hosted on a test Apache/mod_wsgi server, I get an error for every last one of my views. If I put in a invalid URL, it serves me the list...
Random List of millions of elements in Python Efficiently Question: I have read this [answer](http://stackoverflow.com/questions/1022141/best-way- to-randomize-a-list-of-strings-in-python) potentially as the best way to randomize a list of strings in Python. I'm just wondering then if that's the most efficient way to d...
Why are these strings escaping from my regular expression in python? Question: In my code, I load up an entire folder into a list and then try to get rid of every file in the list except the .mp3 files. import os import re path = '/home/user/mp3/' dirList = os.listdir(path) dirList.sort()...
Efficient Python Daemon Question: I was curious how you can run a python script in the background, repeating a task every 60 seconds. I know you can put something in the background using &, is that effeictive for this case? I was thinking of doing a loop, having it wait 60s and loading it again, but something feels of...
Cython inline function with numpy array as parameter Question: Consider code like this: import numpy as np cimport numpy as np cdef inline inc(np.ndarray[np.int32_t] arr, int i): arr[i]+= 1 def test1(np.ndarray[np.int32_t] arr): cdef int i for i in xrange(len...
Issue with importing scipy.integrate or scipy.integrate.quad Question: This might be something really simple: I am using Python 2.6.5 and I am unable to load any integration module in my working space. Everything is OK when I import scipy, but if I try to import scipy.integrate or scipy.integrate.quad I get an error me...
What can be used instead of parse_qs function Question: I have the following code for parsing youtube feed and returning youtube movie id. How can I rewrite this to be python 2.4 compatible which I suppose doesn't support `parse_qs` function ? YTSearchFeed = feedparser.parse("http://gdata.youtube.com" + ...
Parse Python file and evaluate selected functions Question: I have a file that contains several python functions, each with some statements. def func1(): codeX... def func2(): codeY... codeX and codeY can be multiple statements. I want to be able to parse the file, find a functi...
Error in Selenium Python Script Question: I am trying to get the hang of both Python and Selenium RC and am having some difficulty getting the following sample Selenium Python Script to parse. I have resolved all of the following code's errors besides one: from selenium import selenium import unittes...
boto: EC2 instance get_attribute results in AttributeError: 'EC2Connection' object has no attribute 'describe_attribute' Question: **What steps will reproduce the problem?** 1.attempt to get a running EBS-backed instance's kernel attribute with instance.get_attribute('kernel') >>> import boto.ec2 >>...
Matplotlib: simultaneous plotting in multiple threads Question: I am trying to do some plotting in parallel to finish large batch jobs quicker. To this end, I start a thread for each plot I plan on making. I had hoped that each thread would finish its plotting and close itself (as I understand it, Python closes thread...
Python / Tracing - How to stop a function's execution (return from it ) from within a tracer Question: Is there a way to return out of a function badfunc() using a tracer function tracer(), if we set sys.settrace(tracer). I want to count the number of lines that badfunc() executes, and return out of it if it executes m...
How do I write a long integer as binary in Python? Question: In Python, long integers have unlimited precision. I would like to write a 16 byte (128 bit) integer to a file. `struct` from the standard library supports only up to 8 byte integers. `array` has the same limitation. Is there a way to do this without masking ...
Text file to list in Python Question: Suppose I have a document called test1.txt that contains the following numbers: 133213 123123 349135 345345 I want to be able to take each number and append it to the end of the URL below to make a HTTP request. How do I stuff the id's into a list a...
Google Python gdata Library Installation Failing Question: [Note, I have removed some information, such as my username, and the IDs to my spreadsheets] Hi! I'm on a mac, and I'm trying my best to install gdata for google python. Before I go on, I'm using this tutorial here: <http://code.google.com/apis/gdata/articles/p...
How to get favicon by using beatiful soup and python Question: Hey guys, I wrote some stupid code for learning just, but it doesn't work for any sites. here is the code: import urllib2, re from BeautifulSoup import BeautifulSoup as Soup class Founder: def Find_all_links(self, url): ...
Adding System.Data.SQLite reference in IronPython Question: I'm trying to use clr.AddReference to add sqlite3 functionality to a simple IronPython program I'm writing; but everytime I try to reference System.Data.SQLite I get this error: > Traceback (most recent call last): File "", line 1, in IOError: > System.IO.IOE...
smarter "reverse" of a dictionary in python (acc for some of values being the same)? Question: def revert_dict(d): rd = {} for key in d: val = d[key] if val in rd: rd[val].append(key) else: rd[val] = [key] return rd ...
How to insert item into c_char_p array Question: I want to pass **an array of char pointer** to a C function. I refer to <http://docs.python.org/library/ctypes.html#arrays> I write the following code. from ctypes import * names = c_char_p * 4 # A 3 times for loop will be written here. ...
Problem in printing array of char pointer passing from Python Question: My following C code works quite well, till my Python code trying to pass an array of char pointer to it. The output I obtain is > The file_name is python-file Another 3 string is not being printed out. Anything I had missed out? **C Code** ...
python exception message capturing Question: import ftplib import urllib2 import os import logging logger = logging.getLogger('ftpuploader') hdlr = logging.FileHandler('ftplog.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) l...
My python program always brings down my internet connection after several hours running, how do I debug and fix this problem? Question: I'm writing a python script checking/monitoring several server/websites status(response time and similar stuff), it's a GUI program and I use separate thread to check different server/...
"Operation not permitted" while dropping privileges using setuid() function Question: Why this simple programs that use os.setuid()/gid() fails? Is written in python but I think that is not a language relative problem (at the end are all the same posix system call): import os, pwd if os.getenv("...
Use of "global" keyword in Python Question: What I understand from reading the documentation is that Python has a separate namespace for functions, and if I want to use a global variable in that function, I need to use `global`. I'm using Python 2.7 and I tried this little test >>> sub = ['0', '0', '0',...
Test Driven Development, Unit Testing Question: let me first explain what I'm aiming for with this question: What kind of dev I am? I'm the guy who thinks about the problem, writes the code and then tests it by myself. I'm developing web-apps mainly but there are also projects which are UI based too (RCP/Swing apps). ...
Using regex to find data in Python Question: I am new to python, and developing in general. Let me give an example what I am trying to do. I want to find the text name="username" type="hidden" value="blah" and I only want to pull the "blah" How would I begin to go about that? Answer: You can use [regex groups](http...
oauth2 in python Question: I'm looking to write a script that tweets from python (such as [here](http://abhi74k.wordpress.com/2010/12/21/tweeting-from-python/)), however when I try and call import oauth2 as oauth I just get this error: > ImportError: No module named oauth2 Where can I get this mo...
How does this If conditional work in Python? Question: from google.appengine.api import users from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class MainPage(webapp.RequestHandler): def get(self): user = users.get_current_user() ...
Is there a way to keep lines from being skipped when using csv.dictWriter.writerow(somerow) Question: I am processing some files and want to create a log of what I am processing. I created the log by using a dictionary to hold the keys and values for each observation and then I am appending the dictionary to a list (a ...
How to extract a floating number from a string in Python Question: I have a number of strings similar to `Current Level: 13.4 db.` and I would like to extract just the floating point number. I say floating and not decimal as it's sometimes whole. Can RegEx do this or is there a better way? Answer: If your float is al...
ImportError: cannot import name aliases Question: I just installed the Python 2.7.1 on Windows Vista using installer from [official site](http://www.python.org/download), and get such error when run python.exe C:\Python27>python.exe Traceback (most recent call last): File "C:\Python27\Lib\site....
Any easy way to alter the data that comes from a mysql database? Question: so I'm using mysql to grab data from a database and feeding it into a python function. I import mysqldb, connect to the database and run a query like this: conn.query('SELECT info FROM bag') x = conn.store_result() fo...
PIL: using fromarray() with binary data and writing coloured text Question: Hallo. I've a basic problem with Python's library PIL. I have some .txt files containing only **0** and **1** values arranged in matrices. What I do is transforming such "binary" data in an image with the function **Image.fromarray()** included...
Android SL4A (Python) Force Stop Packages fails. Question: I'm trying to terminate task using code like this: import android droid = android.Android() running = droid.getRunningPackages()[1] for task in running: if (task.find("skype") != -1) droid.forceStopPackages(t...
Python Twisted receive command from TCP write to Serial device return response Question: I've managed to connect to usb modem and a client can connect via tcp to my reactor.listenTCP,the data received from modem will be send back to client. I'm want to take dataReceived from client and send this to modem..I'm strugglin...
testing interactive python programs Question: I would like to know which testing tools for python support the testing of interactive programs. For example, I have an application launched by: $ python dummy_program.py >> Hi whats your name? Joseph I would like to instrument `Joseph` so I c...
Markaby/Erector for Python Question: I like using Python, but hate writing HTML. Is there a Markaby/Erector - like module for Python? Answer: Seems like you can kind of do this with lxml: <http://lxml.de/lxmlhtml.html#creating-html-with-the-e-factory> from lxml.html import builder as E from lxml.h...
python -> combinations of numbers and letters Question: #!/usr/bin/python import random lower_a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] upper_a = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M'...
Using Python and Mechanize to submit form data and authenticate Question: I want to submit login to the website Reddit.com, navigate to a particular area of the page, and submit a comment. I don't see what's wrong with this code, but it is not working in that no change is reflected on the Reddit site. im...
Extracting Data from a .txt file using python Question: I many, many .xml files and i need to extract some co-ordinates from them. Extracting data straight from .xml files seems to be very, very complicated - so i am working saving the .xml files as .txt files and extracting the data that way. However, when i open the ...
Python Multidimensional Array as a single List Question: Sure, you can have nested lists to represent multidimensional arrays, but that seems costly... [[0, 1], [2, 3]] Is there some way to "encode" and "decode" the coordinate into a single number, and use that number to lookup the corresponding el...
xmpppy and Facebook Chat Integration Question: I'm trying to create a very simple script that uses python's xmpppy to send a message over facebook chat. import xmpp FACEBOOK_ID = "username@chat.facebook.com" PASS = "password" SERVER = "chat.facebook.com" jid=xmpp.protocol.JID(FACEBOOK_ID)...