Re: strange interaction between open and cwd

2010-05-05 Thread Cameron Simpson
On 06May2010 05:24, Nobody wrote: | On Thu, 06 May 2010 10:21:45 +1000, Cameron Simpson wrote: | | > Look at the st_rdev field (== the device holding this inode). | > When that changes, you've crossed a mount mount point. | | st_dev reports the device on which the inode resides. | | st_rdev is

Re: strange interaction between open and cwd

2010-05-05 Thread Nobody
On Thu, 06 May 2010 10:21:45 +1000, Cameron Simpson wrote: > Look at the st_rdev field (== the device holding this inode). > When that changes, you've crossed a mount mount point. st_dev reports the device on which the inode resides. st_rdev is only meaningul if the inode type is block device (S

Re: strange interaction between open and cwd

2010-05-05 Thread Nobody
On Wed, 05 May 2010 13:23:03 +0100, Baz Walter wrote: >>> so >>> if several filesystems are mounted in the same parent directory, there is >>> no way to tell which of them is the "right" one. >> >> The only case which would cause a problem here is if you mount the same >> device on two different s

Re: Where is python31.dll?

2010-05-05 Thread Pietro Campesato
> Your windows search command? > Which is how I verified the above. I looked at the folder visually. Simply using os.listdir shows there is in fact a python31.dll there: somehow it was an invisible file. This is strange since I've never touched any system folder. Thanks and forgive me if I have as

PyCon Australia Early-Bird running out!

2010-05-05 Thread Richard Jones
Registration is open and the Early Bird tickets are running out. Register here: http://pycon-au.org/reg We offer two levels of registration for PyCon Australia 2010: Full (Early Bird) - $165 This is the registration rate for regular attendees. We're offering a limited Early Bird rate for the

Looking for a gettext and/or Babel tutorial for Windows

