I'm using Windows, and trying to install html5lib-0.90 library on python
C:\>python C:\Users\Junior\Downloads\Python\html5lib-0.90\setup.py install
Traceback (most recent call last):
File "C:\Users\Junior\Downloads\Python\html5lib-0.90\setup.py", line 36, in <module>
for name in os.listdir(os.path.join('src','html5lib'))
WindowsError: ...
Hi,
I've got a Pylons controller with an action called serialize returning content_type=text/csv. I'd like the response of the action to be named based on the input patameter, i.e. for the following route, produced csv file should be named {id}.csv : /app/PROD/serialize => PROD.csv (so a user can open the file in Excel with a proper nam...
Hey this is a really quick question. I guess I'll give correct answer in less than 2 minutes after posting this question.
I've started learning python, like 5 minutes ago, so mind the stupidity of the question.
To test it I'm re-writing some algorithms i had.
Could someone tell me how can I read N ints from the input, and stop readin...
I was wondering if anyone knew how to add text to a tag (p, b -- any tag where you might want to include character data). The documentation mentions no where how you might do this.
...
I'm using python with pylons
I want to display the saved data from a textarea in a mako file with new lines formatted correctly for display
Is this the best way of doing it?
> ${c.info['about_me'].replace("\n", "<br />") | n}
...
Hello.
I am having problems with a Python script which is basically just analysing a CSV file line-by-line and then inserting each line into a MySQL table using a FOR loop:
f = csv.reader(open(filePath, "r"))
i = 1
for line in f:
if (i > skipLines):
vals = nullify(line)
try:
cursor.execute(query, vals)
...
I'm using Hudson to continuously build a Python project. Unit tests and code coverage work great, but this message appears when drilling into the Cobertura Coverage Report for my files that are not unit tests:
Source code is unavailable.Some possible reasons are:
* This is not the most recent build (to save on disk space, this plugin ...
i want to make from one big program 5 smaller programs:main and program1,program2,program3 and program4.programs1,2,3,4 should use variables from main program and return some new variables,and main program should use(or call) programs1,2,3,4...
can i bind these programs using functions,modules or something else and how?
i'm new in Pytho...
I would like to be able to make a Python dictionary with strings as keys and sets of strings as the values. E.g.: { "crackers" : ["crunchy", "salty"] } It must be a set, not a list.
However, when I try the following:
word_dict = dict()
word_dict["foo"] = set()
word_dict["foo"] = word_dict["foo"].add("baz") ...
I am using the multiprocessing python module with Queue for communication between processes. Some processes only send (i.e. queue.put) and I can't seem to find a way to detect when the receiving end gets terminated abruptly.
Is there a way to detect if the process at the other end of the Queue gets terminated without having to get from...
i want to get the userid and somethins other about user.
but i don't get this
i used pinax
what should i do ??
thanks
ex:facebook
Javascript (from therunaround demo):
FB.Facebook.get_sessionState().waitUntilReady(function() {
var user = FB.Facebook.apiClient.get_session() ?
FB.Facebook.apiClient.get_session...
Full disclosure, this is part of a homework assignment (though a small snippet, the project itself is a game playing AI).
I have this function built into a tree node class:
def recursive_score_calc(self):
current_score = self.board
for c in self.children:
child_score = c.recursive_score_calc()
...
So I just had like this mental explosion dude! I was looking at my Python source code and was reading some comments and then I looked a the comments again. When I came across this:
#!/usr/bin/env python
# A regular comment
Which made me wonder, was # chosen as the symbol to start a comment because it would allow the python program to ...
I really new to Python and coding in general, but I have been making some good strides.
I am able to pull some data off of the web through an API, and the result should be a string. What I am seeing though, are some instances such as "& amp;"" and " "". (I modified the character sets so it would print properly to the screen)
I fig...
import pythoncom, pyHook, logging, string
LOG_FILENAME = 'logfile.txt'
def OnKeyboardEvent(event):
print 'MessageName:',event.MessageName
print 'Time:',event.Time
print 'WindowName:',event.WindowName
print 'Ascii:', event.Ascii, chr(event.Ascii)
print 'Key:', event.Key
print '---'
k = event.Key
logging.b...
Hi,
The following python code is to traverse a 2D grid of (c, g) in some special order, which is stored in "jobs" and "job_queue". But I am not sure which kind of order it is after trying to understand the code. Is someone able to tell about the order and give some explanation for the purpose of each function? Thanks and regards!
impo...
How do I send the "Set-Cookie" header when working with a BaseHTTPServerRequestHandler, and Cookie? BaseCookie and children don't provide a method to output the value to be passed into send_header(), and *Cookie.output() does not provide a HTTP line delimiter.
Which Cookie class should I be using? Two have survived into Python3, what ar...
So, within the directory containing my GWT application, I can type in the console
ant devmode
And it will start up my GWT application as per usual. So far so good.
However, what if wish to specify the port as a dynamic argument when starting devmode. Something conceptually like:
ant devmode port=8821
Or am I supposed to pas...
(Here's a sort of hypothetical situation for everybody. I'm more looking for directions rather than straight processes, but if you can provide them, awesome!)
So let's say we have a list of athletes, I'm going to use figure skaters since I'm knee deep in the Winter Olympics right now. (I'm throwing it in a dictionary since that's my fir...
I have a basic grasp of XML and python and have been using minidom with some success. I have run into a situation where I am unable to get the values I want from an XML file. Here is the basic structure of the pre-existing file.
<localization>
<b n="Stats">
<l k="SomeStat1">
<v>10</v>
</l>
<l k="S...