I'm trying to use python to determine if one (small) image is within another (large) image.
Any suggestions before I take myself completely down the wrong path?
Hi,
What is Python's equivalent of "public static void main(String[] args) { ... }"? I remember having used it in the past and then forgot.
What I'm basically trying to remember is a function which I think included some underscores (__)...
thx
Hi, I have an application that starts several threads using
gobject.timeout_add(delay, function)
Now in my function I want to test and set on some variable, e.g.
def function(self):
if flag == True:
flag = False
doSomething()
Now to make this threadsafe, I would have to lock the function using some mutex lock.
Is this possible with Gtk? Or can I use the Python Lock objects from threading?
How can I log into my Launchpad account in a python script? Any sample code would be appreciated.
The login url is https://launchpad.net/+login and then redirect to something like https://login.launchpad.net/fJLVSRbxPfKTpVDr/+decide
Thanks in advance!
I am looking to setup a automated screen scraper that will run on Google app engine using python. I want it to scrape the site and put the specified results into a Entity in app engine. I am looking for some directions on what to use. I have seen beautifulsoup but wonder if people could recommend anything else that could run on Google App engine.
it works fine on 64 bit machines but for some reason will not work on python 2.4.3 on a 32-bit instance.
i get the error
'utf8' codec can't decode bytes in position 76-79: invalid data
for the code
try:
str(sourceresult.sourcename).encode('utf8','replace')
except:
raise Exception( repr(sourceresult.sourcename ) )
it returns 'kazamidori blog\xf9'
i have modified my site.py file to make UTF8 the default encoding, but still doesnt seem to be working.
Hi,
I want to find the most used colour in an image using python. for example detect the colour of the object in the following image
http://www.shopcrazy.com.ph/wp-content/images/2007/02/shiny-bags-01.jpg.
how to detect the base colour from the RGB codes(example - red in the above image).
I have read about python sched (task schedular), it works like a cron.
but I have a question :
lets say if i schedule a function to ryn after every 2 hours and in the mean time my system gets shut down, then I again restart the system...did the schedular automatically starts and will run the function after 2 hours? or i have to start that again after shutting down the system?
did sched work like a deamon?
Hello, I am creating a Beta Testers reporting module so they can send in thier comments on my software, but I would like to have the option to include a screenshot with the report. How do I take a screenshot of the screen with Python on Windows? I have found several examples on Linux, but haven't had much luck on Windows.
I want to be able to take a shortened or non-shortened URL and return its un-shortened form. How can I make a python program to do this?
Additional Clarification:
Case 1: shortened -- unshortened
Case 2: unshortened -- unshortened
e.g. bit.ly/silly in the input array should be google.com in the output array
e.g. google.com in the input array should be google.com in the output array
Thanks for the help!
I want to send a datetime.datetime object in serialized form from Python using JSON and de-serialize in JavaScript using JSON. What is the best way to do this?
Is there a general convention about exposing members in Python classes? I know that this is a case of "it depends", but maybe there is a rule of thumb.
Private member:
class Node:
def __init__(self):
self.__childs = []
def add_childs(self, *args):
self.__childs += args
node = Node()
node.add_childs("one", "two")
Public member:
class Node2:
def __init__(self):
self.childs = []
node2 = Node2()
node2.childs += "one", "two"
Hi there,
I have a piece of text that gets handed to me like:
here is line one\n\nhere is line two\n\nhere is line three
What I would like to do is break this string up into three separate variables.
I'm not quite sure how one would go about accomplishing this in python.
Thanks for any help,
jml
I was working with Python with a Linux terminal screen. When I typed:
help(somefunction)
It printed the appropriate output, but then my screen was stuck, and at the bottom of the terminal was "(end)".
How do I get unstuck? Thanks in advance.
I have a few questions about python
I've seen many pages like these on Google
http://mail.google.com/support/bin/answer.py?answer=6583
https://www.google.com/adsense/support/bin/topic.py?topic=13488
...that have .py extensions. 1: Are pages like these built on pure python code, but printing out html like print "<div etc..." or like the typical asp,jsp,php type of pages with html pages and embedded python code like:
<html>
<% some python code %>
</html>
2: What is python mainly used for making? windows apps or web or .. ?
3: Are ruby and perl also similar to python?
I am building a python application to pull data from a website. The application has to authenticate(HTTPS/SSL) with a CAC card and pin in order to make requests.
Am I correct in my assumptions that you can't retrieve the private key from a CAC card, and am therefore stuck using a PKCS #11 Wrapper like PyKCS?
Any tips or resources for going about this?
Hi,
I need to construct an if statement from the data coming from the client as below:
conditions: condition1, condition2, condition3, condition4
logical operators: lo1, lo2, lo3 (Possible values: "and" "or")
Eg.
if condition1 lo1 condition2 lo3 condition4:
# Do something
I can think of eval/exec but not sure how safe they are! Any better approach or alternative?
Appreciate your responses :)
PS: Client-side: Flex, Server-side: Python, over internet
Thanks
What is the most effective and compatible automatic Python obfuscator? What are your experiences with using each?
And before anyone asks why I am obfuscating -- I am doing it simply because I can. Thanks.
This whole topic is way out of my depth, so forgive my imprecise question, but I have two computers both connected to one LAN.
What I want is to be able to communicate one string between the two, by running a python script on the first (the host) where the string will originate, and a second on the client computer to retrieve the string.
What is the most efficient way for an inexperienced programmer like me to achieve this?
I have issue where i want to create Dynamic function which will do some calculation based to values retrieved from database, i am clear with my internal calculation but question in how to create dynamic class:
My Structure is something like this :
class xyz:
def Project():
start = 2011-01-03
def Phase1():
effort = '2d'
def Phase2():
effort = '3d'
def Phase3():
effort = '4d'
Now want to generate those all PhaseX() function dynamically so can any one suggest me
how to achieve such thing using Python Code
Waiting for Positive reply
Regards
Thank You
Python is filled with little neat shortcuts.
For example:
self.data = map(lambda x: list(x), data)
and (although not so pretty)
tuple(t[0] for t in self.result if t[0] != 'mysql' and t[0] != 'information_schema')
among countless others.
In the irc channel, they said "too many to know them all".
I think we should list some here, as i love using these shortcuts to shorten & refctor my code. I'm sure this would benefit many.
Hi, I'm developing C extensions from python ad I obtain some segfaults (inevitable during the development...).
I'm searching a way to display at which line of code the segfault happens (an idea is like tracing every single line of code), how I can do that?