I've finally concluded that I can no longer afford to just hope the ongoing Py3k/WSGI disasterissues will be resolved anytime soon, so I need to get ready to move on.
Unfortunately, my available options don't seem a whole lot better:
While I find a few different Python modules for FastCGI scattered around the web, none of them seem to...
I use the math module a lot lately. I don't want to write math.sqrt(x) and math.sin(x) all the time. I would like to shorten it and write sqrt(x) and sin(x).
How?
...
I'm talking about doing something like:
for(i=n; i>=1; --i) {
//do something with i
}
I can think of some ways to do so in python (creating a list of range(1,n+1) and reverse it, using while and --i, ...) but I wondered if there's a more elegant way to do it. Is there?
EDIT:
Some suggested I use xrange() instead of range() since r...
i am a fresher just out of collge .Till now i have worked on java,Python,javascript,groovy,django and web application develop has been my only intrest.
But for a living i joined a company now and they are making me work on sap.
Coming from a world of ORM and languages like python ,SAP and database tables doen't excite me on the first lo...
Sorry, I agree that was really poorly written:
Take 2:
I have many columns of data (up to 63) in over 50 datasets. I am extracting only 3 columns of data that I need and writing it into a new .csv file. There are a few of my datasets that do not have the third desired column of data. But that's okay I can leave it blank (or insert an...
Hi, I think the maximum integer in python is available by calling sys.maxint, whereas the maximum float or long, what is it?
...
Given a regexp, I would like to generate random data x number of time to test something.
e.g.
>>> print generate_date('\d{2,3}')
13
>>> print generate_date('\d{2,3}')
422
Of course the objective is to do something a bit more complicated than that such as phone numbers and email addresses.
Does something like this exists? If it does,...
Good day, Stackoverflow!
I have a little (big) problem with porting one of my Python scripts for Linux to Windows. The hairy thing about this is that I have to start a process and redirect all of its streams into pipes that I go over and read and write to and from in my script.
With Linux this is a piece of cake:
server_startcmd = [
...
I'm trying to find a way to create fixtures for my web2py application. I came across http://thadeusb.com/weblog/2010/4/21/using_fixtures_in_web2py that suggests creating a x_fixtures.py file to place all the fixtures in. The problem is that after a while, the file gets huge and a pain to navigate through.
What I want to be able to do i...
We use Robot Framework for test automation, and our jython test code spawns a java subprocess using subprocess.Popen():
cmd = "java -jar program.jar"
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
process.wait()
Java code utilizes a JDBC connection to Oracle database, and the sa...
I am reading in a string of integers such as "3 ,2 ,6 " and want them in the list [3,2,6] as integers. This is easy to hack about, but what is the "pythonic" way of doing it?
...
I have a variable x to which I want to assign a very long string. Since the string is pretty long I split it into 10 substrings. I would like to do something like this:
x =
'a very long string - part 1'+
'a very long string - part 2'+
'a very long string - part 3'+
...
'a very long string - part 10'
But tur...
I use the latest version of numpy/scipy.
The following script does not work:
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft, fftshift, fftfreq
hn= np.ones(10)
hF = fft(hn,1024)
shifted = fftshift(hF)
It gives the following error message:
Traceback (most recent call last):
File "D:...
I am scraping a website that has a Javascript next link that looks like this <a href="javascript:__doPostBack('DataGrid1$ctl14$ctl02','')">2</a> .The page is written in aspx.
Is it possible to call that, to get the information on the next page?
Here is the page, http://www.deantechnology.com/hvca/pg_search/fsn.aspx?catalog_sspid=212&am...
Is there a way to create a recovery group in exchange 2003 with python?
Maybe CDOEXM or VBScript? But I have been unsuccessful in finding any sample code.
Any ideas?
...
Is there an equivalent to Python's popen2 in Java?
...
Hi all,
My Python (2.6) installation on a few servers has been compiled without curses support which I now need, although the servers have libncurses5 installed, Python did not compile the bindings for it so when I "import curses" I get:
"ImportError: No module named _curses"
my /lib/ dir has the following files and symlinks:
lrwxrw...
I've got a project structure as follows:
ProjFolder\project\
|__init__.py
|main.py
|...
|data\
|settings.dtd
|archs\
|arch1.arc
...
...
We have two applications that are both running on Google App Engine. App1 makes requests to app2 as an authenticated user. The authentication works by requesting an authentication token from Google ClientLogin that is exchanged for a cookie. The cookie is then used for subsequent requests (as described here). App1 runs the following code...
How do I do a try except else in Java like I would in Python?
Example:
try:
something()
except SomethingException,err:
print 'error'
else:
print 'succeeded'
I see try and catch mentioned but nothing else.
...