Re: Python program as daemon?

2008-07-25 Thread Sebastian "lunar" Wiesner
Johny <[EMAIL PROTECTED]>: > Is it possible to run a Python program as daemon? You can write daemons in basically any language out there. -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: Attack a sacred Python Cow

2008-07-24 Thread Sebastian &quot;lunar&quot; Wiesner
Torsten Bronger <[EMAIL PROTECTED]>: > Hallöchen! > > Bruno Desthuilliers writes: > >> Torsten Bronger a écrit : >> >>> Bruno Desthuilliers writes: >>> [...] How would you handle this case with an implicit 'self' : class Foo(object): pass def bar(self):

Re: Attack a sacred Python Cow

2008-07-24 Thread Sebastian &quot;lunar&quot; Wiesner
Jordan <[EMAIL PROTECTED]>: >> Fortunately, Python isn't designed according to your ideas, and won't >> change, so consider your posting a waste of time.  If feeling like >> bringing such old "issues" up again next time, spend your time learning >> another programming language, as you would obviou

Re: Attack a sacred Python Cow

2008-07-24 Thread Sebastian &quot;lunar&quot; Wiesner
Jordan <[EMAIL PROTECTED]>: > # Blog code, not tested > class A(): > def __eq__(self, obj): > return True > a = A() > b = [] > assert a == b > assert not (a != b) > > The second assertion fails. Why? Because coding __eq__, the most > obvious way to make a class have equality based comparis

Re: lxml, comparing nodes

2008-07-23 Thread Sebastian &quot;lunar&quot; Wiesner
code_berzerker <[EMAIL PROTECTED]>: > I'd like to know if there is any built in mechanism in lxml that lets > you check equality of two nodes from separate documents. I'd like it > to ignore attribute order and so on. It would be even better if there > was built in method for checking equality of

Re: Proper way to query user and group database on a Unix host?

2008-07-23 Thread Sebastian &quot;lunar&quot; Wiesner
Guilherme Polo <[EMAIL PROTECTED]>: > On Wed, Jul 23, 2008 at 9:16 AM, Sebastian lunar Wiesner > <[EMAIL PROTECTED]> wrote: >> Chris Brannon <[EMAIL PROTECTED]>: >> >> Iirc since Python 2.5 these tuples are named ... >> >>> In

Re: Proper way to query user and group database on a Unix host?

2008-07-23 Thread Sebastian &quot;lunar&quot; Wiesner
Chris Brannon <[EMAIL PROTECTED]>: Iirc since Python 2.5 these tuples are named ... > Instead, do this: > > import grp > groupname = 'users' > groupusers = grp.getgrnam(groupname)[3] ... thus this line could be written as: groupusers = grp.getgrnam(groupname).gr_mem Slightly more readable, imh

Re: Problem with Python Server Pages (PSP)

2008-07-22 Thread Sebastian &quot;lunar&quot; Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hi, > > I am facing a very basic problem with PSP. I have installed mod_python > (in fedora Core 1), added the lines required for loading Python > modules and handling PSP pages. I have created a hello.psp page. But > when I try to view this hello.psp page

Re: Unexpected default arguments behaviour (Maybe bug?)

2008-07-18 Thread Sebastian &quot;lunar&quot; Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > On 13 Lug, 19:42, [EMAIL PROTECTED] wrote: >> I expect it's because default values for parameters are evaluated and >> bound at definition time. So once "def m (self, param = a):" line >> executes, the default value for parameter is forever bound to be 1. >

Re: Is there any component-oriented (non-MVC) web framework available for Python?

2008-07-16 Thread Sebastian &quot;lunar&quot; Wiesner
Alis <[EMAIL PROTECTED]>: > Is there any component-oriented (non-MVC) web framework available for > Python? > > That is something like Apache Wicket, Tapestry or JSF, but I need it > to be in Python. Zope [1] might be worth trying. [1] http://www.zope.org -- Freedom is always the freedom of d

Re: Is it legal to rebuild Python.exe to include Version property tab?

