text stringlengths 200 200k | source stringclasses 2
values |
|---|---|
# List of IP addresses/hostnames from local network in Python
## Question
How can I get a list of the IP addresses or host names from a local network easily in Python?
It would be best if it was multi-platform, but it needs to work on Mac OS X first, then others follow.
Edit: By local I mean all active addresses wit... | stackoverflow-qa |
# List of IP addresses/hostnames from local network in Python
## Question
How can I get a list of the IP addresses or host names from a local network easily in Python?
It would be best if it was multi-platform, but it needs to work on Mac OS X first, then others follow.
Edit: By local I mean all active addresses wit... | stackoverflow-qa |
# List of IP addresses/hostnames from local network in Python
## Question
How can I get a list of the IP addresses or host names from a local network easily in Python?
It would be best if it was multi-platform, but it needs to work on Mac OS X first, then others follow.
Edit: By local I mean all active addresses wit... | stackoverflow-qa |
# extracting a parenthesized Python expression from a string
## Question
I've been wondering about how hard it would be to write some Python code to search a string for the index of a substring of the form ${expr}, for example, where expr is meant to be a Python expression or something resembling one. Given such a th... | stackoverflow-qa |
# extracting a parenthesized Python expression from a string
## Question
I've been wondering about how hard it would be to write some Python code to search a string for the index of a substring of the form ${expr}, for example, where expr is meant to be a Python expression or something resembling one. Given such a th... | stackoverflow-qa |
# extracting a parenthesized Python expression from a string
## Question
I've been wondering about how hard it would be to write some Python code to search a string for the index of a substring of the form ${expr}, for example, where expr is meant to be a Python expression or something resembling one. Given such a th... | stackoverflow-qa |
# Are there any IDE's that support Python 3 syntax?
## Question
I recently saw an announcement and article outlining the release of the first Python 3.0 release candidate. I was wondering whether there were any commercial, free, open source etc. IDE's that support its syntax.
## Answer
Can get PyDev. from http://pyde... | stackoverflow-qa |
# Are there any IDE's that support Python 3 syntax?
## Question
I recently saw an announcement and article outlining the release of the first Python 3.0 release candidate. I was wondering whether there were any commercial, free, open source etc. IDE's that support its syntax.
## Answer
Komodo 5 beta 1 was released in... | stackoverflow-qa |
# Are there any IDE's that support Python 3 syntax?
## Question
I recently saw an announcement and article outlining the release of the first Python 3.0 release candidate. I was wondering whether there were any commercial, free, open source etc. IDE's that support its syntax.
## Answer
Python 3 is just not that diffe... | stackoverflow-qa |
# Are there any IDE's that support Python 3 syntax?
## Question
I recently saw an announcement and article outlining the release of the first Python 3.0 release candidate. I was wondering whether there were any commercial, free, open source etc. IDE's that support its syntax.
## Answer
Emacs + python.el continues to ... | stackoverflow-qa |
# Are there any IDE's that support Python 3 syntax?
## Question
I recently saw an announcement and article outlining the release of the first Python 3.0 release candidate. I was wondering whether there were any commercial, free, open source etc. IDE's that support its syntax.
## Answer
Pyscripter is the PERFECT Pytho... | stackoverflow-qa |
# Are there any IDE's that support Python 3 syntax?
## Question
I recently saw an announcement and article outlining the release of the first Python 3.0 release candidate. I was wondering whether there were any commercial, free, open source etc. IDE's that support its syntax.
## Answer
PyDev for Eclipse does support ... | stackoverflow-qa |
# Are there any IDE's that support Python 3 syntax?
## Question
I recently saw an announcement and article outlining the release of the first Python 3.0 release candidate. I was wondering whether there were any commercial, free, open source etc. IDE's that support its syntax.
## Answer
Geany works with python 3 if yo... | stackoverflow-qa |
# Python module that implements ftps
## Question
I was wondering if anybody could point me towards a free ftps module for python.
I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.
thanks,
David.
## Answer
I haven't tried ... | stackoverflow-qa |
# Python module that implements ftps
## Question
I was wondering if anybody could point me towards a free ftps module for python.
I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.
thanks,
David.
## Answer
Twisted seems to... | stackoverflow-qa |
# Python module that implements ftps
## Question
I was wondering if anybody could point me towards a free ftps module for python.
I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.
thanks,
David.
## Answer
I believe you co... | stackoverflow-qa |
# Python module that implements ftps
## Question
I was wondering if anybody could point me towards a free ftps module for python.
I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.
thanks,
David.
## Answer
I couldn't find ... | stackoverflow-qa |
# Python module that implements ftps
## Question
I was wondering if anybody could point me towards a free ftps module for python.
I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.
thanks,
David.
## Answer
M2Cypto has a FT... | stackoverflow-qa |
# Python module that implements ftps
## Question
I was wondering if anybody could point me towards a free ftps module for python.
I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.
thanks,
David.
## Answer
As for the serve... | stackoverflow-qa |
# Python module that implements ftps
## Question
I was wondering if anybody could point me towards a free ftps module for python.
I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.
thanks,
David.
## Answer
The ftplib modul... | stackoverflow-qa |
# How to enable MySQL client auto re-connect with MySQLdb?
## Question
I came across PHP way of doing the trick:
my_bool reconnect = 1;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
but no luck with MySQLdb (python-mysql).
Can anybody please give a clue? Thanks.
## Answer
If you are using ubuntu Linux t... | stackoverflow-qa |
# How to enable MySQL client auto re-connect with MySQLdb?
## Question
I came across PHP way of doing the trick:
my_bool reconnect = 1;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
but no luck with MySQLdb (python-mysql).
Can anybody please give a clue? Thanks.
## Answer
I had a similar problem with My... | stackoverflow-qa |
# How to enable MySQL client auto re-connect with MySQLdb?
## Question
I came across PHP way of doing the trick:
my_bool reconnect = 1;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
but no luck with MySQLdb (python-mysql).
Can anybody please give a clue? Thanks.
## Answer
I solved this problem by creati... | stackoverflow-qa |
# How to enable MySQL client auto re-connect with MySQLdb?
## Question
I came across PHP way of doing the trick:
my_bool reconnect = 1;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
but no luck with MySQLdb (python-mysql).
Can anybody please give a clue? Thanks.
## Answer
you can separate the commit and... | stackoverflow-qa |
# How to enable MySQL client auto re-connect with MySQLdb?
## Question
I came across PHP way of doing the trick:
my_bool reconnect = 1;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
but no luck with MySQLdb (python-mysql).
Can anybody please give a clue? Thanks.
## Answer
I had problems with the propose... | stackoverflow-qa |
# How to make Apache/mod_python process collect its zombies?
## Question
Apache/2.2.6 (Unix) DAV/2 mod_python/3.2.8 Python/2.4.4 configured ...
One of apache processes spawns some long-running python script asynchronously, and apparently doesn't seem to collect its child process table entry. After that long-run-in-s... | stackoverflow-qa |
# How to make Apache/mod_python process collect its zombies?
## Question
Apache/2.2.6 (Unix) DAV/2 mod_python/3.2.8 Python/2.4.4 configured ...
One of apache processes spawns some long-running python script asynchronously, and apparently doesn't seem to collect its child process table entry. After that long-run-in-s... | stackoverflow-qa |
# How to read and write multiple files?
## Question
I want to write a program for this: In a folder I have n number of files; first read one file and perform some operation then store result in a separate file. Then read 2nd file, perform operation again and save result in new 2nd file. Do the same procedure for n num... | stackoverflow-qa |
# How to read and write multiple files?
## Question
I want to write a program for this: In a folder I have n number of files; first read one file and perform some operation then store result in a separate file. Then read 2nd file, perform operation again and save result in new 2nd file. Do the same procedure for n num... | stackoverflow-qa |
# How to read and write multiple files?
## Question
I want to write a program for this: In a folder I have n number of files; first read one file and perform some operation then store result in a separate file. Then read 2nd file, perform operation again and save result in new 2nd file. Do the same procedure for n num... | stackoverflow-qa |
# How to read and write multiple files?
## Question
I want to write a program for this: In a folder I have n number of files; first read one file and perform some operation then store result in a separate file. Then read 2nd file, perform operation again and save result in new 2nd file. Do the same procedure for n num... | stackoverflow-qa |
# How to base64 encode a PDF file in Python
## Question
How should I base64 encode a PDF file for transport over XML-RPC in Python?
## Answer
You can do it with the base64 library, legacy interface.
Tags: python, encoding, base64, xml-rpc | stackoverflow-qa |
# How to base64 encode a PDF file in Python
## Question
How should I base64 encode a PDF file for transport over XML-RPC in Python?
## Answer
Actually, after some more digging, it looks like the xmlrpclib module may have the piece I need with it's Binary helper class:
binary_obj = xmlrpclib.Binary( open('foo.pdf').... | stackoverflow-qa |
# How to base64 encode a PDF file in Python
## Question
How should I base64 encode a PDF file for transport over XML-RPC in Python?
## Answer
NOTE: this is a community-wiki owned copy of Pat Notz's answer. This answer can be selected as the chosen answer. Edit freely to improve.
Pat Notz says:
Actually, after some ... | stackoverflow-qa |
# How to base64 encode a PDF file in Python
## Question
How should I base64 encode a PDF file for transport over XML-RPC in Python?
## Answer
If you don't want to use the xmlrpclib's Binary class, you can just use the .encode() method of strings:
a = open("pdf_reference.pdf", "rb").read().encode("base64")
Tags: pyt... | stackoverflow-qa |
# Django template with jquery: Ajax update on existing page
## Question
I have a Google App Engine that has a form. When the user clicks on the submit button, AJAX operation will be called, and the server will output something to append to the end of the very page where it comes from. How, I have a Django template, a... | stackoverflow-qa |
# Django template with jquery: Ajax update on existing page
## Question
I have a Google App Engine that has a form. When the user clicks on the submit button, AJAX operation will be called, and the server will output something to append to the end of the very page where it comes from. How, I have a Django template, a... | stackoverflow-qa |
# Why do I receive an ImportError when running one of the CherryPy tutorials
## Question
I have installed CherryPy 3.1.0,. Here is what happens when I try to run tutorial 9:
$ cd /Library/Python/2.5/site-packages/cherrypy/tutorial/
$ python tut09_files.py
Traceback (most recent call last):
File "tut09_files.py", li... | stackoverflow-qa |
# Why do I receive an ImportError when running one of the CherryPy tutorials
## Question
I have installed CherryPy 3.1.0,. Here is what happens when I try to run tutorial 9:
$ cd /Library/Python/2.5/site-packages/cherrypy/tutorial/
$ python tut09_files.py
Traceback (most recent call last):
File "tut09_files.py", li... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Can I use Python as a Bash replacement?
## Question
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice f... | stackoverflow-qa |
# Howto do python command-line autocompletion but NOT only at the beginning of a string
## Question
Python, through it's readline bindings allows for great command-line autocompletion (as described in here).
But, the completion only seems to work at the beginning of strings. If you want to match the middle or end of... | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
int(hexString, 16) does the trick, and works with and without the 0x prefix:
>>> int("a", 16)
10
>>> int("0xa",16)
10
Tags: python, string, hex | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
For any given string s:
int(s, 16)
Tags: python, string, hex | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
Without the 0x prefix, you need to specify the base explicitly, otherwise there's no way to tell:
x = int("deadbeef", 16)
With the 0x prefix, Python can disting... | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
Adding to Dan's answer above: if you supply the int() function with a hex string, you will have to specify the base as 16 or it will not think you gave it a valid ... | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
The formatter option '%x' % seems to work in assignment statements as well for me. (Assuming Python 3.0 and later)
Example
a = int('0x100', 16)
print(a) #256
... | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
The worst way:
>>> def hex_to_int(x):
return eval("0x" + x)
>>> hex_to_int("c0ffee")
12648430
Please don't do this!
Is Using eval In Python A Bad Practice... | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
In Python 2.7, int('deadbeef',10) doesn't seem to work.
The following works for me:
>>a = int('deadbeef',16)
>>float(a)
3735928559.0
Tags: python, string, hex | stackoverflow-qa |
# Convert hex string to int in Python
## Question
How do I convert a hex string to an int in Python?
I may have it as "0xffff" or just "ffff".
## Answer
Convert hex string to int in Python
I may have it as "0xffff" or just "ffff".
To convert a string to an int, pass the string to int along with the base you ... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Map two lists into a dictionary in Python
## Question
Imagine that you have:
keys = ('name', 'age', 'food')
values = ('Monty', 42, 'spam')
What is the simplest way to produce the following dictionary ?
dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
This code works, but I'm not really proud of it :
dic... | stackoverflow-qa |
# Advanced Python FTP - can I control how ftplib talks to a server?
## Question
I need to send a very specific (non-standard) string to an FTP server:
dir "SYS:\IC.ICAMA."
The case is critical, as are the style of quotes and their content.
Unfortunately, ftplib.dir() seems to use the 'LIST' command rather than 'di... | stackoverflow-qa |
# py3k RC-1: "LookupError: unknown encoding: uft-8"
## Question
I just installed the first release candidate of Python 3.0 and got this error after typing:
>>> help('modules foo')
[...]
LookupError: unknown encoding: uft-8
Notice that it says uft-8 and not utf-8
Is this a py3k specific bug or a misconfiguration o... | stackoverflow-qa |
# Distributing a stand-alone Python web-based application to non-technical users
## Question
I'm writing a web application in Python, intended for use by teachers and pupils in a classroom. It'll run from a hosted website, but I also want people to be able to download a self-contained application they can install loca... | stackoverflow-qa |
# Python: unsigned 32 bit bitwise arithmetic
## Question
Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.
Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe ne... | stackoverflow-qa |
# Python: unsigned 32 bit bitwise arithmetic
## Question
Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.
Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe ne... | stackoverflow-qa |
# Python: unsigned 32 bit bitwise arithmetic
## Question
Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.
Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe ne... | stackoverflow-qa |
# Python: unsigned 32 bit bitwise arithmetic
## Question
Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.
Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe ne... | stackoverflow-qa |
# Using os.execvp in Python
## Question
I have a question about using os.execvp in Python. I have the following bit of code that's used to create a list of arguments:
args = [ "java"
, classpath
, "-Djava.library.path=" + lib_path()
, ea
, "-Xmx1000m"
, "-server"
, "code_swa... | stackoverflow-qa |
# Python's __import__ doesn't work as expected
## Question
When using __import__ with a dotted name, something like: somepackage.somemodule, the module returned isn't somemodule, whatever is returned seems to be mostly empty! what's going on here?
## Answer
From the python docs on __import__:
__import__( name[, glo... | stackoverflow-qa |
# Python's __import__ doesn't work as expected
## Question
When using __import__ with a dotted name, something like: somepackage.somemodule, the module returned isn't somemodule, whatever is returned seems to be mostly empty! what's going on here?
## Answer
There is something that works as you want it to: twisted.pyt... | stackoverflow-qa |
# Python's __import__ doesn't work as expected
## Question
When using __import__ with a dotted name, something like: somepackage.somemodule, the module returned isn't somemodule, whatever is returned seems to be mostly empty! what's going on here?
## Answer
python 2.7 has importlib, dotted paths resolve as expected
... | stackoverflow-qa |
# Python's __import__ doesn't work as expected
## Question
When using __import__ with a dotted name, something like: somepackage.somemodule, the module returned isn't somemodule, whatever is returned seems to be mostly empty! what's going on here?
## Answer
For python 2.6, I wrote this snippet:
def import_and_get_mo... | stackoverflow-qa |
# Python's __import__ doesn't work as expected
## Question
When using __import__ with a dotted name, something like: somepackage.somemodule, the module returned isn't somemodule, whatever is returned seems to be mostly empty! what's going on here?
## Answer
There is a simpler solution, as explained in the documentati... | stackoverflow-qa |
# How to build "Tagging" support using CouchDB?
## Question
I'm using the following view function to iterate over all items in the database (in order to find a tag), but I think the performance is very poor if the dataset is large.
Any other approach?
def by_tag(tag):
return '''
function(doc) {
i... | stackoverflow-qa |
# How to build "Tagging" support using CouchDB?
## Question
I'm using the following view function to iterate over all items in the database (in order to find a tag), but I think the performance is very poor if the dataset is large.
Any other approach?
def by_tag(tag):
return '''
function(doc) {
i... | stackoverflow-qa |
# How to build "Tagging" support using CouchDB?
## Question
I'm using the following view function to iterate over all items in the database (in order to find a tag), but I think the performance is very poor if the dataset is large.
Any other approach?
def by_tag(tag):
return '''
function(doc) {
i... | stackoverflow-qa |
# Python Inverse of a Matrix
## Question
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.
## Answer
You should have a look at numpy if you do matrix manipulation. This is a module mainly written in C, which wil... | stackoverflow-qa |
# Python Inverse of a Matrix
## Question
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.
## Answer
If you hate numpy, get out RPy and your local copy of R, and use it instead.
(I would also echo to make you y... | stackoverflow-qa |
# Python Inverse of a Matrix
## Question
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.
## Answer
Make sure you really need to invert the matrix. This is often unnecessary and can be numerically unstable. W... | stackoverflow-qa |
# Python Inverse of a Matrix
## Question
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.
## Answer
You could calculate the determinant of the matrix which is recursive
and then form the adjoined matrix
Here i... | stackoverflow-qa |
# Python Inverse of a Matrix
## Question
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.
## Answer
It is a pity that the chosen matrix, repeated here again, is either singular or badly conditioned:
A = matrix... | stackoverflow-qa |
# Python Inverse of a Matrix
## Question
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.
## Answer
Numpy will be suitable for most people, but you can also do matrices in Sympy
Try running these commands at h... | stackoverflow-qa |
# Using SQLite in a Python program
## Question
I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fash... | stackoverflow-qa |
# Using SQLite in a Python program
## Question
I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fash... | stackoverflow-qa |
# Using SQLite in a Python program
## Question
I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fash... | stackoverflow-qa |
# Using SQLite in a Python program
## Question
I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fash... | stackoverflow-qa |
# Using SQLite in a Python program
## Question
I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fash... | stackoverflow-qa |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.