Re: detect current timezone set by kde

2008-03-18 Thread Gerald Klix
I suggest to change /etc/timezone by invoking sudo tzselect. HTH, Gerald Pradnyesh Sawant schrieb: Hello, can someone please tell me how can I programatically detect the timezone information that has been set through kde? basically, I have a small pyqt4 app which shows the current time.

Re: Function Overloading and Python

2008-02-25 Thread Gerald Klix
Stefan Behnel schrieb: Allen Peloquin wrote: On Feb 24, 11:44 pm, Stefan Behnel [EMAIL PROTECTED] wrote: Allen Peloquin wrote: class B { fun(A x, A y, A z)... fun(A1 x, A y, A z)... } class B1 { fun(A1 x, A y, A z)... } Such that any previous behavior is inherited, but

Re: Wanted: a python24 package for Python 2.3

2007-03-20 Thread Gerald Klix
Hi, You can't import subproces from future, only syntactic and semantic changes that will become standard feature in future python version can be activated that way. You can copy the subprocess module from python 2.4 somewhere where it will be found from python 2.3. At least subporcess is

Re: What's going on here?

2006-11-22 Thread Gerald Klix
Perhaps this piece of code might explain the behaviour: class C( object ): ... __slots__ = () ... o = C() o.a = 1 Traceback (most recent call last): File input, line 1, in ? AttributeError: 'C' object has no attribute 'a' object behaves like having an implict __slots__ attribute.

Re: does anybody earn a living programming in python?

2006-09-26 Thread Gerald Klix
AOL^H^H^H, me too. And it's paid better than C++ programming. HTH, Gerald Gabriel Genellina schrieb: At Monday 25/9/2006 20:09, walterbyrd wrote: I do. If so, I doubt there are many. That's why they get well paid :) (uhm, not really... :( ) Gabriel Genellina Softlab SRL

AW: Python Embedding Questions

2006-08-01 Thread Gerald Klix
Hi Sean, perhaps it may help if you try Python 2.4.3 instead of 2.4.2. The release notes (http://www.python.org/download/releases/2.4.3/NEWS.txt) mention a lot of fixed bugs, including a segfault, that is similar to yours. Also all defects, that the folks at coverty

AW: Calling foreign functions from Python? ctypes?

2006-01-10 Thread Gerald Klix
I read the whol email thread carefully and could not find any sentence by Guido, which states that he does not accept ctypes for the standard library. He just declined to rewrite winreg. Did I miss something? Cya, Gerald -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL

Re: efficient 'tail' implementation

2005-12-08 Thread Gerald Klix
As long as memory mapped files are available, the fastest method is to map the whole file into memory and use the mappings rfind method to search for an end of line. The following code snippets may be usefull: reportFile = open( filename ) length = os.fstat( reportFile.fileno()

Re: Xah's Edu Corner: Examples of Quality Technical Writing

2005-12-07 Thread Gerald Klix
That's the most accurate description of Xah's behaviour I've read so far. Jon Perez schrieb: Sherm Pendley wrote: Xah's a pretty well-known troll in these parts. I suppose he thinks someone is going to take the bait and rush to defend the other languages or some such nonsense. Actually,

Re: Is there no compression support for large sized strings in Python?

2005-12-01 Thread Gerald Klix
Did you consider the mmap library? Perhaps it is possible to avoid to hold these big stings in memory. BTW: AFAIK it is not possible in 32bit windows for an ordinary programm to allocate more than 2 GB. That restriction comes from the jurrasic MIPS-Processors, that reserved the upper 2 GB for

Re: Listen in promiscuous mode (Sniffer) on UDP port 162 and copy packetsto another port

2005-10-26 Thread Gerald Klix
Hi Henko, the proper solution to this problem ist to use on libpcap's python bindings, like for example Billy The Kid. Here are some pointers: http://home.student.utwente.nl/g.v.berg/btk/ http://pycap.sourceforge.net/ http://monkey.org/~dugsong/pypcap/ http://www.tcpdump.org/ (libpcap) HTH

Re: Abstract Methods Abstract Class

2005-10-20 Thread Gerald Klix
Isn't class AbstractBase: def method(self): raise NotImplementedError( abstract method called ) the right thing to do? Gerald - Original Message - From: Andreas Kostyrka [EMAIL PROTECTED] To: Iyer, Prasad C [EMAIL PROTECTED] Cc: python-list@python.org Sent: Thursday,

Re: Python GUIs

2005-09-21 Thread Gerald Klix
if you write B = '\x12','\x32' you get an immutable tuple. To get a mutable list use: B = [ '\x12','\x32' ] HTH, Gerald Tuvas schrieb: As a bit more of an update, I have decided to create a list of strings, but am having a problem. To illistrate this in a simple manner. B='\x12','\x32'

Re: Do a Python beginners e-mail list exist?

2005-07-07 Thread Gerald Klix
Perhaps irc://irc.freenode.net##python Note the double # This channel is less crowed as the #python channels are. Alessandro Brollo schrieb: Far from a professional programmer, I'm simply a newbie Python user. Two basic questions: 1. I don't want to post banal questions about Python to

Re: strxfrm works with unicode string ?

2005-06-17 Thread Gerald Klix
How about: import locale s=u'\u00e9' print s locale.setlocale(locale.LC_ALL, '') locale.strxfrm( s.encode( latin-1 ) ) --- HTH, Gerald [EMAIL PROTECTED] schrieb: I am trying to use strxfm with unicode strings, but it does not work. This is what I did: import locale s=u'\u00e9' print s

Re: strxfrm works with unicode string ?

2005-06-17 Thread Gerald Klix
Sali Nicolas :)), please see below for my answers. [EMAIL PROTECTED] schrieb: Gruzi, Gerald ;-) Well, ok, but I don't understand why I should first convert a pure unicode string into a byte string. The encoding ( here, latin-1) seems an arbitrary choice. Well latin-1 is only encoding, about