2008-07-15 Thread Sebastian &quot;lunar&quot; Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > My company distributes a COM object that can be license and userd by > our customers. Some of my company's internal application also use the > COM object. However, for internal applications, instead of licensing > the COM object, we just make the applicatio

Re: fork after creating temporary file using NamedTemporaryFile

2008-07-15 Thread Sebastian &quot;lunar&quot; Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > When I create temporary file using the tempfile module, and forkI) > later on in my program, I always see errors when the program exits. Is > this because the child process deletes temp file? > Here's a stripped down version of my script that exhibits this

Re: About the slot declaration decorator in PyQt4

2008-07-14 Thread Sebastian &quot;lunar&quot; Wiesner
Bighead <[EMAIL PROTECTED]>: > I remember when I did UI Design in PyQt4 for the first time, I found a > manual. In it, no "connect" was used. Instead, an OO approach is > applied, new UI classes inherit from old ones, and all the slot > functions are automatically connected to some signals, using

Re: subprocess module

2008-07-14 Thread Sebastian &quot;lunar&quot; Wiesner
Peter Otten <[EMAIL PROTECTED]>: > - communicate() waits for the subprocess to terminate. > - stdout.read() is retried if an EINTR occurs (Not sure when this would > happen). EINTR happens, if the "read" syscall is interrupted by a signal handler. For instance, if a daemon handles SIGUSR to re-r

Re: Converting from local -> UTC

2008-07-12 Thread Sebastian &quot;lunar&quot; Wiesner
Gabriel Genellina <[EMAIL PROTECTED]>: > En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt > <[EMAIL PROTECTED]> escribi�: > >> I am having a little trouble figuring out how to convert a python >> datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would >> like to create a UTC date

Re: plugins using cvs/distutils?

2008-07-10 Thread Sebastian &quot;lunar&quot; Wiesner
Deacon <[EMAIL PROTECTED]>: > Hi. I have an open-source application development environment that I > would like to enable an automated package download system for (like > downloadable plugins), using sourceforge as its repository. My > software will have a menu-based popup window, that will list t

Re: Emacs/Python Essentials?

2008-07-10 Thread Sebastian &quot;lunar&quot; Wiesner
xkenneth <[EMAIL PROTECTED]>: > What does everyone consider essential for emacs python dev? yasnippet is worth being looked at -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: re.search much slower then grep on some regular expressions

2008-07-10 Thread Sebastian &quot;lunar&quot; Wiesner
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]>: > On Mon, 07 Jul 2008 16:44:22 +0200, Sebastian \"lunar\" Wiesner wrote: > >> Mark Wooding <[EMAIL PROTECTED]>: >> >>> Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote:

Re: GUI Programming by hand not code with Python Code

2008-07-07 Thread Sebastian &quot;lunar&quot; Wiesner
Jason Scheirer <[EMAIL PROTECTED]>: > On Jul 6, 7:33 pm, [EMAIL PROTECTED] wrote: >> Is their a program that lets you design a GUI by hand (like gambas) >> not by code (like wxpython) but the commands are in python? >> >> A program similar to gambas or vb >> >> Gambas with python code instead of g

Re: re.search much slower then grep on some regular expressions

2008-07-07 Thread Sebastian &quot;lunar&quot; Wiesner
Mark Wooding <[EMAIL PROTECTED]>: > Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote: > >> # perl -e '("a" x 10) =~ /^(ab?)*$/;' >> zsh: segmentation fault perl -e '("a" x 10) =~ /^(ab?)*$/;' > > (

Re: Problem with subprocess.Popen wget within a thread

2008-07-06 Thread Sebastian &quot;lunar&quot; Wiesner
Mathieu Prevot <[EMAIL PROTECTED]>: > it seems the script (A) finishes before the downloading ends, and the > (B) version doesn't (wanted behavior) ... this is unexpected. What > happens ? "readlines" blocks, until the pipe is closed, which usually happens, if the process dies. On the other ha

Re: re.search much slower then grep on some regular expressions

2008-07-06 Thread Sebastian &quot;lunar&quot; Wiesner
Mark Wooding <[EMAIL PROTECTED]>: > Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote: > >> I just wanted to illustrate, that the speed of the given search is >> somehow related to the complexity of the engine. >> >> Btw, other pcre i

