text
stringlengths
200
200k
source
stringclasses
2 values
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Speeding Up Python ## Question This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together: Firstly: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization? Secondly: When writing a program from s...
stackoverflow-qa
# Parsing and generating Microsoft Office 2007 files (.docx, .xlsx, .pptx) ## Question I have a web project where I must import text and images from a user-supplied document, and one of the possible formats is Microsoft Office 2007. There's also a need to generate documents in this format. The server runs CentOS 5.2 ...
stackoverflow-qa
# Parsing and generating Microsoft Office 2007 files (.docx, .xlsx, .pptx) ## Question I have a web project where I must import text and images from a user-supplied document, and one of the possible formats is Microsoft Office 2007. There's also a need to generate documents in this format. The server runs CentOS 5.2 ...
stackoverflow-qa
# Parsing and generating Microsoft Office 2007 files (.docx, .xlsx, .pptx) ## Question I have a web project where I must import text and images from a user-supplied document, and one of the possible formats is Microsoft Office 2007. There's also a need to generate documents in this format. The server runs CentOS 5.2 ...
stackoverflow-qa
# Parsing and generating Microsoft Office 2007 files (.docx, .xlsx, .pptx) ## Question I have a web project where I must import text and images from a user-supplied document, and one of the possible formats is Microsoft Office 2007. There's also a need to generate documents in this format. The server runs CentOS 5.2 ...
stackoverflow-qa
# Is there a way to prevent a SystemExit exception raised from sys.exit() from being caught? ## Question The docs say that calling sys.exit() raises a SystemExit exception which can be caught in outer levels. I have a situation in which I want to definitively and unquestionably exit from inside a test case, however t...
stackoverflow-qa
# Is there a way to prevent a SystemExit exception raised from sys.exit() from being caught? ## Question The docs say that calling sys.exit() raises a SystemExit exception which can be caught in outer levels. I have a situation in which I want to definitively and unquestionably exit from inside a test case, however t...
stackoverflow-qa
# python dictionary update method ## Question I have a list string tag. I am trying to initialize a dictionary with the key as the tag string and values as the array index. for i, ithTag in enumerate(tag): tagDict.update(ithTag=i) The above returns me {'ithTag': 608} 608 is the 608th index My problem is that...
stackoverflow-qa
# python dictionary update method ## Question I have a list string tag. I am trying to initialize a dictionary with the key as the tag string and values as the array index. for i, ithTag in enumerate(tag): tagDict.update(ithTag=i) The above returns me {'ithTag': 608} 608 is the 608th index My problem is that...
stackoverflow-qa
# python dictionary update method ## Question I have a list string tag. I am trying to initialize a dictionary with the key as the tag string and values as the array index. for i, ithTag in enumerate(tag): tagDict.update(ithTag=i) The above returns me {'ithTag': 608} 608 is the 608th index My problem is that...
stackoverflow-qa
# python dictionary update method ## Question I have a list string tag. I am trying to initialize a dictionary with the key as the tag string and values as the array index. for i, ithTag in enumerate(tag): tagDict.update(ithTag=i) The above returns me {'ithTag': 608} 608 is the 608th index My problem is that...
stackoverflow-qa
# python dictionary update method ## Question I have a list string tag. I am trying to initialize a dictionary with the key as the tag string and values as the array index. for i, ithTag in enumerate(tag): tagDict.update(ithTag=i) The above returns me {'ithTag': 608} 608 is the 608th index My problem is that...
stackoverflow-qa
# python dictionary update method ## Question I have a list string tag. I am trying to initialize a dictionary with the key as the tag string and values as the array index. for i, ithTag in enumerate(tag): tagDict.update(ithTag=i) The above returns me {'ithTag': 608} 608 is the 608th index My problem is that...
stackoverflow-qa
# Does anyone have experience with PyS60 mobile development ## Question I am in the position of having to make a technology choice early in a project which is targetted at mobile phones. I saw that there is a python derivative for S60 and wondered whether anyone could share experiences, good and bad, and suggest appr...
stackoverflow-qa
# Does anyone have experience with PyS60 mobile development ## Question I am in the position of having to make a technology choice early in a project which is targetted at mobile phones. I saw that there is a python derivative for S60 and wondered whether anyone could share experiences, good and bad, and suggest appr...
stackoverflow-qa
# Does anyone have experience with PyS60 mobile development ## Question I am in the position of having to make a technology choice early in a project which is targetted at mobile phones. I saw that there is a python derivative for S60 and wondered whether anyone could share experiences, good and bad, and suggest appr...
stackoverflow-qa
# Does anyone have experience with PyS60 mobile development ## Question I am in the position of having to make a technology choice early in a project which is targetted at mobile phones. I saw that there is a python derivative for S60 and wondered whether anyone could share experiences, good and bad, and suggest appr...
stackoverflow-qa
# Is it possible to pass arguments into event bindings? ## Question I haven't found an answer elsewhere and this doesn't appear to have been asked yet on SO. When creating an event binding in wxPython, is it possible to pass additional arguments to the event? For example, this is the normal way: b = wx.Button(self, ...
stackoverflow-qa
# Is it possible to pass arguments into event bindings? ## Question I haven't found an answer elsewhere and this doesn't appear to have been asked yet on SO. When creating an event binding in wxPython, is it possible to pass additional arguments to the event? For example, this is the normal way: b = wx.Button(self, ...
stackoverflow-qa
# How do I blink/control Macbook keyboard LEDs programmatically? ## Question Do you know how I can switch on/off (blink) Macbook keyboard led (caps lock,numlock) under Mac OS X (preferably Tiger)? I've googled for this, but have got no results, so I am asking for help. I would like to add this feature as notificatio...
stackoverflow-qa
# Python - Py2exe can't build .exe using the 'email' module ## Question py2exe does not work with the standard email module Hello. I am trying to use py2exe for converting a script into an exe. The build process shows this: The following modules appear to be missing ['email.Encoders', 'email.Generator', 'email.It...
stackoverflow-qa
# Python - Py2exe can't build .exe using the 'email' module ## Question py2exe does not work with the standard email module Hello. I am trying to use py2exe for converting a script into an exe. The build process shows this: The following modules appear to be missing ['email.Encoders', 'email.Generator', 'email.It...
stackoverflow-qa
# Python - Py2exe can't build .exe using the 'email' module ## Question py2exe does not work with the standard email module Hello. I am trying to use py2exe for converting a script into an exe. The build process shows this: The following modules appear to be missing ['email.Encoders', 'email.Generator', 'email.It...
stackoverflow-qa
# Python - Py2exe can't build .exe using the 'email' module ## Question py2exe does not work with the standard email module Hello. I am trying to use py2exe for converting a script into an exe. The build process shows this: The following modules appear to be missing ['email.Encoders', 'email.Generator', 'email.It...
stackoverflow-qa
# Python - Py2exe can't build .exe using the 'email' module ## Question py2exe does not work with the standard email module Hello. I am trying to use py2exe for converting a script into an exe. The build process shows this: The following modules appear to be missing ['email.Encoders', 'email.Generator', 'email.It...
stackoverflow-qa
# What is the best way to run multiple subprocesses via fork()? ## Question A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" chil...
stackoverflow-qa
# What is the best way to run multiple subprocesses via fork()? ## Question A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" chil...
stackoverflow-qa
# What is the best way to run multiple subprocesses via fork()? ## Question A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" chil...
stackoverflow-qa
# What is the best way to run multiple subprocesses via fork()? ## Question A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" chil...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How to output CDATA using ElementTree ## Question I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree. Can it be done...
stackoverflow-qa
# How do I convert a file's format from Unicode to ASCII using Python? ## Question I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format. What is the best way to convert the entire file format using Python? ## Ans...
stackoverflow-qa
# How do I convert a file's format from Unicode to ASCII using Python? ## Question I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format. What is the best way to convert the entire file format using Python? ## Ans...
stackoverflow-qa
# How do I convert a file's format from Unicode to ASCII using Python? ## Question I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format. What is the best way to convert the entire file format using Python? ## Ans...
stackoverflow-qa
# How do I convert a file's format from Unicode to ASCII using Python? ## Question I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format. What is the best way to convert the entire file format using Python? ## Ans...
stackoverflow-qa
# How do I convert a file's format from Unicode to ASCII using Python? ## Question I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format. What is the best way to convert the entire file format using Python? ## Ans...
stackoverflow-qa
# How do I convert a file's format from Unicode to ASCII using Python? ## Question I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format. What is the best way to convert the entire file format using Python? ## Ans...
stackoverflow-qa
# writing optimization function ## Question I'm trying to write a tennis reservation system and I got stucked with this problem. Let's say you have players with their prefs regarding court number, day and hour. Also every player is ranked so if there is day/hour slot and there are several players with preferences for ...
stackoverflow-qa
# writing optimization function ## Question I'm trying to write a tennis reservation system and I got stucked with this problem. Let's say you have players with their prefs regarding court number, day and hour. Also every player is ranked so if there is day/hour slot and there are several players with preferences for ...
stackoverflow-qa
# writing optimization function ## Question I'm trying to write a tennis reservation system and I got stucked with this problem. Let's say you have players with their prefs regarding court number, day and hour. Also every player is ranked so if there is day/hour slot and there are several players with preferences for ...
stackoverflow-qa
# writing optimization function ## Question I'm trying to write a tennis reservation system and I got stucked with this problem. Let's say you have players with their prefs regarding court number, day and hour. Also every player is ranked so if there is day/hour slot and there are several players with preferences for ...
stackoverflow-qa
# writing optimization function ## Question I'm trying to write a tennis reservation system and I got stucked with this problem. Let's say you have players with their prefs regarding court number, day and hour. Also every player is ranked so if there is day/hour slot and there are several players with preferences for ...
stackoverflow-qa
# Python List vs. Array - when to use? ## Question If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performa...
stackoverflow-qa
# Python List vs. Array - when to use? ## Question If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performa...
stackoverflow-qa
# Python List vs. Array - when to use? ## Question If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performa...
stackoverflow-qa
# Python List vs. Array - when to use? ## Question If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performa...
stackoverflow-qa
# Python List vs. Array - when to use? ## Question If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performa...
stackoverflow-qa
# Python List vs. Array - when to use? ## Question If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performa...
stackoverflow-qa
# Python List vs. Array - when to use? ## Question If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performa...
stackoverflow-qa
# Writing a reliable, totally-ordered multicast system in Python ## Question I have to write a reliable, totally-ordered multicast system from scratch in Python. I can't use any external libraries. I'm allowed to use a central sequencer. There seems to be two immediate approaches: write an efficient system, attach...
stackoverflow-qa
# Writing a reliable, totally-ordered multicast system in Python ## Question I have to write a reliable, totally-ordered multicast system from scratch in Python. I can't use any external libraries. I'm allowed to use a central sequencer. There seems to be two immediate approaches: write an efficient system, attach...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Building a full text search engine: where to start ## Question I want to write a web application using Google App Engine (so the reference language would be Python). My application needs a simple search engine, so the users would be able to find data specifying keywords. For example, if I have one table with those ...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer >>> ["foo", "bar", "baz"].index("bar") 1 Reference: Data Structures > More on Lists Tags: python, list
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer One thing that is really helpful in learning Python is to use the interactive help function: >>> help(["foo...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer index() returns the first index of value! | index(...) | L.index(value, [start, [stop]]) -> int...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer a = ["foo","bar","baz",'bar','any','much'] b = [item for item in range(len(a)) if a[item] == 'bar'] Tags: ...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer Problem will arrise if the element is not in the list. You can use this function, it handles the issue: # i...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer All of the proposed functions here reproduce inherent language behavior but obscure what's going on. [i for...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer Simply you can go with a = [['hand', 'head'], ['phone', 'wallet'], ['lost', 'stock']] b = ['phone', 'lost']...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer Another option >>> a = ['red', 'blue', 'green', 'red'] >>> b = 'red' >>> offset = 0; >>> indices = list() >...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer I'm honestly surprised no one has mentioned enumerate() yet: for i, j in enumerate(['foo', 'bar', 'baz']): ...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer To get all indexes: indexes = [i for i,x in enumerate(xs) if x == 'foo'] Tags: python, list
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer A variant on the answer from FMc and user7177 will give a dict that can return all indices for any entry: >...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer You have to set a condition to check if the element you're searching is in the list if 'your_element' in my...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer And now, for something completely different, checking for the existence of the item before getting the index...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer This solution is not as powerful as others, but if you're a beginner and only know about forloops it's still...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer all indexes with zip function get_indexes = lambda x, xs: [i for (y, i) in zip(xs, range(len(xs))) if x == ...
stackoverflow-qa
# Finding the index of an item given a list containing it in Python ## Question For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? ## Answer If you want all indexes, then you can use numpy: import numpy as np array = [1,2,1,3,4,5,1] item = 1 np_ar...
stackoverflow-qa
# Offline access to MoinMoin wiki using Google Gears ## Question How to add offline access functionality to MoinMoin wiki? As a minimum, I would love to have browsing access to all pages on a server-based wiki (while being offline). Search and other things, which do not modify the content, are secondary. An added bo...
stackoverflow-qa
# Offline access to MoinMoin wiki using Google Gears ## Question How to add offline access functionality to MoinMoin wiki? As a minimum, I would love to have browsing access to all pages on a server-based wiki (while being offline). Search and other things, which do not modify the content, are secondary. An added bo...
stackoverflow-qa
# Offline access to MoinMoin wiki using Google Gears ## Question How to add offline access functionality to MoinMoin wiki? As a minimum, I would love to have browsing access to all pages on a server-based wiki (while being offline). Search and other things, which do not modify the content, are secondary. An added bo...
stackoverflow-qa
# Offline access to MoinMoin wiki using Google Gears ## Question How to add offline access functionality to MoinMoin wiki? As a minimum, I would love to have browsing access to all pages on a server-based wiki (while being offline). Search and other things, which do not modify the content, are secondary. An added bo...
stackoverflow-qa
# SQL Absolute value across columns ## Question I have a table that looks something like this: word big expensive smart fast dog 9 -10 -20 4 professor 2 4 40 -7 ferrari 7 50 0 48 alaska 10 0 1 0 gnat -3 ...
stackoverflow-qa
# SQL Absolute value across columns ## Question I have a table that looks something like this: word big expensive smart fast dog 9 -10 -20 4 professor 2 4 40 -7 ferrari 7 50 0 48 alaska 10 0 1 0 gnat -3 ...
stackoverflow-qa
# SQL Absolute value across columns ## Question I have a table that looks something like this: word big expensive smart fast dog 9 -10 -20 4 professor 2 4 40 -7 ferrari 7 50 0 48 alaska 10 0 1 0 gnat -3 ...
stackoverflow-qa
# Alert boxes in Python? ## Question Is it possible to produce an alert similar to JavaScript's alert("message") in python, with an application running as a daemon. This will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities. Update: This is intended to run in the background and a...
stackoverflow-qa