I'd like to use Python for develop an app in Android using ASE. My problem is I'm thinking about adding a UI to it but don't know how.
Where can I find some documentation or help?
In C# I could easily write the following:
string stringValue = string.IsNullOrEmpty( otherString ) ? defaultString : otherString;
Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement?
I am running a website on CentOS 5.3. I understand centos will break if the default python 2.4 is upgraded. I followed this site (http://www.question-defense.com/2009/12/25/how-to-install-python-2-6-on-centos-5-without-breaking-yum) and got python 2.6 installed.
Now if I run "python" it runs python2.4 and if I run "python26" it runs python2.6.
I am trying to compile mod_wsgi-3.2. When it run ./configure it takes only python 2.4 environment. I have tried using the --with-python=/usr/bin/python26. That way, "make" command does not work.
Can someone throw some light on this?
Thanks in advance
Hello,
I'm using windows 7 english and I want to know how to see the microsoft speech language and to see if the speech recognition is active.
How can I do it using python?
Hello, newbie here.
i have a local Postgre database which will be filled with data (daily) on my local development machine. What is a good solution to transfer/sync/mirror this data to a production postgre database.
For what it's worth I'm developing in Python using Dajngo.
Thanks!
I remember when I was developing in C++ or Java, the compiler usually complains for unused methods, functions or imports. In my Django project, I have a bunch of Python files which have gone through a number of iterations. Some of those files have a few lines of import statement at the top of the page and some of those imports are not used anymore. Is there a way to locate those unused imports besides eyeballing each one of them in each file?
All my imports are explicit, I don't usually write from blah import *
I need to convert a compiled python code (.pyo) to its source . I look in depython.net, but there is a problem. A warning;
"File version older than 2.4."
What should I do?
Thanks.
I would like to use Python's tempfile module to create a temporary file that I will use for communication between processes (use of pipes is awkward).
The documentation I've linked to above shows two functions that almost do what I want:
tempfile.NamedTemporaryFile # For creating named tempfiles
tempfile.SpooledTemporaryFile # For creating tempfiles in memory
but actually I want a tempfile that is both named AND in memory. Any ideas?
I want to assign a xml code into a string variable.
I can do this without escaping single or double-quotes by using triple-quote in python.
Is there a similar way to do this in F# or C#?
My Python program does a series of things and prints some diagnostic output. I would also like to have a progress counter like this:
Percentage done: 25%
where the number increases "in place". If I use only string statements I can write separate numbers, but that would clutter the screen. Is there some way to achieve this, for example using some escape char for backspace in order to clear a number and write the next one?
Thanks
Do you know any easy way to find a logging call that throws "not enough argumenst for format string".
On my workstation I've modified logging/__init__.py to print the msg so I can easily find the line in the source.
But do you have any idea what to do on the testing environment where you can't change python standard library nor run pdb easily?
I've got thousands of urls from many hosts I need to screenshot.
I can use the lib fine from the command line, but how can I integrate it into my code so I can take multiple screenshots simultaneously?
I think it's something to do with xvfb as with the answer to this question: http://stackoverflow.com/questions/1747022/how-to-kill-headless-x-server-started-via-python but I'm not sure what exactly.
Hi,
i would like to replace the lines
function *{
by
function *{echo "The function starts here."
where * is what ever.
Any idea how to do that in Python?
Regards
Javi
A project that involves image processing, i.e. to calculate the angular shift of the same image when shifted by a medium of certain Refractive Index. We have to build an app that correlates the 2 images (phase/2D correlation?) and then plot using Chaco and Mayavi (2 libraries in Python).
Is there any other existing template software (FOSS) that we can base our app on, or use it as a reference?
Consider a Python list my_list containing ['foo', 'foo', 'bar'].
What is the most Pythonic way to uniqify:ing and sorting and the list (think cat my_list | sort | uniq)?
This is how I currently do it and while it works I'm sure there are better ways to do it.
my_list = []
...
my_list.append("foo")
my_list.append("foo")
my_list.append("bar")
...
my_list = set(my_list)
my_list = list(my_list)
my_list.sort()
Suppose i want to store 3 lines in a file both in python and C++ .
I want to store it like this
aaa
bbb
ccc ..
But i am giving ccc input first then bbb then aaa. How will I traverse the file from bottom to top and also store from bottom to top/?
Python beginner here, I have a list of lists and want to refer to a specific part of that list.
For example
lol = [[1, 2, 4], [6, 7, 8], [9, 10, 14]]
If I just want to print the first item in one of the lists, eg the 1, 6 or 9, how would I do that?
I can only find ways to refer to each of the lists seperately eg lol[0] but not to then refer to an item within that list.
Thank you in advance for your help!
Cheers
Can someone make me an example or explain to me how can I paste something to the active window with Python?
I've edited because I didn't know that paste to the clipboard doesnt paste to the active window...
Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Criteria (Importance out of 10, 10 being most important)
Richness of API/libraries available (eg. maths, plotting, networking) (9)
Ability to embed in desktop (java/c++) applications (8)
Ease of deployment (8)
Ability to interface with DLLs/Shared Libraries (7)
Ability to generate GUIs (7)
Community/User support (6)
Portability (6)
Database manipulation (3)
Language/Semantics (2)
Is there any api/lib for python that will get me the synonyms of a word?
For example if i have the word "house" it will return "building, domicile, mansion, etc..."
Looking to store usernames and passwords in a database, and am wondering what the safest way to do so is. I know I have to use a salt somewhere, but am not sure how to generate it securely or how to apply it to crypt the password. Some sample Python code would be greatly appreciated. Thanks.