Re: Hands-on HTML Table Parser/Matrix?

2008-07-06 Thread Sebastian &quot;lunar&quot; Wiesner
robert <[EMAIL PROTECTED]>: > Often I want to extract some web table contents. Formats are > mostly static, simple text & numbers in it, other tags to be > stripped off. So a simple & fast approach would be ok. > > What of the different modules around is most easy to use, stable, > up-to-date, it

Re: re.search much slower then grep on some regular expressions

2008-07-05 Thread Sebastian &quot;lunar&quot; Wiesner
Terry Reedy <[EMAIL PROTECTED]>: > Mark Dickinson wrote: >> On Jul 5, 1:54 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >> Part of the problem is a lack of agreement on what >> 'regular expression' means. > > Twenty years ago, there was. Calling a extended re-derived grammar > expression like Pe

Re: re.search much slower then grep on some regular expressions

2008-07-05 Thread Sebastian &quot;lunar&quot; Wiesner
Carl Banks <[EMAIL PROTECTED]>: > On Jul 5, 4:12 am, "Sebastian \"lunar\" Wiesner" > <[EMAIL PROTECTED]> wrote: >> Paddy <[EMAIL PROTECTED]>: >> >> >> >> > On Jul 4, 1:36 pm, Peter Otten <[EMAIL PROTECTED]&g

Re: re.search much slower then grep on some regular expressions

2008-07-05 Thread Sebastian &quot;lunar&quot; Wiesner
Paddy <[EMAIL PROTECTED]>: > On Jul 4, 1:36 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> Henning_Thornblad wrote: >> > What can be the cause of the large difference between re.search and >> > grep? >> >> grep uses a smarter algorithm ;) >> >> >> >> > This script takes about 5 min to run on my com

Re: Scripting SAP GUI (Windows)

2008-07-02 Thread Sebastian &quot;lunar&quot; Wiesner
Thomas Guettler <[EMAIL PROTECTED]>: > Hi, > > I need to script SAP GUI running on MS-Windows: Doesn't that thing have a COM interface? -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input into Tkinter ?

2008-07-01 Thread Sebastian &quot;lunar&quot; Wiesner
Matimus <[EMAIL PROTECTED]>: > On Jun 30, 9:55 am, [EMAIL PROTECTED] wrote: >> Is there any way to type into a Tkinter frame window? >> I want to use raw_input() within a Tkinter frame. > > `raw_input(prompt)` just calls `sys.stdout.write(prompt)` and returns > `sys.stdin.readline()`. It does mor

Re: raw_input into Tkinter ?

2008-06-30 Thread Sebastian &quot;lunar&quot; Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Is there any way to type into a Tkinter frame window? Maybe using a proper text/line edit widget? > I want to use raw_input() within a Tkinter frame. The builtin raw_input is for console input only. Of course, one could implement a raw_input using a Tki

Re: HTML Parsing

2008-06-29 Thread Sebastian &quot;lunar&quot; Wiesner
Stefan Behnel <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] wrote: >> I am trying to build my own web crawler for an experiement and I don't >> know how to access HTTP protocol with python. >> >> Also, Are there any Opensource Parsing engine for HTML documents >> available in Python too? That would be

Re: C++ or Python

2008-06-29 Thread Sebastian &quot;lunar&quot; Wiesner
Dan Stromberg <[EMAIL PROTECTED]>: > things like passing a method as a function parameter is a no-brainer > (requires extra syntax in java because of the cautious type system - not > sure about C++). C++ has function pointers and functors, therefore this is not really an issue with C++. -- Fre

Re: How do web templates separate content and logic?

2008-06-27 Thread Sebastian &quot;lunar&quot; Wiesner
John Salerno <[EMAIL PROTECTED]>: > But when you have a templating system that mixes HTML and Python code, how > is this helping to keep things separate? You don't. Normally you embed only the code, that is absolutely necessary, e.g. for iterating over a list. Consider an online shop, that nee