Re: [OT ?] (Pythonic) detection word protected files

2005-06-13 Thread Gerald Klix
Perhaps you can use OpenOffice and it's python UNO Bindings? I only know about their existence, but perhaps this will be a starting point: http://udk.openoffice.org/ HTH, Gerald Gilles Lenfant schrieb: Hi, This is certainly off topic, but as my problem must have a pythonic answer. I'm

Re: Knowing the signature of a function

2005-06-08 Thread Gerald Klix
Use the inspect module like: def tf( a, b, c, *arguments, **keywordArguments ): ... print tf ... import inspect inspect.getargspec( tf ) (['a', 'b', 'c'], 'arguments', 'keywordArguments', None) Xavier Décoret schrieb: Hello, I have the following code: def foo(x,y): pass

Re: open file in dir independently of operating system

2005-05-25 Thread Gerald Klix
Hi, it`s import os f = open( os.path.join( dir , 'configuration.smo' ), 'r' ) HTH, Gerald Joerg Schuster schrieb: Hello, I want to open the file 'configuration.smo' that is in directory dir. Yet, I don't know on which os my program is being run. On Unix I would say: f = open(dir +

Re: regex over files

2005-04-25 Thread Gerald Klix
Map the file into RAM by using the mmap module. The file's contents than is availabel as a seachable string. HTH, Gerald Robin Becker schrieb: Is there any way to get regexes to work on non-string/unicode objects. I would like to split large files by regex and it seems relatively hard to do so

Re: pythonic use of properties?

2005-04-15 Thread Gerald Klix
The python rationale is We are all consenting adults.. You shoukd change tens to _tens and ones to _ones, in order to syntacticly mark these attributes as internal. If someone not consenting, wants to mess with your internal representation, it's his fault. HTH, Gerald Marcus Goldfish schrieb: I'd

Re: eval function not working how i want it dag namn

2005-04-15 Thread Gerald Klix
How about using the vars builtin? Michael Hoffman schrieb: robcarlton wrote: I've written this function to make a list of all of an objects attributes and methods (not for any reason, I'm just learning) def list_members(obj) l = dir(obj) return map(lambda x : eval('obj.'+x), l) That works

Re: Programming Language for Systems Administrator

2005-04-12 Thread Gerald Klix
Kanthi Kiran Narisetti schrieb: Hi All, Thank You for your suggestionsI request you all to eloborate the Uses(In Practical) for systems administrator.Some of my questions regarding the same follows. 1)Can i build web applications in Python ? If so how. I am planning to build a web application

Re: variables exist

2005-04-11 Thread Gerald Klix
try: myVariable except NameError: print Not bound else: print Bound If you want to distinguish between the local an the global environment: if globals().has_key( myVariable ): ... versus if locals().has_key( . HTH, Gerald fabian schrieb: how testing if a variable exists in python as isset

Re: Python backend binding to PAM, NSS or pppd

2005-04-07 Thread Gerald Klix
Hi Heiko, Hi all, I have a PAM-library available that embedds Python. Just tell me if you need it and I will publish it. HTH, Gerald Heiko Wundram schrieb: Hey all! Before I start hacking away, I'm looking for a Python backend binding for libpam or libnss, or a python binding for the pppd plugin

Re: Python backend binding to PAM, NSS or pppd

2005-04-07 Thread Gerald Klix
Well, I am actually playing, right now. For http://www.carelix.org I implemented a module that * adds a user to passwd and * authenticates that user given a certificate and some other info on removable media * it creates an encrypted loopback file, that is mounted as the user's home

Re: Making a DLL with python?

2005-03-31 Thread Gerald Klix
I think you can, as long as you have a C-Compiler available. I used pyrex to embedd python into a Linux PAM-Module and i used C-Types to embbed Python into a Windows DLL. With hindsight, the pyrex solution was much fatser to develop and less complicated. Pyrex provides an example. Ctypes: