First  |  Prev |  Next  |  Last
Pages: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Python Portability
In message <i3fpos$p7u$1(a)news.eternal-september.org>, W. eWatson wrote: I made a one character change to it and sent him the new py file. He can't execute it. What exactly was the problem? ... 9 Aug 2010 04:40
Byte Offsets of Tokens, Ngrams and Sentences?
Hi, Does any one know how to tokenize a string in python that returns the byte offsets and tokens? Moreover, the sentence splitter that returns the sentences and byte offsets? Finally n-grams returned with byte offsets. Input: This is a string. Output: This 0 is 5 a 8 string. 10 than... 6 Aug 2010 07:09
How to read large amounts of output via popen
I need to read a large amount of data that is being returned in standard output by a shell script I am calling. (I think the script should really be writing to a file but I have no control over that) Currently I have the following code. It seeems to work, however I suspect this may not work with large amounts ... 6 Aug 2010 09:20
Import python modules from sub-directories
Hi guys, I am new to python and would like to import certain classes in sub-directories of the working directory. I was wondering how will I be able to achieve this? Regards, Nav... 6 Aug 2010 09:20
Struggling to convert a mysql datetime object to a python stringof a different format
On 8/4/2010 4:40 PM, ����� wrote: cursor.execute( ''' SELECT host, hits, date FROM visitors WHERE page = '%s' ORDER BY date DESC ''' % (page) ) Don't do string substitution ("%") on SQL statements. Let MySQLdb do it for you, with proper escaping: cursor.execute('''SELECT host, hits, date FROM vis... 6 Aug 2010 01:44
Python Portability--Not very portable?
In my on-again-off-again experience with Python for 18 months, portability seems an issue. As an example, my inexperienced Python partner 30 miles away has gotten out of step somehow. I think by installing a different version of numpy than I use. I gave him a program we both use months ago, and he had no tro... 7 Aug 2010 20:10
Finding the version # of a module, and py moduleproblem
On Thu, 05 Aug 2010 17:55:30 -0700, W. eWatson wrote: I'm pretty sure he has the same version of Python, 2.5, but perhaps not the numpy or scipy modules. I need to find out his version numbers. It's only a convention, but the usual way is to check the __version__ attribute. It works for Numpy: impor... 5 Aug 2010 21:23
Finding the version # of a module, and py module problem
It's been awhile since I've used python, and I recall there is a way to find the version number from the IDLE command line prompt. dir, help, __version.__? I made the most minimal change to a program, and it works for me, but not my partner. He gets Traceback (most recent call last): File "C:\Documents... 7 Aug 2010 12:33
defining, raising and catching exceptions
I have a block of test code, where I am trying to raise and catch my own user defined exception class NetActiveError(RuntimeError): def __init__(self,error): self.args = error def a(): try: fh = open("me.txt", "r") except Exception as (errno, errText): print errText ... 5 Aug 2010 22:28
Struggling to convert a mysql datetime object to a python stringof a different format
On 08/05/10 13:52, Νίκος wrote: dataset = cursor.fetchall() for row in dataset: print ( '''<tr> ''' ) date = row[2].strftime( '%d %b, %H:%M' ) print ( '''<td> %s</td> <td> %s</td> <td> %s</td> ''' % ( row[0], row[1], date ) ) Unfortunately had to ditch the 'for entry... 7 Aug 2010 13:38
First  |  Prev |  Next  |  Last
Pages: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24