Re: Threads, GIL and re.match() performance

2008-06-27 Thread Sebastian &quot;lunar&quot; Wiesner
Jeff <[EMAIL PROTECTED]>: > (and possibly intermediate results) These could be stored purely in C space, without refcounting needed. -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: Going from Tkinter to pyQT

2008-06-23 Thread Sebastian &quot;lunar&quot; Wiesner
Alex Bryan <[EMAIL PROTECTED]>: > I had a guy on this mailing list tell me that pyQT is much better than > Tkinter, and after looking into it a bit I think he is right. However, > I can't find much on it. I want to know if there are any good books or > online tutorials that would be helpful. I dou

Re: Fast and easy GUI prototyping with Python

2008-06-23 Thread Sebastian &quot;lunar&quot; Wiesner
Michael Torrie <[EMAIL PROTECTED]>: > Pete Kirkham wrote: >> 2008/6/21 Val-Amart <[EMAIL PROTECTED]>: >> >>> Use PyQt. You will gain great portability +all the functionality built >>> in qt. >>> You can try PyGTK also, though i wont recommend it. >>> >> Why would you not recommend it? I've been u

Re: Fast and easy GUI prototyping with Python

2008-06-22 Thread Sebastian &quot;lunar&quot; Wiesner
Michael Torrie <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] wrote: >> 2) The Qt vs. .NET API. I have no experience with Qt's API and a >> rudimentary experience with the .NET API (seems powerfull but also big >> and complex). > > Qt's API is very very good. Easy to use and extremely powerful. Note

Re: Fast and easy GUI prototyping with Python

2008-06-21 Thread Sebastian &quot;lunar&quot; Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Which tools would you use? I want the interface design to be as easy > and fast as possible, all ideology aside. I'm considering either > IronPython+Visual Studio or Python+Qt -- but I'm open for other > suggestions. I'm using the latter, and am perfectly

Re: pyinotify issue

2008-06-20 Thread Sebastian &quot;lunar&quot; Wiesner
AndreH <[EMAIL PROTECTED]>: > On Jun 17, 12:11 pm, AndreH <[EMAIL PROTECTED]> wrote: >> On Jun 13, 3:39 pm, AndreH <[EMAIL PROTECTED]> wrote: >> >> >> >> > Good day, >> >> > I just installed pyinotify on my gentoo box. >> >> > When I test the library through "pyinotify.pv -v /tmp" under root, >> >

Re: Context manager for files vs garbage collection

2008-06-17 Thread Sebastian &quot;lunar&quot; Wiesner
Floris Bruynooghe <[EMAIL PROTECTED]>: > I was wondering when it was worthwil to use context managers for > file. Consider this example: > > def foo(): > t = False > for line in file('/tmp/foo'): > if line.startswith('bar'): > t = True > break > return

Re: bpython - fancy Python shell

2008-06-16 Thread Sebastian &quot;lunar&quot; Wiesner
Wolfgang Grafen <[EMAIL PROTECTED]>: > I couldn't get it work on Solaris (modified some lines for Python2.3). If solaris doesn't have a readline library, you might try to compile gnu readline, and recompile python (also a chance to get the current version 2.5) > One reason was that I had to down

Re: Making wxPython a standard module?

2008-06-15 Thread Sebastian &quot;lunar&quot; Wiesner
"Martin v. Löwis" <[EMAIL PROTECTED]>: >> Just out of curiosity, what are the chances of this happening (sort of >> like what happened with sqlite)? > > As a starting point, the author(s) of wxPython would need to contribute > it to Python (and then also give the PSF the permission to relicense >

Re: Dynamic HTML from Python Script

2008-06-11 Thread Sebastian &quot;lunar&quot; Wiesner
Lie <[EMAIL PROTECTED]> at Mittwoch 11 Juni 2008 16:04: > FYI: AJAX is just a very fancy name for Javascript AJAX is not just a "name", it's a _religion_ SCNR -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailm

Re: Separators inside a var name

2008-06-10 Thread Sebastian &quot;lunar&quot; Wiesner
Rainy <[EMAIL PROTECTED]> at Dienstag 10 Juni 2008 02:53: > Well, I agree, this is terrible. If I were Guido I'd > make a very explicit rule that a certain naming > scheme is preferred and other schemes are very bad. FWIW, there is a preferred naming scheme outlined in PEP 8. -- Freedom is alw

Re: Separators inside a var name

2008-06-10 Thread Sebastian &quot;lunar&quot; Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]> at Montag 09 Juni 2008 23:39: > On 9 juin, 20:05, "Sebastian \"lunar\" Wiesner" > <[EMAIL PROTECTED]> wrote: >> Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: >> > (snip) >> >