2010-05-05 Thread python
I'm looking for a gettext and/or Babel tutorial for Windows. Any suggestions? Specific topics I'm interested in: 1. Understanding the full life cycle of PO/POT and MO files from their initial creation to their ongoing maintenance (under Windows) 2. Automating the use of pygettext and msgfmt.py (o

Re: Encrypt password within source code.

2010-05-05 Thread Vincent Davis
Thanks for the replies I though the answer was no. Vincent On Wed, May 5, 2010 at 7:48 PM, Tim Chase wrote: > On 05/05/2010 08:12 PM, Vincent Davis wrote: > >> I can't think of a way to do this, not sure it is possible but I feel as >> though I might not know what I don't know. >> >> I want to sh

Re: Is there a better way to set a system clock in Python (on a Linux system)

2010-05-05 Thread KDr2
man 2 clock_settime call it with ctypes -- Best Regards, -- KDr2 http://kdr2.net On Thu, May 6, 2010 at 10:47 AM, J wrote: > Is there a better way to do this? > > def SkewTime(): >''' >Optional function. We can skew time by 1 hour if we'd like to see real > sync >changes bein

Re: Is there a better way to set a system clock in Python (on a Linux system)

2010-05-05 Thread Chris Rebert
On Wed, May 5, 2010 at 7:47 PM, J wrote: > Is there a better way to do this? Yes: from datetime import datetime, timedelta > def SkewTime(): >    ''' >    Optional function. We can skew time by 1 hour if we'd like to see real sync >    changes being enforced >    ''' >    TIME_SKEW=1 >    loggin

Is there a better way to set a system clock in Python (on a Linux system)

2010-05-05 Thread J
Is there a better way to do this? def SkewTime(): ''' Optional function. We can skew time by 1 hour if we'd like to see real sync changes being enforced ''' TIME_SKEW=1 logging.info('Time Skewing has been selected. Setting clock ahead 1 hour') # Let's get our current ti

Re: Encrypt password within source code.

2010-05-05 Thread Tim Chase
On 05/05/2010 08:12 PM, Vincent Davis wrote: I can't think of a way to do this, not sure it is possible but I feel as though I might not know what I don't know. I want to share and example of a python script, to run it needs a google username and password. Is there a way for me to encrypt my use

Re: Encrypt password within source code.

2010-05-05 Thread Chris Rebert
On Wed, May 5, 2010 at 6:12 PM, Vincent Davis wrote: > I can't think of a way to do this, not sure it is possible but I feel as > though I might not know what I don't know. > I want to share and example of a python script, to run it needs a google > username and password. Is there a way for me t

Encrypt password within source code.

2010-05-05 Thread Vincent Davis
I can't think of a way to do this, not sure it is possible but I feel as though I might not know what I don't know. I want to share and example of a python script, to run it needs a google username and password. Is there a way for me to encrypt my username and password in the source code? I though

Re: ActiveState using different MS runtime files than official Python release? (was Re: Movable Python or ActivePython)

2010-05-05 Thread python
Hi Trent, On 10-05-05 12:04 PM, pyt...@bdurham.com wrote: >> I just took a look at the ActiveStatre 2.6.5.12 release (zip file >> version) and noticed that this file does not include the MSVCR90.DLL run >> time file - it includes MFC*.DLL files instead (and a different manifest >> file as well). >

Re: strange interaction between open and cwd

2010-05-05 Thread Cameron Simpson
On 05May2010 13:23, Baz Walter wrote: | here's what i get on my system, where '/dev/sda1' and '/dev/sda6' | are mounted at '/boot' and '/home' respectively: | | >>> os.stat('/').st_ino | 2L | >>> os.stat('/usr').st_ino | 212993L | >>> os.stat('/boot').st_ino | 2L | >>> os.stat('/home').st_ino | 2

Re: Python Embedding, no correct lib

2010-05-05 Thread moerchendiser2k3
On 6 Mai, 01:30, "Gabriel Genellina" wrote: > En Wed, 05 May 2010 09:04:06 -0300, moerchendiser2k3   > escribió: > > > I have a serious problem with Python. I am currently trying to > > implement Python into my app. > > Well this works fine, but get this: > > > I have my own Python interpreter in

Re: Python Embedding, no correct lib

2010-05-05 Thread Gabriel Genellina
En Wed, 05 May 2010 09:04:06 -0300, moerchendiser2k3 escribió: I have a serious problem with Python. I am currently trying to implement Python into my app. Well this works fine, but get this: I have my own Python interpreter in a subfolder of my app. When I start my app, PYTHONHOME is set, a

Re: find out whther byte two .pyc files contain the same byte code.

2010-05-05 Thread Gabriel Genellina
En Wed, 05 May 2010 10:34:34 -0300, gelonida escribió: I'd like to know whether the byte code of two .pyc files is identical. I thought, I could just compare the md5sums of thw .pyc files. However this does not work. It seems, that .pyc ontains the time stamp of the source file. the .pyc file

Re: ActiveState using different MS runtime files than official Python release? (was Re: Movable Python or ActivePython)

2010-05-05 Thread Trent Mick
On 10-05-05 12:04 PM, pyt...@bdurham.com wrote: I just took a look at the ActiveStatre 2.6.5.12 release (zip file version) and noticed that this file does not include the MSVCR90.DLL run time file - it includes MFC*.DLL files instead (and a different manifest file as well). Can anyone explain wh

Re: Teaching Programming

2010-05-05 Thread superpollo
Martin P. Hellwig ha scritto: On 05/04/10 12:59, superpollo wrote: Martin P. Hellwig ha scritto: For the corner cases (I can think of a couple) it is good to know you can use ';' most of the time. most but not always as i noted (think about loops or function definition) Well through in s

Re: Teaching Programming

2010-05-05 Thread Martin P. Hellwig
On 05/04/10 12:59, superpollo wrote: Martin P. Hellwig ha scritto: For the corner cases (I can think of a couple) it is good to know you can use ';' most of the time. most but not always as i noted (think about loops or function definition) Well through in some exec magic then, for exampl

"HOLLYWOOD ACTRESS" "HOLLYWOOD ACTRESS WALLPAPERS" "SEXY HOLLYWOOD ACTRESS" "PRETTY HOLLYWOOD ACTRESS" "CUTE HOLLYWOOD ACTRESS" "HOLLYWOOD ACTRESS" ON http://hollywood6y.blogspot.com/

2010-05-05 Thread saima81
"HOLLYWOOD ACTRESS" "HOLLYWOOD ACTRESS WALLPAPERS" "SEXY HOLLYWOOD ACTRESS" "PRETTY HOLLYWOOD ACTRESS" "CUTE HOLLYWOOD ACTRESS" "HOLLYWOOD ACTRESS" ON http://hollywood6y.blogspot.com/ "HOLLYWOOD ACTRESS" "HOLLYWOOD ACTRESS WALLPAPERS" "SEXY HOLLYWOOD ACTRESS" "PRETTY HOLLYWOOD ACTRESS" "CUTE HOLLYW

Re: How to check what is holding reference to object

2010-05-05 Thread Marius Gedminas
On Apr 27, 11:45 pm, Michal M wrote: > I've just found out that one of objects is not destroyed when it > should be. This means that something was holding reference to this > object or part of it (i.e. method). Is there any way to check what > holds that reference? I am unable to do that just look

Re: How to check what is holding reference to object

2010-05-05 Thread Marius Gedminas
On Apr 28, 3:59 pm, Christian Heimes wrote: > The trick works only for objects that are tracked by CPython's garbage > collector. Simple and non-containerish objects like str, int, unicode > and some other types aren't tracked by the gc. Yes they are -- have you ever tried >>> import gc >>>

SQLObject 0.12.4

2010-05-05 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.12.4, a minor bugfix release of branch 0.12 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be eas

SQLObject 0.11.6

2010-05-05 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.11.6, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be eas

ActiveState using different MS runtime files than official Python release? (was Re: Movable Python or ActivePython)

2010-05-05 Thread python
In a recent thread ("Movable Python or ActivePython), Sridhar Ratnakumar pointed out that the ActiveState Python releases can be downloaded as ZIP files vs. MSI files. (Great idea - thank you ActiveState!) > The .MSI installer does require installation, but there is also a .ZIP > package which do

Re: Where is python31.dll?

2010-05-05 Thread Christian Heimes
Am 05.05.2010 19:26, schrieb Pietro Campesato: Hi, recently I've been wondering how to roll my own portable python 3.1 (since there seems to be no portable app specifically for this version). Thinking you can just copy your install folder (+ python's dll), I've noticed that there seems to be no p

Re: Where is python31.dll?

2010-05-05 Thread Terry Reedy
On 5/5/2010 1:26 PM, Pietro Campesato wrote: Hi, recently I've been wondering how to roll my own portable python 3.1 (since there seems to be no portable app specifically for this version). Thinking you can just copy your install folder (+ python's dll), I've noticed that there seems to be no pyt

