text
stringlengths
200
200k
source
stringclasses
2 values
# Can you add new statements to Python's syntax? ## Question Can you add new statements (like print, raise, with) to Python's syntax? Say, to allow.. mystatement "Something" Or, new_if True: print "example" Not so much if you should, but rather if it's possible (short of modifying the python interpreters co...
stackoverflow-qa
# Efficient Image Thumbnail Control for Python? ## Question What is the best choice for a Python GUI application to display large number of thumbnails, e.g. 10000 or more? For performance reasons such thumbnail control must support virtual items, i.e. request application for those thumbnails only which are currently v...
stackoverflow-qa
# Efficient Image Thumbnail Control for Python? ## Question What is the best choice for a Python GUI application to display large number of thumbnails, e.g. 10000 or more? For performance reasons such thumbnail control must support virtual items, i.e. request application for those thumbnails only which are currently v...
stackoverflow-qa
# Efficient Image Thumbnail Control for Python? ## Question What is the best choice for a Python GUI application to display large number of thumbnails, e.g. 10000 or more? For performance reasons such thumbnail control must support virtual items, i.e. request application for those thumbnails only which are currently v...
stackoverflow-qa
# wxpython - Expand list control vertically not horizontally ## Question I have a ListCtrl that displays a list of items for the user to select. This works fine except that when the ctrl is not large enough to show all the items, I want it to expand downwards with a vertical scoll bar rather than using a horizontal sc...
stackoverflow-qa
# wxpython - Expand list control vertically not horizontally ## Question I have a ListCtrl that displays a list of items for the user to select. This works fine except that when the ctrl is not large enough to show all the items, I want it to expand downwards with a vertical scoll bar rather than using a horizontal sc...
stackoverflow-qa
# How do you fix a Trac installation that begins giving errors relating to PYTHON_EGG_CACHE? ## Question We've been using Trac for task/defect tracking and things were going well enough, but this morning it started serving up a 500 error. Looking in the Apache error_log, I get a stack trace that culminates in: Pytho...
stackoverflow-qa
# How do you fix a Trac installation that begins giving errors relating to PYTHON_EGG_CACHE? ## Question We've been using Trac for task/defect tracking and things were going well enough, but this morning it started serving up a 500 error. Looking in the Apache error_log, I get a stack trace that culminates in: Pytho...
stackoverflow-qa
# What's a good library to manipulate Apache2 config files? ## Question I'd like to create a script to manipulate Apache2 configuration directly, reading and writing its properties (like adding a new VirtualHost, changing settings of one that already exists). Are there any libs out there, for Perl, Python or Java tha...
stackoverflow-qa
# What's a good library to manipulate Apache2 config files? ## Question I'd like to create a script to manipulate Apache2 configuration directly, reading and writing its properties (like adding a new VirtualHost, changing settings of one that already exists). Are there any libs out there, for Perl, Python or Java tha...
stackoverflow-qa
# What's a good library to manipulate Apache2 config files? ## Question I'd like to create a script to manipulate Apache2 configuration directly, reading and writing its properties (like adding a new VirtualHost, changing settings of one that already exists). Are there any libs out there, for Perl, Python or Java tha...
stackoverflow-qa
# What's a good library to manipulate Apache2 config files? ## Question I'd like to create a script to manipulate Apache2 configuration directly, reading and writing its properties (like adding a new VirtualHost, changing settings of one that already exists). Are there any libs out there, for Perl, Python or Java tha...
stackoverflow-qa
# What's a good library to manipulate Apache2 config files? ## Question I'd like to create a script to manipulate Apache2 configuration directly, reading and writing its properties (like adding a new VirtualHost, changing settings of one that already exists). Are there any libs out there, for Perl, Python or Java tha...
stackoverflow-qa
# What's the difference between a parent and a reference property in Google App Engine? ## Question From what I understand, the parent attribute of a db.Model (typically defined/passed in the constructor call) allows you to define hierarchies in your data models. As a result, this increases the size of the entity grou...
stackoverflow-qa
# What's the difference between a parent and a reference property in Google App Engine? ## Question From what I understand, the parent attribute of a db.Model (typically defined/passed in the constructor call) allows you to define hierarchies in your data models. As a result, this increases the size of the entity grou...
stackoverflow-qa
# What is the purpose of the colon before a block in Python? ## Question What is the purpose of the colon before a block in Python? Example: if n == 0: print "The end" ## Answer The colon is there to declare the start of an indented block. Technically, it's not necessary; you could just indent and de-indent wh...
stackoverflow-qa
# What is the purpose of the colon before a block in Python? ## Question What is the purpose of the colon before a block in Python? Example: if n == 0: print "The end" ## Answer Three reasons: To increase readability. The colon helps the code flow into the following indented block. To help text editors/IDEs, ...
stackoverflow-qa
# What is the purpose of the colon before a block in Python? ## Question What is the purpose of the colon before a block in Python? Example: if n == 0: print "The end" ## Answer Consider the following list of things to buy from the grocery store, written in Pewprikanese. pewkah lalala chunkykachoo pewp...
stackoverflow-qa
# What is the purpose of the colon before a block in Python? ## Question What is the purpose of the colon before a block in Python? Example: if n == 0: print "The end" ## Answer As far as I know, it's an intentional design to make it more obvious, that the reader should expect an indentation after the colon. I...
stackoverflow-qa
# How do I find all cells with a particular attribute in BeautifulSoup? ## Question Hi I am trying to develop a script to pull some data from a large number of html tables. One problem is that the number of rows that contain the information to create the column headings is indeterminate. I have discovered that the l...
stackoverflow-qa
# Why Python decorators rather than closures? ## Question I still haven't got my head around decorators in Python. I've already started using a lot of closures to do things like customize functions and classes in my coding. Eg. class Node : def __init__(self,val,children) : self.val = val self.c...
stackoverflow-qa
# Why Python decorators rather than closures? ## Question I still haven't got my head around decorators in Python. I've already started using a lot of closures to do things like customize functions and classes in my coding. Eg. class Node : def __init__(self,val,children) : self.val = val self.c...
stackoverflow-qa
# How can you use BeautifulSoup to get colindex numbers? ## Question I had a problem a week or so ago. Since I think the solution was cool I am sharing it here while I am waiting for an answer to the question I posted earlier. I need to know the relative position for the column headings in a table so I know how to m...
stackoverflow-qa
# Python embedded in CPP: how to get data back to CPP ## Question While working on a C++ project, I was looking for a third party library for something that is not my core business. I found a really good library, doing exactly what's needed, but it is written in Python. I decided to experiment with embedding Python co...
stackoverflow-qa
# Python embedded in CPP: how to get data back to CPP ## Question While working on a C++ project, I was looking for a third party library for something that is not my core business. I found a really good library, doing exactly what's needed, but it is written in Python. I decided to experiment with embedding Python co...
stackoverflow-qa
# Python embedded in CPP: how to get data back to CPP ## Question While working on a C++ project, I was looking for a third party library for something that is not my core business. I found a really good library, doing exactly what's needed, but it is written in Python. I decided to experiment with embedding Python co...
stackoverflow-qa
# How do I coherently organize modules for a PyGTK desktop application? ## Question I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way: application.py - holds the primary application class (most func...
stackoverflow-qa
# How do I coherently organize modules for a PyGTK desktop application? ## Question I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way: application.py - holds the primary application class (most func...
stackoverflow-qa
# How do I coherently organize modules for a PyGTK desktop application? ## Question I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way: application.py - holds the primary application class (most func...
stackoverflow-qa
# How do I coherently organize modules for a PyGTK desktop application? ## Question I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way: application.py - holds the primary application class (most func...
stackoverflow-qa
# Smart Sudoku Golf ## Question The point of this question is to create the shortest not abusively slow Sudoku solver. This is defined as: don't recurse when there are spots on the board which can only possibly be one digit. Here is the shortest I have so far in python: r=range(81) s=range(1,10) def R(A): bzt={}...
stackoverflow-qa
# Smart Sudoku Golf ## Question The point of this question is to create the shortest not abusively slow Sudoku solver. This is defined as: don't recurse when there are spots on the board which can only possibly be one digit. Here is the shortest I have so far in python: r=range(81) s=range(1,10) def R(A): bzt={}...
stackoverflow-qa
# Smart Sudoku Golf ## Question The point of this question is to create the shortest not abusively slow Sudoku solver. This is defined as: don't recurse when there are spots on the board which can only possibly be one digit. Here is the shortest I have so far in python: r=range(81) s=range(1,10) def R(A): bzt={}...
stackoverflow-qa
# How close are development webservers to production webservers? ## Question Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents? I haven't quite decided whi...
stackoverflow-qa
# How close are development webservers to production webservers? ## Question Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents? I haven't quite decided whi...
stackoverflow-qa
# How close are development webservers to production webservers? ## Question Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents? I haven't quite decided whi...
stackoverflow-qa
# How close are development webservers to production webservers? ## Question Most python frameworks will have a development webserver of some kind that will have a warning that it isn't for use as production servers. How much different do they tend to be from their production equivalents? I haven't quite decided whi...
stackoverflow-qa
# Group by date in a particular format in SQLAlchemy ## Question I have a table called logs which has a datetime field. I want to select the date and count of rows based on a particular date format. How do I do this using SQLAlchemy? ## Answer Does counting yield the same result when you just group by the unformat...
stackoverflow-qa
# Group by date in a particular format in SQLAlchemy ## Question I have a table called logs which has a datetime field. I want to select the date and count of rows based on a particular date format. How do I do this using SQLAlchemy? ## Answer I don't know of a generic SQLAlchemy answer. Most databases support so...
stackoverflow-qa
# In Python, what does it mean if an object is subscriptable or not? ## Question Which types of objects fall into the domain of "subscriptable"? ## Answer It basically means that the object implements the __getitem__() method. In other words, it describes objects that are "containers", meaning they contain other obje...
stackoverflow-qa
# In Python, what does it mean if an object is subscriptable or not? ## Question Which types of objects fall into the domain of "subscriptable"? ## Answer A scriptable object is an object that records the operations done to it and it can store them as a "script" which can be replayed. For example, see: Application S...
stackoverflow-qa
# In Python, what does it mean if an object is subscriptable or not? ## Question Which types of objects fall into the domain of "subscriptable"? ## Answer Off the top of my head, the following are the only built-ins that are subscriptable: string: "foobar"[3] == "b" tuple: (1,2,3,4)[3] == 4 list: [1,2,3,4][3] ...
stackoverflow-qa
# How can I determine the display idle time from Python in Windows, Linux, and MacOS? ## Question I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer an...
stackoverflow-qa
# How can I determine the display idle time from Python in Windows, Linux, and MacOS? ## Question I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer an...
stackoverflow-qa
# How can I determine the display idle time from Python in Windows, Linux, and MacOS? ## Question I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer an...
stackoverflow-qa
# Troubleshooting py2exe packaging problem ## Question I've written a setup.py script for py2exe, generated an executable for my python GUI application and I have a whole bunch of files in the dist directory, including the app, w9xopen.exe and MSVCR71.dll. When I try to run the application, I get an error message that...
stackoverflow-qa
# Troubleshooting py2exe packaging problem ## Question I've written a setup.py script for py2exe, generated an executable for my python GUI application and I have a whole bunch of files in the dist directory, including the app, w9xopen.exe and MSVCR71.dll. When I try to run the application, I get an error message that...
stackoverflow-qa
# how to generate unit test code for methods ## Question i want to write code for unit test to test my application code. I have different methods and now want to test these methods one by one in python script. but i do not how to i write. can any one give me example of small code for unit testing in python. i am thank...
stackoverflow-qa
# how to generate unit test code for methods ## Question i want to write code for unit test to test my application code. I have different methods and now want to test these methods one by one in python script. but i do not how to i write. can any one give me example of small code for unit testing in python. i am thank...
stackoverflow-qa
# how to generate unit test code for methods ## Question i want to write code for unit test to test my application code. I have different methods and now want to test these methods one by one in python script. but i do not how to i write. can any one give me example of small code for unit testing in python. i am thank...
stackoverflow-qa
# Getting method parameter names in python ## Question Given the python function: def aMethod(arg1, arg2): pass How can I extract the number and names of the arguments. Ie. given that I have a reference to func, I want the func.[something] to return ("arg1", "arg2") The usage scenario for this is that I have a...
stackoverflow-qa
# Getting method parameter names in python ## Question Given the python function: def aMethod(arg1, arg2): pass How can I extract the number and names of the arguments. Ie. given that I have a reference to func, I want the func.[something] to return ("arg1", "arg2") The usage scenario for this is that I have a...
stackoverflow-qa
# Getting method parameter names in python ## Question Given the python function: def aMethod(arg1, arg2): pass How can I extract the number and names of the arguments. Ie. given that I have a reference to func, I want the func.[something] to return ("arg1", "arg2") The usage scenario for this is that I have a...
stackoverflow-qa
# Getting method parameter names in python ## Question Given the python function: def aMethod(arg1, arg2): pass How can I extract the number and names of the arguments. Ie. given that I have a reference to func, I want the func.[something] to return ("arg1", "arg2") The usage scenario for this is that I have a...
stackoverflow-qa
# Getting method parameter names in python ## Question Given the python function: def aMethod(arg1, arg2): pass How can I extract the number and names of the arguments. Ie. given that I have a reference to func, I want the func.[something] to return ("arg1", "arg2") The usage scenario for this is that I have a...
stackoverflow-qa
# How do you share data between a parent and forked child process in Python? ## Question I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome. ## Answer This is pretty much Python-independe...
stackoverflow-qa
# How do you share data between a parent and forked child process in Python? ## Question I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome. ## Answer You have two options: os.popen* in t...
stackoverflow-qa
# How do you share data between a parent and forked child process in Python? ## Question I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome. ## Answer Subprocess replaces os.popen, os.sys...
stackoverflow-qa
# How do you share data between a parent and forked child process in Python? ## Question I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome. ## Answer Take a look at the multiprocessing m...
stackoverflow-qa
# how can i use sharepoint (via soap?) from python? ## Question I want to use Sharepoint with python (C-Python) Has anyone tried this before ? ## Answer SharePoint exposes several web services which you can use to query and update data. I'm not sure what web service toolkits there are for Python but they should be ...
stackoverflow-qa
# how can i use sharepoint (via soap?) from python? ## Question I want to use Sharepoint with python (C-Python) Has anyone tried this before ? ## Answer SOAP with Python is pretty easy. Here's a tutorial from Dive Into Python. Tags: python, sharepoint, soap, ntlm, suds
stackoverflow-qa
# how can i use sharepoint (via soap?) from python? ## Question I want to use Sharepoint with python (C-Python) Has anyone tried this before ? ## Answer To get the wsdl : import sys # we use suds -> https://fedorahosted.org/suds from suds import WebFault from suds.client import * import urllib2 # my 2 url conf # ...
stackoverflow-qa
# how can i use sharepoint (via soap?) from python? ## Question I want to use Sharepoint with python (C-Python) Has anyone tried this before ? ## Answer I suspect that since this question was answered the SUDS library has been updated to take care of the required authentication itself. After jumping through various ...
stackoverflow-qa
# How Python web frameworks, WSGI and CGI fit together ## Question I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web p...
stackoverflow-qa
# How Python web frameworks, WSGI and CGI fit together ## Question I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web p...
stackoverflow-qa
# How Python web frameworks, WSGI and CGI fit together ## Question I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web p...
stackoverflow-qa
# How Python web frameworks, WSGI and CGI fit together ## Question I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web p...
stackoverflow-qa
# How Python web frameworks, WSGI and CGI fit together ## Question I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web p...
stackoverflow-qa
# How do I use Tkinter with Python on Windows Vista? ## Question I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to ...
stackoverflow-qa
# How do I use Tkinter with Python on Windows Vista? ## Question I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to ...
stackoverflow-qa
# django,fastcgi: how to manage a long running process? ## Question I have inherited a django+fastcgi application which needs to be modified to perform a lengthy computation (up to half an hour or more). What I want to do is run the computation in the background and return a "your job has been started" -type response....
stackoverflow-qa
# django,fastcgi: how to manage a long running process? ## Question I have inherited a django+fastcgi application which needs to be modified to perform a lengthy computation (up to half an hour or more). What I want to do is run the computation in the background and return a "your job has been started" -type response....
stackoverflow-qa
# I’m stunned: weird problem with python and sockets + threads ## Question I have a python script that is a http-server: http://paste2.org/p/89701, when benchmarking it against ApacheBench (ab) with a concurrency level (-c switch) that is lower then or equal to the value i specified in the socket.listen()-call in th...
stackoverflow-qa
# I’m stunned: weird problem with python and sockets + threads ## Question I have a python script that is a http-server: http://paste2.org/p/89701, when benchmarking it against ApacheBench (ab) with a concurrency level (-c switch) that is lower then or equal to the value i specified in the socket.listen()-call in th...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Ensure a single instance of an application in Linux ## Question I'm working on a GUI application in WxPython, and I am not sure how I can ensure that only one copy of my application is running at any given time on the machine. Due to the nature of the application, running more than once doesn't make any sense, and w...
stackoverflow-qa
# Including PYDs/DLLs in py2exe builds ## Question One of the modules for my app uses functions from a .pyd file. There's an option to exclude dlls (exclude_dlls) but is there one for including them? The build process doesn't seem to be copying the .pyd in my module despite copying the rest of the files (.py). I also ...
stackoverflow-qa
# Including PYDs/DLLs in py2exe builds ## Question One of the modules for my app uses functions from a .pyd file. There's an option to exclude dlls (exclude_dlls) but is there one for including them? The build process doesn't seem to be copying the .pyd in my module despite copying the rest of the files (.py). I also ...
stackoverflow-qa
# Including PYDs/DLLs in py2exe builds ## Question One of the modules for my app uses functions from a .pyd file. There's an option to exclude dlls (exclude_dlls) but is there one for including them? The build process doesn't seem to be copying the .pyd in my module despite copying the rest of the files (.py). I also ...
stackoverflow-qa
# Including PYDs/DLLs in py2exe builds ## Question One of the modules for my app uses functions from a .pyd file. There's an option to exclude dlls (exclude_dlls) but is there one for including them? The build process doesn't seem to be copying the .pyd in my module despite copying the rest of the files (.py). I also ...
stackoverflow-qa
# load dll from python ## Question I'm building a python application from some source code I've found Here I've managed to compile and fix some problems by searching the web, but I'm stuck at this point: When running the application this message appears. This python app, usues swig to link to c/c++ code. I have ...
stackoverflow-qa
# What is the best way on python 2.3 for windows to execute a program like ghostscript with multiple arguments and spaces in paths? ## Question Surely there is some kind of abstraction that allows for this? This is essentially the command cmd = self._ghostscriptPath + 'gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=...
stackoverflow-qa
# How can I write a method within a Django model to retrieve related objects? ## Question I have two models. We'll call them object A and object B. Their design looks something like this: class Foo(models.Model): name = models.CharField() class Bar(models.Model): title = models.CharField() Foo= models...
stackoverflow-qa
# Is it possible to implement Python code-completion in TextMate? ## Question PySmell seems like a good starting point. I think it should be possible, PySmell's idehelper.py does a majority of the complex stuff, it should just be a case of giving it the current line, offering up the completions (the bit I am not sure...
stackoverflow-qa
# Is it possible to implement Python code-completion in TextMate? ## Question PySmell seems like a good starting point. I think it should be possible, PySmell's idehelper.py does a majority of the complex stuff, it should just be a case of giving it the current line, offering up the completions (the bit I am not sure...
stackoverflow-qa
# Is it possible to implement Python code-completion in TextMate? ## Question PySmell seems like a good starting point. I think it should be possible, PySmell's idehelper.py does a majority of the complex stuff, it should just be a case of giving it the current line, offering up the completions (the bit I am not sure...
stackoverflow-qa
# Putting Copyright Symbol into a Python File ## Question I need to include a copyright statement at the top of every Python source file I produce: # Copyright: © 2008 etc. However, when I then run such a file I get this message: SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encodi...
stackoverflow-qa
# Putting Copyright Symbol into a Python File ## Question I need to include a copyright statement at the top of every Python source file I produce: # Copyright: © 2008 etc. However, when I then run such a file I get this message: SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encodi...
stackoverflow-qa
# Putting Copyright Symbol into a Python File ## Question I need to include a copyright statement at the top of every Python source file I produce: # Copyright: © 2008 etc. However, when I then run such a file I get this message: SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encodi...
stackoverflow-qa
# Putting Copyright Symbol into a Python File ## Question I need to include a copyright statement at the top of every Python source file I produce: # Copyright: © 2008 etc. However, when I then run such a file I get this message: SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encodi...
stackoverflow-qa
# Putting Copyright Symbol into a Python File ## Question I need to include a copyright statement at the top of every Python source file I produce: # Copyright: © 2008 etc. However, when I then run such a file I get this message: SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encodi...
stackoverflow-qa
# Putting Copyright Symbol into a Python File ## Question I need to include a copyright statement at the top of every Python source file I produce: # Copyright: © 2008 etc. However, when I then run such a file I get this message: SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encodi...
stackoverflow-qa
# Removing a sequence of characters from a large binary file using python ## Question I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binar...
stackoverflow-qa
# Removing a sequence of characters from a large binary file using python ## Question I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binar...
stackoverflow-qa