Re: Python, subprocess, dump, gzip and Cron

2008-06-10 Thread Sebastian &quot;lunar&quot; Wiesner
Aidan <[EMAIL PROTECTED]> at Dienstag 10 Juni 2008 07:21: > TT wrote: >> On Jun 10, 2:37 pm, Aidan <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I'm having a bit of trouble with a python script I wrote, though I'm not >>> sure if it's related directly to python, or one of the other software >>> pack

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Sebastian &quot;lunar&quot; Wiesner
subeen <[EMAIL PROTECTED]> at Montag 09 Juni 2008 20:21: > On Jun 10, 12:15 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> subeen wrote: >> > can use urllib2 module and/or beautiful soup for developing crawler >> >> Not if you care about a) speed and/or b) memory efficiency. >> >> http://blog.ia

Re: Separators inside a var name

2008-06-09 Thread Sebastian &quot;lunar&quot; Wiesner
Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > I have a stylistic question. In most languages words in var. name are > separated by underscores or cap letters, resulting in var names like > var_name, VarName and varName. I don't like that very much because all > 3 ways of naming look b

Re: How to get full path to script?

2008-06-09 Thread Sebastian &quot;lunar&quot; Wiesner
Mike Driscoll <[EMAIL PROTECTED]> at Montag 09 Juni 2008 18:20: > On Mon, Jun 9, 2008 at 11:07 AM, kj <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]> "Mike Driscoll" >> <[EMAIL PROTECTED]> writes: >> >>>For my compiled scripts, I usually use this variation: >> >>>path = os.path.abspath(os.pa

Re: parse dates

2008-05-31 Thread Sebastian &#x27;lunar7; Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ brechmos <[EMAIL PROTECTED]> ] > Hi, > > I have been using PHP the last while and in particular strtotime. > What I want to replicate is finding the second or fourth Monday of the > next month. In PHP with strtotime it is easy (strtotime("second >

Re: File browser in python gui

2008-05-31 Thread Sebastian &#x27;lunar7; Wiesner
[ TheSaint <[EMAIL PROTECTED]> ] > I've started to build a GUI for my Mailsweeper by the help of QT4 > Designer. I came across the problem that there isn't any prebuild file > browser like Kdialog. > I know some other sample, but PyGTK builded. I'm not happy to use a > different widget set or to

Re: UNIX credential passing

2008-05-31 Thread Sebastian &#x27;lunar7; Wiesner
[ Kris Kennaway <[EMAIL PROTECTED]> ] > Sebastian 'lunar' Wiesner wrote: >> >> Illustrates, how to use socket credentials without sendmsg/recvmsg and so >> without any need for patching. >> > Thanks to both you and Paul for your suggestions. For

Re: Help needed in choosing an algorithm for Cryptographic services.

2008-05-30 Thread Sebastian &#x27;lunar7; Wiesner
[ Peter Pearson <[EMAIL PROTECTED]> ] > On Thu, 29 May 2008 20:27:35 -0500, Larry Bates wrote: >> abhishek wrote: >>> Hi group, recently my employer asked me too implement encryption/ >>> decryption for secure data transfer over internet. Problem is that the >>> client application is written using

Re: UNIX credential passing

2008-05-30 Thread Sebastian &#x27;lunar7; Wiesner
[ Kris Kennaway <[EMAIL PROTECTED]> ] > I want to make use of UNIX credential passing on a local domain socket > to verify the identity of a user connecting to a privileged service. > However it looks like the socket module doesn't implement > sendmsg/recvmsg wrappers, and I can't find another mod

Re: maximum recursion depth?

2008-05-28 Thread Sebastian &#x27;lunar7; Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> ] > On Wed, 28 May 2008 02:28:54 -0700, bearophileHUGS wrote: > >> Dennis Lee Bieber, the ghost: >>> I'd have to wonder why so many recursive calls? >> >> Why not? > > Because of the recursion limit of

Re: Pinging a machine from python

2008-05-25 Thread Sebastian &#x27;lunar7; Wiesner
[ Prasanth <[EMAIL PROTECTED]> ] > I tried pinging a machine from python using socket programming but > could not do it. Is there any module which we can use to ping the > machine < like net::ping in perl> or can you give me simple program. At least on linux pinging requires raw sockets since ther

Re: need some help in serving static files inside a wsgi apps

2008-05-25 Thread Sebastian &#x27;lunar7; Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ "Martin v. Löwis" <[EMAIL PROTECTED]> ] >> I guess, Apache does some kind of memory caching for files, which are >> often requested and small enough to fit into the system memory. > > Are you sure about this? No, I'm not. That's why I said "I gu

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread Sebastian &#x27;lunar7; Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ zxo102 <[EMAIL PROTECTED]> ] >how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to > "\xED\x6F\x3C\x01" in python coding? > When I take 'ED6F3C01' as a string and insert '\x' into it, I just got > the error information : invalid \x es

Re: module import problem

2008-05-24 Thread Sebastian &#x27;lunar7; Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ Milos Prudek <[EMAIL PROTECTED]> ] > If I cd into /usr/share/python-support/python-gnupginterface and launch > Python I can "import GnuPGInterface". But when I run > DistUpgradeFetcherCore.py in that folder it always fails with No module > named Gnu

Re: Python, Daemons and D-Bus

2008-05-24 Thread Sebastian &#x27;lunar7; Wiesner
[ PurpleServerMonkey <[EMAIL PROTECTED]> ] > Would you use D-Bus or a more traditional IPC method such as sockets? > Although D-Bus is relatively new it looks interesting, just not sure > it would work well in this kind of project. DBus is not really intended for private communication between pro

Re: need some help in serving static files inside a wsgi apps

2008-05-24 Thread Sebastian &#x27;lunar7; Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ Diez B. Roggisch <[EMAIL PROTECTED]> ] >> I finally managed to work with static files with a little hack, but it's >> ugly because I'm reading each static file per request. > > How else should that work? Apache does that the same way. I guess, Apac

Re: Install man-pages with distutils/setuptools

2008-05-17 Thread Sebastian &#x27;lunar7; Wiesner
[ Hartmut Goebel <[EMAIL PROTECTED]> ] > Hi, > > is there a standard way or a snippet for installing man-pages with > >python set.py install > > when using distutils or setuptools? No, not even setuptools provides a standard way for man pages. -- Freedom is always the freedom of dissenter

Re: Why less emphasis on private data?

2007-01-07 Thread Sebastian &#x27;lunar7; Wiesner
[ Thomas Ploch <[EMAIL PROTECTED]> ] > sturlamolden schrieb: >> [EMAIL PROTECTED] wrote: >>> Coming from a C++ / C# background, the lack of emphasis on private >>> data seems weird to me. I've often found wrapping private data >>> useful to prevent bugs and enforce error checking.. >>> >>> It appe

Re: AES256 in PyCrypto

2007-01-07 Thread Sebastian &#x27;lunar7; Wiesner
[ [EMAIL PROTECTED] <[EMAIL PROTECTED]> ] > > Marc 'BlackJack' Rintsch wrote: > >> `a` must be of length 32 for AES256. And the length of `plainText` >> must be a multiple of 16 because it's a block cypher algorithm. > > Thank you. I have some follow up questions and 1 tangential question. >

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Sebastian &#x27;lunar7; Wiesner
[ Ivan Voras <[EMAIL PROTECTED]> ] > Sebastian 'lunar' Wiesner wrote: >> Carsten Haese <[EMAIL PROTECTED]> typed > >>> I don't think that that has anything to do with Linux or not. The >>> script is not the actual executable, hence its

Re: function without brackets ?

2007-01-03 Thread Sebastian &#x27;lunar7; Wiesner
Stef Mientki <[EMAIL PROTECTED]> typed > If I call a parameterless function without brackets at the end, > the function is not performed, but ... If you omit the brackets, you don't actually call the function. Instead you get a reference to the function object. Consider this example: cwd = os.g

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Sebastian &#x27;lunar7; Wiesner
Piet van Oostrum <[EMAIL PROTECTED]> typed >>>>>> Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> (SW) wrote: > >>SW> Linux seems to ignore SUID bit on scripts: > > The reason is that obeying SUID bits on scripts would be a security &

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Sebastian &#x27;lunar7; Wiesner
Carsten Haese <[EMAIL PROTECTED]> typed > On Tue, 2007-01-02 at 17:17 +0100, Sebastian 'lunar' Wiesner wrote: >> Ravi Teja <[EMAIL PROTECTED]> typed >> >> > >> > Ivan Voras wrote: >> >> Ramdas wrote: >> >> > Well

Re: How do I add users using Python scripts on a Linux machine

2007-01-02 Thread Sebastian &#x27;lunar7; Wiesner
Ravi Teja <[EMAIL PROTECTED]> typed > > Ivan Voras wrote: >> Ramdas wrote: >> > Well, >> > >> > I need to add users from a web interface for a web server, which >> > runs only Python. I need to add users, set quotas and in future >> > even look at managing ip tables to limit bandwidth. >> > >> >

Re: python , Boost and straight (but complex) C code

2006-12-30 Thread Sebastian &#x27;lunar7; Wiesner
Osiris <[EMAIL PROTECTED]> typed > I have these pieces of C-code (NOT C++ !!) I want to call from Python. > I found Boost. > I have MS Visual Studio 2005 with C++. > > is this the idea: > I write the following C source file: > > #include iostream is a C++ header fil

Re: DOS, UNIX and tabs

2006-12-30 Thread Sebastian &#x27;lunar7; Wiesner
Paul McNett <[EMAIL PROTECTED]> typed > Steven D'Aprano wrote: >> But I think we all agree that mixing tabs and spaces is A Very Bad >> Thing. > > I like mixing tabs and spaces, actually. Tabs for indentation, and > additional spaces to make the code "look pretty". Somebody please tell > me why t

Re: Reverse of SendKeys??

2006-12-29 Thread Sebastian &#x27;lunar7; Wiesner
"Erik Johnson" <> typed > Aside from the obvious security issues such a program would > represent (and your name and signature are curious in that respect as > well), you are basically asking for functionality (i.e., a key logger) > I believe to be outside what is offered by Python and/or the API

Re: DOS, UNIX and tabs

2006-12-28 Thread Sebastian &#x27;lunar7; Wiesner
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> typed > In <[EMAIL PROTECTED]>, Felix Benner wrote: > >> I like using tabs. And the style guide doesn't give a reason why one >> shouldn't and neither does the thread >> http://www.python.org/search/hypermail/python-1994q2/0198.html in the >> archive.

Re: DOS, UNIX and tabs

2006-12-28 Thread Sebastian &#x27;lunar7; Wiesner
Steven D'Aprano <[EMAIL PROTECTED]> typed > On Thu, 28 Dec 2006 09:26:28 +0100, Sebastian 'lunar' Wiesner wrote: > >> It is, and especially the problems with tabs shows you, why it is >> good practice to follow the standard in your own code, too... > &g

Re: DOS, UNIX and tabs

2006-12-28 Thread Sebastian &#x27;lunar7; Wiesner
"Erik Johnson" <> typed > > "Ben Finney" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Sebastian 'lunar' Wiesner" <[EMAIL PROTECTED]> writes: >> >> > Just a tip for you: In python you

Re: getting a process's PID

2006-12-27 Thread Sebastian &#x27;lunar7; Wiesner
eldorado <[EMAIL PROTECTED]> typed [snip] > This looks cleaner than the way I was going. I created a file > called ps.py > > #!/usr/local/bin/python > import os > g = os.popen("ps -e -o pid,command") > for line in g.readlines(): > if 'HUB' in line: > pid = line.strip().

Re: getting a process's PID

2006-12-27 Thread Sebastian &#x27;lunar7; Wiesner
eldorado <[EMAIL PROTECTED]> typed > Hello, > > I am trying to get python to give me the PID of a process (in this > case > HUB). I have it working, except for the fact that the output includes > \012 (newline). Is there a way to ask python not to give me a > newline? > > Python 1.4 (Oct 14 19

Re: DOS, UNIX and tabs

2006-12-27 Thread Sebastian &#x27;lunar7; Wiesner
Ben <[EMAIL PROTECTED]> typed > I have a python script on a windows system that runs fine. Both use > tabs to indent sections of the code. Just a tip for you: In python you never use tabs for indentation. The python style guide [1] recommends four spaces per indentation level. [1] http://www.pyt

Re: How to depress the output of an external module ?

2006-12-26 Thread Sebastian &#x27;lunar7; Wiesner
, "os.close(1)" closed > standard output, but I don't know how to open it again after the > function's execution. > > Still trying... On Linux systems you may try os.open('/dev/stdout', os.O_WRONLY'). This will connect to lowest available file descriptor to standard output. If you're lucky and no files have been opened after closing standard output, sys.stdout will point to standard output again. Bye Sebastian 'lunar' Wiesner -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: What am I supposed to do with an egg?!

2006-12-21 Thread Sebastian &#x27;lunar7; Wiesner
Stephan Kuhagen <[EMAIL PROTECTED]> wrote > Sebastian 'lunar' Wiesner wrote: > >> Morpheus <[EMAIL PROTECTED]> wrote >> >>> So, what am I supposed to do here now? >> >> That's easy: Breed it... > > Since two days I'm

Re: What am I supposed to do with an egg?!

2006-12-21 Thread Sebastian &#x27;lunar7; Wiesner
Morpheus <[EMAIL PROTECTED]> wrote > So, what am I supposed to do here now? That's easy: Breed it... -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Sebastian &#x27;lunar7; Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > >>> you're confusing the shell's "is this file executable" check with >>> the loader's "can I execute this file" check: >>> >

Re: Need Simple Way To Determine If File Is Executable

2006-12-21 Thread Sebastian &#x27;lunar7; Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > >>>>> no, I'm showing that a local file marked as executable overrides a >>>>> shared one, even if the local file isn't actually an executable. >

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian &#x27;lunar7; Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Paul Arthur wrote: > >>> no, I'm showing that a local file marked as executable overrides a >>> shared one, even if the local file isn't actually an executable. >> >> Only if you have your system set up badly. The current directory >> should not be in

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian &#x27;lunar7; Wiesner
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> schrieb > In <[EMAIL PROTECTED]>, Sebastian 'lunar' Wiesner > wrote: > >> Gabriel Genellina <[EMAIL PROTECTED]> schrieb >>> A similar function exists on Linux too. But even if a file has

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian &#x27;lunar7; Wiesner
Fredrik Lundh <[EMAIL PROTECTED]> schrieb > Sebastian 'lunar' Wiesner wrote: > >> No, they aren't! Try this: > > you're confusing the shell's "is this file executable" check with the > loader's "can I execute this file&q

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian &#x27;lunar7; Wiesner
Tim Roberts <[EMAIL PROTECTED]> schrieb > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >>On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: >>> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >> >>>This will tell you that "x.exe" is executable, even if "x.exe" >>>contains >>>

Re: Need Simple Way To Determine If File Is Executable

2006-12-20 Thread Sebastian &#x27;lunar7; Wiesner
Gabriel Genellina <[EMAIL PROTECTED]> schrieb > On 17 dic, 19:21, "Roger Upole" <[EMAIL PROTECTED]> wrote: > >> >> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >> >> >>This will tell you that "x.exe" is executable, even if "x.exe" >> >>contains >> >> nothing but zeros. >> >> > Isn't