« first day (2 days earlier)      last day (32 days later) » 

12:06 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Making non-square boarders in Tkinter

anteater7171I have a program that looks like the following What is the easiest way to give it slanted edges, like the following? This is in windows 7, b...

python tkinter
 
12:17 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Disabling Django CSRF for views that do not always have a response

AdamI have a Django view that receives POSTs which do not need to have the CSRF token. Therefore I used the @csrf_exempt decorator on the view. The problem is that sometimes I do not issue a response from the view (it's a Twitter bot, it receives an HTTP POST for every tweet and I do ...

python django csrf python-decorators django-csrf
 
12:33 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Shot rot13 function

Sven WalterHi there! I am searching for an short and cool rot13 function in Python ;-) I've written this function: def rot13(s): chars = "abcdefghijklmnopqrstuvwxyz" trans = chars[13:]+chars[:13] rot_char = lambda c: trans[chars.find(c)] if chars.find(c)>-1 else c ...

python fun
 
12:44 AM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Manipulating strings in python - concentrating on part of a user's input

Tehto resp = raw_input("What is your favorite fruit?\n") if "I like" in resp: print "%s" - "I like" + " is a delicious fruit." % resp else: print "Bubbles and beans." OK I know this code doesn't work, and I know why. You can't subtract strings from each other...

python beginner
 
1:06 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Dynamically Linking Python Extension (.pyd) to Another Extension

