finditer

2014-07-07 Thread gintare
If smbd has time, maybe you could advice how to accomplish this task in faster way. I have a text = """ word{vb} wordtransl {vb} sent1. sent1trans. sent2 sent2trans... """ I need to match once wordtransl, and than many times repeating patterns consisting of sent and senttrans. The way i

Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout,

2014-07-06 Thread gintare
The answer is on page:https://docs.python.org/3.3/howto/unicode.html#reading-and-writing-unicode-data The correct code: f=open('C:\Python33\Scripts\lang\langu\svtxt.txt','r', encoding='utf-8') linef=f.readlines() print(repr(linef)) -- https://mail.python.org/mailman/listinfo/python-list

python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout,

2014-07-06 Thread gintare
I run python33 scrupt SVtxt.py from Windows command line I want to print out the file contents to stdout. File contents: "Vi kan inte längre underordna den vinster..." Python script sentences i have tries to use: f=open('C:\Python33\Scripts\lang\langu\svtxt.txt','r') linef=f.readlines() f.close(

Re: string u'hyv\xe4' to file as 'hyvä'

2010-12-26 Thread gintare
n previous letter about 'latin-1'. I was making all possible combinations, when normal example syntax did not work, before writting to this forum.) regards, gintare On 27 Gruo, 00:43, gintare wrote: > Could you please help me with special characters saving to file. > > I need to wr

string u'hyv\xe4' to file as 'hyvä'

2010-12-26 Thread gintare
F.writelines(item.encode('Latin-1')) F.writelines(item.encode('utf8')) F.writelines(item) F.close() All three writelines gives the same result in finnish.txt: hyv\xe4 i would like to find 'hyvä'. regards, gintare -- http://mail.python.org/mailman/listinfo/python-list

execute sqlite3 dot commands in python

2010-02-05 Thread gintare statkute
;> import sqlite3 >>> sqlite3 .help Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'help' >>> the same with other commands: .databases .tables http://www.sqlite.org/sqlite.html regards, gintare -- http://mail.python.org/mailman/listinfo/python-list

OpenGL win32 Python

2009-04-17 Thread gintare statkute
/include/pyhton2.4 python from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GL import * import win32api import sizeof pfd=Gdi.PIXELFORMATDESCRIPTOR() ZeroMemory( pfd, ctypes.sizeof( pfd ) ) regards, Gintare Statkute p.s. whole code which i want to use in Python: http://www.nulltermin