hi,
how do i insert few row in an existing excel file using python? the excel file maybe be of any excel version. On windows that could have been possible by using win32com.client...but i need to make the changes in the linux environment. how can i do it?
...
I'm getting my JSON from reddit.com, essentially something like this. I have done quite a bit of reading, but I don't really understand how I can grab the information I want from this JSON (I want a list of the story links). I understand that I can "decode" the JSON into a dictionary, but do I need to recur throughout the JSON to get wha...
I use python debugger pdb. I use emacs for python programming. I use python-mode.el. My idea is to make emacs intuitive. So I need the following help for python programs (.py)
Whenever I press 'F9' key, the emacs should put "import pdb; pdb.set_trace();" statements in the current line and move the current line to one line below.
Senten...
I have a unique problem the way it should be handled in django admin.
I have following models structure...
class Product(models.Model):
name = models.CharField(max_length = 100)
base_price = models.DecimalField(max_digits = 5, decimal_places = 2)
def __unicode__(self):
return self.name
class Country(models.Mo...
I need to update my Facebook Fan Page in a django app so I have this code:
import facebook
from django.conf import settings
def login_facebook():
fb = facebook.Facebook(settings.FACEBOOK_API_KEY, settings.FACEBOOK_SECRET_KEY)
fb.session_key = settings.FACEBOOK_SESSION
fb.secret = settings.FACEBOOK_SECRET_KEY
fb.uid = se...
I need to migrate information that I created in SQLite3 to a MySQL database on my website. The website is on a hosted server. I have remote access to the MySQL database. I initially thought it would be easy, but I am not finding any good info on it, and everything I read seems to imply that you need to dump the SQLite3 file, convert i...
Possible Duplicate:
Can python send text to the Mac clipboard
How can I read text from the clipboard from Python in Mac OS x?
...
I want to change the django bydefault admin panel title bar where wirte the django administration.
Actually I want to replace the django administration with the my site name.
...
I am creating a subclass of QAbstractItemModel to be displayed in an QTreeView.
My index() and parent() function creates the QModelIndex using the QAbstractItemModel inherited function createIndex and providing it the row, column, and data needed. Here, for testing purposes, data is a Python string.
class TestModel(QAbstractItemModel):...
Hi all,
I have two arrays, a1 and a2. Assume len(a2) >> len(a1), and that a1 is a subset of a2.
I would like a quick way to return the a2 indices of all elements in a1. The time-intensive way to do this is obviously:
from operator import indexOf
indices = []
for i in a1:
indices.append(indexOf(a2,i))
This of course takes a long...
Hi,
I'm facing a very strange problem.
The following code:
import time
target_time = time.time() + 30.0
doesn't work in Python code called from C++ (embedding)!
target_time has the same value as time.time() and any attempt to modify it leaves the value unchanged in a pdb console...
It happens after I've called root.initialise() ...
I need to rewrite some Perl code in python. So I'm looking for the closest modules to what I'm using now in Perl (i.e. with similar functionality and stability):
DBI + DBD::mysql
LWP::UserAgent
WWW::Mechanize
XML::LibXML
HTML::TreeBuilder
CGI::FormBuilder
Template::Toolkit
What are the Python equivalents to these?
...
I am using Python to write chunks of text to files in a single operation:
open(file, 'w').write(text)
If the script is interrupted so a file write does not complete I want to have no file rather than a partially complete file. Can this be done?
...
I am interested in python, does python have any professional certification exams like the one java has, such as scjp?
or how can i obtain the professional certification for python?
...
I am tasked with migrating a server's networking from plain sockets to SSL in python 2.5, and I've run into a snag. It seems that just about no SSL library out there fully implements the socket interface, so the code we currently have can't be straight migrated.
Specifically, I can't seem to find a library that supports the 'setblocking...
I'm developing a multilingual Django website. It has two languages, English and Hebrew. I want the default language for every first-time visitor to be Hebrew, regardless of what his browser's Accept-Language is.
Of course, if he changes language to English (and thus gets the language cookie or the key in the session), it should remain a...
I have a CSV file that i need to rearrange and renecode. I'd like to run
line = line.decode('windows-1250').encode('utf-8')
on each line before it's parsed and split by the CSV reader. Or I'd like iterate over lines myself run the re-encoding and use just single line parsing form CSV library but with the same reader instance.
Is ther...
Hello all!
I am trying to access a dll located in the "c:/Program Files (x86)" folder in a 64-bits processor PC.
If I use os.path.exists to check if the dll exists, I receive an afirmative answer:
>>> print os.path.exists('c:/Program Files (x86)/Some Folder/SomeDll.dll')
True
But when I try to load the dll using ctypes, I get the fo...
I am looking for hexagonal self-organizing map on Python.
ready module. If one exists.
way to plot hexagonal cell
algorithms to work with hexagonal cells as array or smth else
About:
A self-organizing map (SOM) or self-organizing feature map (SOFM) is a type of artificial neural network that is trained using unsupervised learning t...
Hello.
I have to make a query that will get records containing "wd2" substring or not containing "wd" string at all. Is there any way to do it nicely?
Seems something like:
Record.objects.filter( Q(parameter__icontains="wd2") | Q( ## what should be here? ## ) )
...