Re: Movable Python or ActivePython

2010-05-05 Thread Sridhar Ratnakumar
On 2010-05-05, at 5:47 AM, balzer wrote: > I want Python pack that can run without being installed, mostly for testing > programs. As I read, Movable Python can run without being installed. It needs > no registry entries and knows the path to all the dlls (system or otherwise) > that it uses.

Re: Movable Python or ActivePython

2010-05-05 Thread Terry Reedy
On 5/5/2010 8:47 AM, balzer wrote: I want Python pack that can run without being installed, mostly for testing programs. As I read, Movable Python can run without being installed. It needs no registry entries and knows the path to all the dlls (system or otherwise) that it uses. Whats about Activ

Re: Teaching Programming

2010-05-05 Thread Terry Reedy
On 5/5/2010 4:50 AM, Dave Angel wrote: alex23 wrote: Ed Keith wrote: Knuth wanted the generated source to be unreadable, so people would not be tempted to edit the generated code. This is my biggest issue with Knuth's view of literate programming. If the generated source isn't readable, am I

Where is python31.dll?

2010-05-05 Thread Pietro Campesato
Hi, recently I've been wondering how to roll my own portable python 3.1 (since there seems to be no portable app specifically for this version). Thinking you can just copy your install folder (+ python's dll), I've noticed that there seems to be no python31.dll in my systems folder (c:\windows\syst

Re: Create a new process to run python function