Brad ZeisPython Extension modules are just dynamic libraries, so I assume it's possible to link a Python extension to another. The problem is on Windows they are given the .pyd extension instead of .dll, so I can't get distutils to link them when I run the setup script. (I don...

python distutils dynamic-linking
newest questions tagged python - Stack Overflow
0
votes
0
answers
Convert three column text file to matrix

user393694Hi I'd like to convert a file that's tab delimited and looks like this: Species Date Data 1 Dec 3 2 Jan 4 2 Dec 6 2 Dec 3 to a matrix like this (species is the row header): 1 2 Dec 3 9 Jan 4

python matrix scipy
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to use os.spawnv to send email copy using Python?

ChiraelFirst let me say that I know it's better to use the subprocess module, but I'm editing other people's code and I'm trying to make as few changes as possible, which includes avoiding the importing any new modules. So I'd like to stick to the currently-imported modules (os, sys, and paths) if a...

python processes postfix mailman
 
1:27 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
how to copy a model on google-app-engine(python)

zjm1126i want to get a new model that the same as one model , so how do i copy it , thanks this is my model: class Geo(db.Model): title = db.StringProperty() link = db.StringProperty() updated = db.DateTimeProperty(auto_now =True) author = db.Re...

python google-app-engine model copy
 
1:49 AM
newest questions tagged python - Stack Overflow
0
votes
2
answers
= Try Except Pattern?

MarkI find this design pattern comes up a lot: try: year = int(request.GET['year']) except: year = 0 The try block can either fail because the key doesn't exist, or because it's not an int, but I don't really care. I just need a sane valu...

python design-patterns
 
2:05 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
[PyGTK] Saving gtk.TextTags to file?

SmartboySo I am trying to write a rich text editor in PyGTK, and originally used the older, third party script InteractivePangoBuffer from Gourmet to do this. While it worked alright, there were still plenty of bugs with it which made it frustrating to use at times, so I decided to write my own utiliz...

python pygtk
 
2:22 AM
newest questions tagged python - Stack Overflow
0
votes
3
answers
function in python

ShilpaIn a function, I need to perform some logic that requires me to call a funtion inside a function. what i did with this , like : def dfs(problem): stack.push(bache) search(root) while stack.isEmpty() != 0: def search(vertex): closed.add(vertex) ...

python
 
2:42 AM
Oohhh... so questions are in the chat?
Nifty.
 
3:00 AM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Python circular references

sharveyHi, trying to have two class that reference each others, in the same file. What would be the best way to have this working: class Foo(object): other = Bar class Bar(object): other = Foo if __name__ == '__main__': print 'all ok' ? The pro...

python circular-dependency
 
3:27 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Getting isMultipartContent = false while using python poster library

jeanhHi, I'm using the python poster library to try to upload a form containing including an image to a servlet. Locally, it runs fine, but when I deploy to app engine, it doesn't recognize it as multipart content. ServletFileUpload.isMultipartContent(request) returns false ...

python multipart-form poster
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python: Problem with if statement

TimI have problem with a if statement code below: do_blast(x): test_empty = open('/home/rv/ncbi-blast-2.2.23+/db/job_ID/%s.blast' % (z), 'r') if test_empty.read() == '': test_empty.close() return 'FAIL_NO_RESULTS' else: do_something def return_...

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
loop until all elements have been accessed N times in python

Fred MeyersI have a group of buckets, each with a certain number of items in them. I want to make combinations with one item from each bucket. The loop should keep making different combinations until each item has participated in at least some defined number. I can easily see how to run the loop ...

python list sorting loops while-loops
 
3:54 AM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Step into subroutine call, but not calls made for parameters

Matt Joinerfunc(a(), b.c) When executing the line above in the pdb debugger, using step will actually step into a, and then into the getter for b.c if its atypical (such as being a property), before actually stepping into

python debugger pdb-python
 
4:10 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How do I make Tkinter support PNG transparency?

anteater7171I put in a partially transparent PNG image in Tkinter and all I get is this How do I make the dark triangle on the left clear? (like it's supposed to be) This is python 2.6 on Windows 7, btw.

python png transparency tkinter
 
5:04 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Py3k libraries porting

zubin71I don't really know if this is a StackOverflow-type question or a Python-dev question. I'd like to host sprints at my place for converting python2.0 libraries to Python3.0 ; currently I am working on porting Distutils2. Is there any place I could find a graph/log of the libra...

python porting
 
5:47 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
contains or like equivalent in Google app engine with python.

anandHi all, Is there something equivalent to the conains or like queries in google app engine. I am working on app engine patch with google app engine. I tried but __icontains does not seem to work with google app engine. Please suggest. Thanks in advance.

python google-app-engine
 
6:14 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Good compilers for compiling perl/python/php scripts into linux executables?

EthanI am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP. But I don't want to expose the source code to my client. Is there any good comp...

php python perl compiler scripting-language
 
6:42 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
dictionary in python

Shilpas = problem.getSuccessors(currNode) print s child = dict((t[0], t[1:]) for t in s) print child output of s = [((5, 4), 'South', 1), ((4, 5), 'West', 1)] output of child = {(4, 5): ('West', 1), (5, 4): ('South', 1)} Why the order has been changed??...

python
 
7:19 AM
newest questions tagged python - Stack Overflow
1
votes
0
answers
Strange logic with bool

OckonalHello, I can't understand one thing with logic in python. Here is the code: maxCounter = 1500 localCounter = 0 while True: print str(localCounter) + ' >= ' + str(maxCounter) print localCounter >= maxCounter if localCounter >= maxCounter: break loca...

python boolean
 
7:52 AM
newest questions tagged python - Stack Overflow
1
votes
1
answers
How does Python compare string and int?

polygenelubricantsThe following snippet is annotated with the output (as seen on ideone.com): print "100" < "2" # True print "5" > "9" # False print "100" < 2 # False print 100 < "2" # True print 5 > ...

python beginner comparison
 
8:08 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Is it possible to cut away transparent areas of Gtk-pixbuf ?

wuschelhaseHi, I am currently using rsvg in Python to separate Svggroups. I got it working so that rsvg loads a single group ... alas all the transparent space around that still remains. Is there a gtk functionallity to cut away all this space? Thanks for all the answers!

python gtk rsvg
newest questions tagged python - Stack Overflow
0
votes
0
answers
Ropemacs with Python 3

YktulaIs there any documentation about using ropemacs (or just Emacs with the default python.el) with Python 3? Will it work? With stackoverflow.com/questions/2855378/ropemacs-usage-tutorial/2...

python emacs
 

« first day (2 days earlier)      last day (32 days later) »