We have a decent set of unit tests on our code and those unit tests run in under 2 minutes. We also use TeamCity to do a build and to run tests after each check in. However, we still get issues where a developer "forgets" to run all the tests before a commit resulting in TeamCity failure which if this check in was done at 6PM may stay b...
What is the format of the parameter activate_time in Python GTK+ when using Gtk.Menu.popup() method?
I have tried using int(time.time()) but I get a traceback saying an integer is required...
...
Hello,
I have a C function which expects a list \0 terminated strings as input:
void external_C( int length , const char ** string_list) {
// Inspect the content of string_list - but not modify it.
}
From python (with ctypes) I would like to call this function based on a list of python strings:
def call_c( string_list ):
li...
I have a list of lists that looks like:
floodfillque = [[1,1,e],[1,2,w], [1,3,e], [2,1,e], [2,2,e], [2,3,w]]
for each in floodfillque:
if each[2] == 'w':
floodfillque.remove(each)
else:
tempfloodfill.append(floodfillque[each[0+1][1]])
That is a simplified, but I think relevant part of the code.
Does the flood...
I have been receiving errors when trying to save and run this Python 3.1 script, and I'm not sure why. I'm new to python, and I've been trying some of the Project Euler problems (this is problem 2). I recieve a "invalid syntac" error on "evenfibsum(v)", and on the colon after "__main__". I'm not sure why this is as I wrote a script for t...
I have a list of n Entry widgets. Every widget accepts only one character, and then the focus is passed to the next one. I would like to ".get()" the values of the n widgets, but I can't get the last one. Here is the sample code:
import Tkinter as tk
def vf(event):
actual=entrylist.index(root.focus_get())
print "--",len(entryli...
EDIT
i have:
[{'a':1},{'b':2},{'c':1},{'d':2}]
the output should be:
{'a':1,'b':2,'c':1,'d':2}
...
The code is to search for a substring...the code takes in 2 inputs...the 2nd string is used to search...i.e 2nd string is smaller in length.
a=input("Enter the 1st string") //Giving error here
b=input("Enter the second string")
com=""
for x in range(0,len(a)):
com=""
for j in range(x,len(b)+x):
com=com...
ok, I have something like this:
self.pipeline = gst.Pipeline()
self.tee = gst.element_factory_make
self.source = gst.element_factory_make('subdevsrc')
self.source.set_property('viewfinder-mode', 1)
self.source.set_property('camera-device', 1)
self.capsfilter = gst.element_factory_make('capsfilter')
caps = ...
>>> type(_)
<type 'ellipsis'>
>>> 1 + 1
2
>>> _
2
>>>
what's the usefulness of this _ function?
...
Hello all, relatively long-time PHP user here. I could install XAMPP in my sleep at this point to the point where I can get a PHP script running in the browser at "localhost", but in my searches to find a similar path using Python, I've run out of Googling ideas. I've discovered the mod_python Apache mod, but then I also discovered that ...
In Python, what is the best way to get the
RFC 3339 YYYY-MM-DD text from the output of gtk.Calendar::get_date()?
...
Hi,
I'm not quite even sure where / what to search for - so apologies if this is a trivial thing that has been asked before!
I have two tables in sqlite:
table_A = [id, value1, value2]
table_A$foo = [id, foo(value1), foo(value2)]
table_A$bar = [id, bar(value1), bar(value2)]
Where foo() / bar() are arbitrary functions not really rele...
I am trying to have a regular expression match a value that spans multiple lines. I am using the re.S flag, but still get no results. Any ideas why?
This is the text that I am searching through:
<File id="abc.txt" EngRev="74">
<Identifier id="STRING_ID" isArray="1" goesWith="3027253">
<EngTranslation>"Value 1","Value 2","Value 3"...
Hi,
i am looking for something similar to
http://stackoverflow.com/questions/836218/organizing-gui-code, but for Python and PyQt4. Especially, I am looking at tips and examples of how to handle and store the configuration data, general state etc.
EDIT:
I have found some hints regarding older versions under: http://www.commandprompt.co...
The code I am using:
# Create LDAPObject instance
conn = ldap.initialize(url)
conn.protocol_version=ldap.VERSION3
conn.simple_bind_s(binddn,bindpw)
# This raises:
# ldap.SERVER_DOWN:
{'info': 'error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed', 'desc': "Can't contact LDAP server"}
When I use ldap:...
i'd like know about python tricks and tips.
how write a cleaner code when you have an unfortunate situation where you need to fit as much
as you can in one expression?
i have some questions:
Best way for speed propose
Best way for readable code
What you should never do
What you should avoid
Best expert python book
Libraries that yo...
I'm new to python and django, and when following the Django Book I learned about the command 'python manage.py syncdb' which generated database tables for me. In development environment I use sqlite in memory database, so it is automatically erased everytime I restart the server. So how do I script this 'syncdb' command?(Should that be d...
I actually partially asked this in this thread
http://stackoverflow.com/questions/3494020/organizing-files-in-tar-bz2-file-with-python
But it mad eme rethink what I was doing.
Now I think it might be a good idea to change the compression method I am using. I am currently using tar.bz2 compression. What I need to be able to do is access ...
Hello Stack Overflow contributers,
I'm a novice programmer learning Python right now, and I came upon this site which helps explain object-oriented paradigms. I know that metaclasses are classes of classes (like how meta-directories are directories of directories, etc. etc.), but I'm having trouble with something: What is the actual dif...