2010-05-05 Thread Christian Heimes
Am 05.05.2010 17:59, schrieb Benjamin Kaplan: Multiprocessing wasn't added until Python 2.6. http://www.python.org/dev/peps/pep-0371/ In Python 2.5, it was still a 3rd party package. http://pypi.python.org/pypi/processing The project's website appears to be down right now though. http://develop

Re: Create a new process to run python function

2010-05-05 Thread Benjamin Kaplan
On Wed, May 5, 2010 at 10:33 AM, James Mills wrote: > On Wed, May 5, 2010 at 10:56 PM, Massi wrote: >> in my script (python 2.5 on windows xp) I need to run a simple >> function in a separate process. In other words I need something >> similar to the fork function under UNIX. I tried with threads

Re: Generating nested code with context managers

2010-05-05 Thread Dan Goodman
I tried a very similar thing, but not using with statements: http://mail.python.org/pipermail/python-list/2010-March/1239577.html Dan On 04/05/2010 22:36, Terry Reedy wrote: In a current thread, people have claimed that generating properly indented nested blocks is a pain because of the need t

Re: abc don't play well with private method

2010-05-05 Thread Bruno Desthuilliers
mouadino a écrit : i have a problem here : i want to make a plugin architecture using abstract base class , this is my base class : # -*- coding: utf-8 -*- import abc class BASE_Connector: """ Mount point for plugins which refer to actions that can be performed. Plugins implemen

Re: Portable Python

2010-05-05 Thread Laszlo Nagy
Is there any difference in functionality between standard Python pack and portable Python? It is not so easy to install third party modules for portable Python... Why standard Python pack installation requires reboot after installation? It is not true for all operating systems. At least under

abc don't play well with private method

2010-05-05 Thread mouadino
i have a problem here : i want to make a plugin architecture using abstract base class , this is my base class : # -*- coding: utf-8 -*- import abc class BASE_Connector: """ Mount point for plugins which refer to actions that can be performed. Plugins implementing this reference s

Re: Create a new process to run python function

2010-05-05 Thread James Mills
On Wed, May 5, 2010 at 10:56 PM, Massi wrote: > in my script (python 2.5 on windows xp) I need to run a simple > function in a separate process. In other words I need something > similar to the fork function under UNIX. I tried with threads: Use the new multiprocesing package. > import os, threa

Re: Sharing a program I wrote

2010-05-05 Thread James Harris
On 5 May, 04:25, Scott wrote: > James, > > Thanks for the comprehensive reply. I would like to post it to > comp.lang.python but the main file is 169 lines long and the file for > functions is 316 lines long. I'm thinking that is a little long for > this format. You're welcome. Yes, it sounds a b

find out whther byte two .pyc files contain the same byte code.

2010-05-05 Thread gelonida
Hi, I'd like to know whether the byte code of two .pyc files is identical. I thought, I could just compare the md5sums of thw .pyc files. However this does not work. It seems, that .pyc ontains the time stamp of the source file. the .pyc file changes its contents when I don't change the file's c

Re: Create a new process to run python function

2010-05-05 Thread Christian Heimes
Joe Riopel wrote: On Wed, May 5, 2010 at 8:56 AM, Massi wrote: but this does not work, since the two threads share the same pid. Can anyone give me a suggestion? Have you looked at os.fork ? http://docs.python.org/library/os.html#os.fork Fork on Windows XP? Have a lot of fun ... The NT Kern

Re: Exclusively lock a file to prevent other processes from reading it?

2010-05-05 Thread python
Chris, Philip, Christian, John and others, Thank you all for your replies. Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Create a new process to run python function

2010-05-05 Thread Joe Riopel
On Wed, May 5, 2010 at 8:56 AM, Massi wrote: > but this does not work, since the two threads share the same pid. Can > anyone give me a suggestion? Have you looked at os.fork ? http://docs.python.org/library/os.html#os.fork -- http://mail.python.org/mailman/listinfo/python-list

Create a new process to run python function

2010-05-05 Thread Massi
Hi everyone, in my script (python 2.5 on windows xp) I need to run a simple function in a separate process. In other words I need something similar to the fork function under UNIX. I tried with threads: import os, threading def func(s) : print "I'm thread number "+s, os.getpid() threading.T

