How can I extract the part of this stream (the one named BLABLABLA) from the pdf file which contains it??
<</Contents 583 0 R/CropBox[0 0 595.22 842]/MediaBox[0 0 595.22 842]/Parent 29 0 /Resources<</ColorSpace<</CS0 563 0 R>>/ExtGState<</GS0 568 0 R>>/Font<</TT0 559 0 R/TT1 560 0 R/TT2 561 0 R/TT3 562 0 R>>/ProcSet[/PDF/Text/ImageC]/P...
I am writing a Django app, and I would like an account to be created on our Google Apps hosted email using the Provisioning API whenever an account is created locally.
I would solely use signals, but since I would like the passwords to be synchronized across sites, I have monkeypatched User.objects.create_user and User.set_password usin...
Duplicate
See also:
http://stackoverflow.com/questions/419959/language-for-non-programmers-to-start-learning-programming
http://stackoverflow.com/questions/190957/what-language-is-best-for-a-beginner-to-learn
http://stackoverflow.com/questions/4769/easiest-language-to-start-with
I'm for advice on learning a new programming language....
Is there a library to do pretty on screen display with Python (mainly on Linux but preferably available on other OS too) ? I know there is python-osd but it uses libxosd which looks quite old. I would not call it pretty.
Maybe a Python binding for libaosd. But I did not find any.
...
Assume infile is a variable holding the name of an input file, and similarly outfile for output file. If infile ends in .js, I'd like to replace with .min.js and that's easy enough (I think).
outfile = re.sub(r'\b.js$', '.min.js', infile)
But my question is if infile ends in .min.js, then I do not want the substitution to take place. ...
I'd like to split strings like these
'foofo21'
'bar432'
'foobar12345'
into
['foofo', '21']
['bar', '432']
['foobar', '12345']
Does somebody know an easy and simple way to do this in python?
...
Hi,
I need to poll a web service, in this case twitter's API, and I'm wondering what the conventional wisdom is on this topic. I'm not sure whether this is important, but I've always found feedback useful in the past.
A couple scenarios I've come up with:
The querying process starts every X seconds, eg a cron job runs a python script...
My site is full of rounded corners on every box and picture, except for the thumbnails of user uploaded photos.
How can I use the Python Imaging Library to 'draw' white or transparent rounded corners onto each thumbnail?
...
I would like to be able to match a string literal with the option of escaped quotations.
For instance, I'd like to be able to search "this is a 'test with escaped\' values' ok" and have it properly recognize the backslash as an escape character. I've tried solutions like the following:
import re
regexc = re.compile(r"\'(.*?)(?<!\\)\'")
...
Hi,
I hope this question is not a RTFM one.
I am trying to write a Python script that extracts links from a standard HTML webpage (the <link href... tags).
I have searched the web for matching regexen and found many different patterns. Is there any agreed, standard regex to match links?
Adam
UPDATE:
I am actually looking for two diffe...
How would I go about programatically changing the desktop background in Mac OS X? I'd like to use python, but I'm interested in any way possible. Could I hook up to Terminal and call a certain command?
...
Hi,
I have a python interpreter embedded inside an application. The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application. What I would like to do is to essentially save the state of the interpreter and return to that state easily.
I started by storing the na...
"cd" as in the shell command to change working directory ...
...
When I'm moving through a file with a csv.reader, how do I return to the top of the file. If I were doing it with a normal file I could just do something like "file.seek(0)". Is there anything like that for the csv module?
Thanks ahead of time ;)
...
Say I have a Python function that returns multiple values in a tuple:
def func():
return 1, 2
Is there a nice way to ignore one of the results rather than just assigning to a temporary variable? Say if I was only interested in the first value, is there a better way than this:
x, temp = func()
...
Hi, in python is easy build a dictionary or array and pass it unpacked to a function with variable parameters
I have this:
- (BOOL) executeUpdate:(NSString*)sql, ... {
And the manual way is do this:
[db executeUpdate:@"insert into test (a, b, c, d, e) values (?, ?, ?, ?, ?)" ,
@"hi'", // look! I put in a ', and I'm not escaping i...
How could I unpack a tuple of unknown to, say, a list?
I have a number of columns of data and they get split up into a tuple by some function. I want to unpack this tuple to variables but I do not know how many columns I will have. Is there any way to dynamically unpack it to as many variables as I need?
Thanks for your help :)
...
Hi,
I'm trying to create a sudoku solver program in Java (maybe Python).
I'm just wondering how I should go about structuring this...
Do I create a class and make each box a object of that class (9x9=81 objects)? If yes, how do I control all the objects - in other words, how do I make them all call a certain method in the class?
Do I j...
I'm curious to know what commercial games, if any, have been written with pyGame. The scale doesn't matter much, it doesn't have to be a massive success, but it should be significant that more than 2 people have ever heard of it.
I ask this because nearly everything I saw on the pyGame website seemed fairly underwhelming. I understand...
As far as I am aware there is no inbuilt polygon functionality for Python. I want to create a 3D map and figured that polygons would be the best way to go about it.
Not wanting to reinvent the wheel I did some googling and found that there's a lot of Python stuff out there, but I couldn't find what I wanted. Thus before I reinvent the w...