Re: Numpy on 2.7

2010-09-20 Thread Pekka Niiranen
On 9/20/10 2:36 PM, Dirk Nachbar wrote: I am trying to install Numpy on Python 2.7 but it only looks for 2.6 folder, how can I change that? Dirk http://sourceforge.net/projects/numpy/files/NumPy/1.5.0/numpy-1.5.0-win32-superpack-python2.7.exe/download --

Daylight saving time question

2007-03-20 Thread Mr Pekka Niiranen
Hi, is it possible to get the two annual daylight saving times (day, month and time) from Python by giving location in some country/location string (Europe/Finland for example). I need to ask country in program and calculate daylight saving times for the next few years onwards somehow like this:

Re: serial ports, threads and windows

2006-08-03 Thread Pekka Niiranen
Tom Brown wrote: Hey people, I've written a python app that r/w eight serial ports to control eight devices using eight threads. This all works very nicely in Linux. I even put a GUI on it using PyQt4. Still works nicely. Then I put the app on on a virtual Windows machine running

Re: Python 2.5 Schedule

2006-03-19 Thread Pekka Niiranen
Hi, what I would like to see in (www.python.org) is Windows installation package (*.msi) compiled with option --enable-unicode=ucs4. See http://www.xml.com/pub/a/2005/06/15/py-xml.html -pekka- -- http://mail.python.org/mailman/listinfo/python-list

Re: SOLVED: Help needed: file writing problem with subprocess

2005-12-05 Thread pekka niiranen
Fredrik Lundh wrote: Pekka Niiranen wrote: I am running Python script in W2K or in WinXP. The script is started from DOS prompt and writes text file to disk with codecs.open() in UTF8. The problem is: When script writes the file and tries to read it with by calling itself thru subprocess

Help needed: file writing problem with subprocess

2005-12-04 Thread Pekka Niiranen
Hi, I am running Python script in W2K or in WinXP. The script is started from DOS prompt and writes text file to disk with codecs.open() in UTF8. The problem is: When script writes the file and tries to read it with by calling itself thru subprocess() the created files are NOT accessible because

Question about namespaces and import. How to avoid calling os.system

2005-07-22 Thread Pekka Niiranen
Hi there, I have two scripts. The first main.py sets some variables and then imports another called gen.py. The idea is to provide main.py that defines some paths, variables etc. without using Windows environment variables. Various other hackers will make additional Python scripts (subroutines)

Re: Question about namespaces and import. How to avoid calling os.system

2005-07-22 Thread Pekka Niiranen
Thanks, I will analyse these 4 options and select the most suitable since there are other issues involved too, like the main.py reads contents of a file to a list that gets passed to the gen.py with dictionary env_params. I try to avoid parsing the contents of the file both in main.py and in

Re: HELP: Python equivalent of UNIX command touch

2005-03-02 Thread pekka niiranen
Roy Smith wrote: pekka niiranen [EMAIL PROTECTED] wrote: Does anybody know Python recipe for changing the date of the directory or files in W2K to current date and time? In UNIX shell command touch does it. You want os.utime() Nope, it does not work for directories in Windows -- http

HELP: Python equivalent of UNIX command touch

2005-02-28 Thread pekka niiranen
Does anybody know Python recipe for changing the date of the directory or files in W2K to current date and time? In UNIX shell command touch does it. -pekka- -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug? BOM decoded with UTF8

2005-02-11 Thread pekka niiranen
pekka niiranen wrote: I have two files my.utf8 and my.utf16 which both contain BOM and two a characters. Contents of my.utf8 in HEX: EFBBBF6161 Contents of my.utf16 in HEX: FEFF6161 This is not true: this byte string does not denote two a characters. Instead, it is a single character U

Is this a bug? BOM decoded with UTF8

2005-02-10 Thread pekka niiranen
Hi there, I have two files my.utf8 and my.utf16 which both contain BOM and two a characters. Contents of my.utf8 in HEX: EFBBBF6161 Contents of my.utf16 in HEX: FEFF6161 For some reason Python2.4 decodes the BOM for UTF8 but not for UTF16. See below: fh = codecs.open(my.uft8, rb,

Re: goto, cls, wait commands

2005-02-10 Thread Pekka Niiranen
import os if os.name == nt: os.system(cls) # Works in w2k else: os.system(clear)# Works in cygwin's Bash Ulf Göransson wrote: Bruno Desthuilliers wrote: Duncan Booth a écrit : BOOGIEMAN wrote: Secondly, how do I clear screen (cls) from text and other content ?

Re: HELP: Tkinter idiom needed: SOLUTION

2005-01-03 Thread Pekka Niiranen
window') root.protocol(WM_DELETE_WINDOW, NONE) widget = Message_box(root) m = blah4 widget.write(%s\n % m) widget.disable_write() root.mainloop() root.destroy() print blah5 - CODE ENDS Pekka Niiranen wrote: Hi there, after

HELP: Tkinter idiom needed

2005-01-01 Thread Pekka Niiranen
Hi there, after reading TkInter/thread -recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965 I wondered if it was possible to avoid using threads for the following problem: I have script started from W2K console that normally prints ascii messages to the screen. However, I have

Re: what would you like to see in a 2nd edition Nutshell? A: Unicode aware scrollable message box in Tk

2004-12-31 Thread Pekka Niiranen
Well, I have not read the previous version, but I would like to see an example how to redirect console messages from scripts to Tk windows in UTF-8/16 for debugging purposes. (I hate those ordinal not in range(128) messages) This involves setting font (Arial MS Unicode), scrollbar and Continue

Re: File locking is impossible in Windows? SOLUTION

2004-12-22 Thread Pekka Niiranen
unlocked' -SCRIPT ENDS -pekka- Pekka Niiranen wrote: Hi, I have used the following example from win32 extensions: -SCRIPT STARTS import win32file import win32con import win32security import pywintypes class Flock: def __init__(self,file): self.file=file secur_att

File locking is impossible in Windows?

2004-12-21 Thread Pekka Niiranen
Hi, I have used the following example from win32 extensions: -SCRIPT STARTS import win32file import win32con import win32security import pywintypes class Flock: def __init__(self,file): self.file=file secur_att = win32security.SECURITY_ATTRIBUTES()

Bug in py32win manual for file_locking for Python 2.4

2004-12-04 Thread Pekka Niiranen
Hi, I tried to lock file in w2k using example directly from pyWin32 manual: #-- import pywintypes ov=pywintypes.OVERLAPPED() #used to indicate starting region to lock highbits=0x file=c:wilma.txt import win32file import win32security import win32api secur_att =

Question of Optionparse

2004-11-29 Thread Pekka Niiranen
Hi, How can I STOP Optionparse to process boolean value as parameter. See this: parser = optparse.OptionParser() parser.add_option(-x,dest='xxx', action=store_true,help=xxx) parser.add_option(-r,dest='root',help=directory,type=string) args = [-r, d:, -x] parser.parse_args(args) (Values at