Re: how to import subprocess into my 'subprocess.py' file

2010-05-05 Thread Jean-Michel Pichavant
hiral wrote: Hi, I am doing following in my 'subprocess.py' file... 1 from __future__ import absolute_import 2 from subprocess import * 3 from subprocess import call as myCall 4 from subprocess import Popen as myPopen 5 6 def getProperCmd(cmd): 7 cmd += 'time' # this is just a

Movable Python or ActivePython

2010-05-05 Thread balzer
I want Python pack that can run without being installed, mostly for testing programs. As I read, Movable Python can run without being installed. It needs no registry entries and knows the path to all the dlls (system or otherwise) that it uses. Whats about ActivePython http://www.activestate.com

Re: how to import subprocess into my 'subprocess.py' file

2010-05-05 Thread Steven D'Aprano
On Wed, 05 May 2010 03:34:06 -0700, hiral wrote: > So how can I create a python file (with the same name as standard module > name) with custom methods? Don't do this. It will lead to nothing but trouble. Python doesn't support multiple modules with the same name. Unless you create a custom imp

Re: strange interaction between open and cwd

2010-05-05 Thread Baz Walter
On 05/05/10 07:24, Nobody wrote: On Wed, 05 May 2010 02:41:09 +0100, Baz Walter wrote: i think the algorithm also can't guarantee the intended result when crossing filesystem boundaries. IIUC, a stat() call on the root directory of a mounted filesystem will give the same inode number as its par

Portable Python

2010-05-05 Thread balzer
Is there any difference in functionality between standard Python pack and portable Python? Why standard Python pack installation requires reboot after installation? Can portable Python used from hard drive folder? -- http://mail.python.org/mailman/listinfo/python-list

Python Embedding, no correct lib

2010-05-05 Thread moerchendiser2k3
Hi, I have a serious problem with Python. I am currently trying to implement Python into my app. Well this works fine, but get this: I have my own Python interpreter in a subfolder of my app. When I start my app, PYTHONHOME is set, and an environment variable is set to it can find the python DLL

how to import subprocess into my 'subprocess.py' file

2010-05-05 Thread hiral
Hi, I am doing following in my 'subprocess.py' file... 1 from __future__ import absolute_import 2 from subprocess import * 3 from subprocess import call as myCall 4 from subprocess import Popen as myPopen 5 6 def getProperCmd(cmd): 7 cmd += 'time' # this is just an example; in f

Re: Teaching Programming

2010-05-05 Thread Ed Keith
--- On Tue, 5/4/10, alex23 wrote: > From: alex23 > Subject: Re: Teaching Programming > To: python-list@python.org > Date: Tuesday, May 4, 2010, 8:47 PM > Ed Keith > wrote: > > Knuth wanted the generated source to be unreadable, so > people would not be tempted to edit the generated code. > > T

the solution to your current problems........join this: http://www.thevoid1.net/para

2010-05-05 Thread Robin
the solution to your current problemsjoin this: http://www.thevoid1.net/para -- http://mail.python.org/mailman/listinfo/python-list

Re: Python debuggers with sys.settrace()

2010-05-05 Thread Carl Banks
On May 2, 11:06 am, Sarah Mount wrote: > This is a bit of an odd question, but is there any way for a Python > debugger to suppress I/O generated by the program which is being > debugged? I guess an "obvious" thing to do would be to replace core > parts of the standard library and change any relev

Re: Django as exemplary design

2010-05-05 Thread Bruno Desthuilliers
TomF a écrit : On 2010-05-04 07:11:08 -0700, alex23 said: (snip) (I also think there's value to be gained in studying _bad_ code, too...) True, although whether that's time well spent is another question. The more bad code (mine or not) I have to maintain (or even just read and understand

Re: Teaching Programming

2010-05-05 Thread Dave Angel
alex23 wrote: Ed Keith wrote: Knuth wanted the generated source to be unreadable, so people would not be tempted to edit the generated code. This is my biggest issue with Knuth's view of literate programming. If the generated source isn't readable, am I just supposed to trust it? How