Re: embedding console in wxpython app

2006-08-07 Thread placid
Philippe Martin wrote: > Janto Dreijer wrote: > > > I'm writing a Linux filemanager using wxPython. I'd like to embed a > > bash console inside it. I have found the Logilab pyqonsole > > (http://www.logilab.org/projects/pyqonsole), but it uses PyQT. > > > > Does anyone know how to do this from wx?

How to check n/w shared dir existance using py script?

2006-08-07 Thread - C Saha -
Hi Python Gurus   I have a python script that is supposed to check to see if a folder exists in a computer on a network, but python always seems to return false.     for example: 1) folder_path = “shared-dir\\packages\\hwmanager\\4.00.1.16” if os.path.isdir(folder_path):    

Re: Proposal: [... for ... while cond(x)]

2006-08-07 Thread Duncan Booth
Diez B. Roggisch wrote: >> No, the list comprehension lets you write an expression directly >> avoiding a function call, and it also allows you to add in a >> condition which can be used to filer the sequence. Your proposal adds >> nothing. > > It does. Consider this: > > whatever = [x for x in

Re: testing array of logicals

2006-08-07 Thread H J van Rooyen
"Janto Dreijer" <[EMAIL PROTECTED]> wrote: | | Janto Dreijer wrote: | > John Henry wrote: | > > Simon Forman wrote: | > > > > | > > > > False not in logflags | > > > > | > > > | > > > Or, if your values aren't already bools | > > > | > > > False not in (bool(n) for n in logflags) | > > | > > Ve

Re: Is there an obvious way to do this in python?

2006-08-07 Thread H J van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: | On Sat, 5 Aug 2006 11:20:59 +0200, "H J van Rooyen" | <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: | | > | > no such luck - reality will probably be Linux for server, and a horrible mix of | > windoze machines on the client sid

Re: Proposal: [... for ... while cond(x)]

2006-08-07 Thread Duncan Booth
Slawomir Nowaczyk wrote: > #> No, the list comprehension lets you write an expression directly > #> avoiding a function call, and it also allows you to add in a > #> condition which can be used to filer the sequence. > > I am not sure if I understand you correctly, but... Does it? > a = [0

Re: Python Projects Continuous Integration

2006-08-07 Thread Ziga Seilnacht
Dave Potts wrote: > Hi, > > I'm just starting a development project in Python having spent time in > the Java world. I was wondering what tool advice you could give me > about setting up a continuous integration environment for the python > code: get the latest source, run all the tests, package u

Re: Python Projects Continuous Integration

2006-08-07 Thread Ant
Harry George wrote: > [snip stuff about how to set emacs up as your IDE] Not sure which post you read, but the OP of this thread was asking about continuous integration, not integrated development environments. i.e. tools to *automatically* check out code when the repository has changed, build it

Re: Is there an obvious way to do this in python?

2006-08-07 Thread H J van Rooyen
"Bruno Desthuilliers" <[EMAIL PROTECTED]> H J van Rooyen a écrit : > "Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > (snip) > | If you go the web application route, each "login" would use a cookie > | to control session, so the application server can determine what > | functions to present to

Re: Question about using python as a scripting language

2006-08-07 Thread Jordan Greenberg
Terry Reedy wrote: > "heavydada" <[EMAIL PROTECTED]> wrote in message >> I just need some way of >> being able to read from the file what function the program needs to >> call next. Any help is appreciated. > > Suppose you have a file actions.py with some action functions: > def hop(self): ... >

How to get hours and minutes from 'datetime.timedelta' object?

2006-08-07 Thread Lad
Hello, what is the best /easest way how to get number of hours and minutes from a timedelta object? Let's say we have aa=datetime.datetime(2006, 7, 29, 16, 13, 56, 609000) bb=datetime.datetime(2006, 8, 3, 17, 59, 36, 46000) so c=bb-aa will be datetime.timedelta(5, 6339, 437000) I can easily get d

Re: How to get hours and minutes from 'datetime.timedelta' object?

2006-08-07 Thread John Machin
Lad wrote: > Hello, > what is the best /easest way how to get number of hours and minutes > from a timedelta object? > Let's say we have > aa=datetime.datetime(2006, 7, 29, 16, 13, 56, 609000) > bb=datetime.datetime(2006, 8, 3, 17, 59, 36, 46000) > so > c=bb-aa > will be > datetime.timedelta(5, 63

py2exe and pyparallel

2006-08-07 Thread mehdi karimi
HiI want to convert a .py file into .exe with py2exe(I use Pyparallel(import parallel) in that program)after running setup.py py2exe this massage appear:"The following modules appear to be missing: ['parallelioctl' , 'paralleljava']  " how I can remove this Problem?thanks See the all-new, red

Re: Python open a named pipe == hanging?

2006-08-07 Thread Antoon Pardon
On 2006-08-07, Rochester <[EMAIL PROTECTED]> wrote: > Thanks Alex, now I think I understand much better the fifo/pipe mechanism > and how Python treats them. > > For those who are interested, I would like to restate the problem I was > tring to solve and a working solution (inspired by Alex Mar

NNTPlib::xover problem

2006-08-07 Thread Helmut Jarausch
Hi I try to regularly extract recent news from some newsgroups. If News is an NNTP object I try (Response,Articles)= News.xover(str(int(Last)+1),'1000') where 'Last' is the (previously saved) number of the last article read. If there are no new articles I get an Exception Traceback (most rece

Re: How to get hours and minutes from 'datetime.timedelta' object?

2006-08-07 Thread Ant
John Machin wrote: > Lad wrote: > > Hello, > > what is the best /easest way how to get number of hours and minutes > > from a timedelta object? ... > >>> diff.days > 0 > >>> diff.seconds > 52662 > >>> diff.microseconds > 922000 > >>> minutes = (diff.seconds + diff.microseconds / 100.0) / 60.0

Re: NNTPlib::xover problem

2006-08-07 Thread Michiel Sikma
Hi Helmut, I guess it simply raises an exception in case there are no articles; this may not be what you expected, but it would seem that this is the way it operates. You should try catching the exception to plan out a course of action in case no articles are present. Michiel Op 7-aug-2006

Re: Proposal: [... for ... while cond(x)]

2006-08-07 Thread Rick Zantow
Duncan Booth <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Diez B. Roggisch wrote: > >>> No, the list comprehension lets you write an expression directly >>> avoiding a function call, and it also allows you to add in a >>> condition which can be used to filer the sequence. Your proposal

Re: VisualStudio2005 supported in distutils

2006-08-07 Thread Martin v. Löwis
mg schrieb: > I know the incompatibility problem to have Python compiled with one > compiler and packages with another one. Nevertheless, in my case, Python > is well compiled with VisualStudio2005 thank to project files provided > by Mr Python himself. So, Python is not yet ready to support comple

Re: VisualStudio2005 supported in distutils

2006-08-07 Thread Martin v. Löwis
Jarek Zgoda schrieb: > Sure, but what if I succesfully compile Python with VS 2005? Hier ist > der Hund begraben, distutils cann't handle this compiler so I'll be > unable to compile any extension for my home-baken Python. It sure can. Just open a "Visual Studio Command Prompt" (or whatever its na

Re: install python on cdrom

2006-08-07 Thread Martin v. Löwis
Fabian Braennstroem schrieb: > Thanks, but unfortunately the administrative policy does not > allow such installation, but could it work, when I do such a > installation in my home directory, copy everything to a > cdrom/dvd and mount it in proper place? Yes, that should work as well. Python won't

Re: Subtyping a non-builtin type in C/C++

2006-08-07 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I am trying to create a subclass of a python class, defined in python, > in C++, but I am having some problems. Is the base class a classic class or a new-style class? Depending on the answer, the code you should write varies significantly. To create a new type, it mi

regex for replacing \r\n

2006-08-07 Thread abcd
I am trying to get a regex that will match \r\n in a string. ultimately i am trying to replace all \r\n with somethign else, say BLAH. For example: This is a message on a new line would become: This is a messageBLAHon a new line. any ideas? i tried re.compile('\r\n').match("This is a message"

Re: Nice unicode -> ascii translation?

2006-08-07 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > The trick is finding the right . Has someone attempted this > before, or am I stuck writing my own solution? In this specific example, there is a different approach, using the Unicode character database: def strip_combining(s): import unicodedata # Expand

Re: regex for replacing \r\n

2006-08-07 Thread Patrick Bothe
abcd wrote: > [...] > ultimately i am trying to replace all \r\n with somethign else, say > BLAH. > > For example: > This is a message > on a new line > > would become: > This is a messageBLAHon a new line. Concluding from your question I think you might be happy with a simple string `.replace`:

Re: VisualStudio2005 supported in distutils

2006-08-07 Thread Jarek Zgoda
Martin v. Löwis napisał(a): >>Sure, but what if I succesfully compile Python with VS 2005? Hier ist >>der Hund begraben, distutils cann't handle this compiler so I'll be >>unable to compile any extension for my home-baken Python. > > It sure can. Just open a "Visual Studio Command Prompt" (or wha

Re: NNTPlib::xover problem

2006-08-07 Thread Helmut Jarausch
Michiel Sikma wrote: > Hi Helmut, > > I guess it simply raises an exception in case there are no articles; > this may not be what you expected, but it would seem that this is the > way it operates. You should try catching the exception to plan out a > course of action in case no articles are pr

Re: [ANN] rest2web 0.5.0 Beta 1 Released

2006-08-07 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get hours and minutes from 'datetime.timedelta' object?

2006-08-07 Thread John Machin
Ant wrote: > John Machin wrote: > > Lad wrote: > > > Hello, > > > what is the best /easest way how to get number of hours and minutes > > > from a timedelta object? > ... > > >>> diff.days > > 0 > > >>> diff.seconds > > 52662 > > >>> diff.microseconds > > 922000 > > >>> minutes = (diff.seconds +

is it possible to dividing up a class in multiple files?

2006-08-07 Thread Martin Höfling
Hi there, is it possible to put the methods of a class in different files? I just want to order them and try to keep the files small. Regards Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread Michiel Sikma
Hi Martin, I don't think that's possible, since a file is executed when it is imported. If you load a file which contains a "partial" class, you will get an error because the indentation is incorrect, or the methods will be loaded in the wrong namespace. Regards, Michiel Op 7-aug-2006, om

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread Diez B. Roggisch
Martin Höfling wrote: > is it possible to put the methods of a class in different files? I just > want to order them and try to keep the files small. No, its not possible. What you can do is to create several classes and one that inherits from all of them. Better yet is to not write huge classe

PyGTK TreeView segmentation fault on expand_all()

2006-08-07 Thread Chris Johnson
Good morning. I have recently begun a project using PyGTK, and part of my planned interface has a gtk.TreeView showing a portion of the filesystem. Now, rather than load the entire FS structure into the tree right from the beginning, I made a lazy tree by adding blank children to rows representing

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread Chris Johnson
Martin Höfling wrote: > Hi there, > > is it possible to put the methods of a class in different files? I just > want to order them and try to keep the files small. > > Regards > Martin I ran across pyp the other day. It may be what you're wanting. http://www.freenet.org.nz/python/pyp/ --

Re: Nice unicode -> ascii translation?

2006-08-07 Thread skip
crowell> However, I'd like to see the more sensible "Bela Fleck" instead crowell> of dropping '\xe9' entirely. Assuming the data are in latin-1 or can be converted to it, try my latscii codec: http://orca.mojam.com/~skip/python/latscii.py Skip -- http://mail.python.org/mailman/li

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread bearophileHUGS
Martin Höfling: > is it possible to put the methods of a class in different files? I just > want to order them and try to keep the files small. Well, you can create one or more modules filled with nude methods, and you can define a class inside another module, and then add the methods to this last

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread Ziga Seilnacht
Martin Höfling wrote: > Hi there, > > is it possible to put the methods of a class in different files? I just > want to order them and try to keep the files small. > > Regards > Martin You could use something like this: """ Example usage: >>> class Person(object): ... def __init__(self

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread Bruno Desthuilliers
Martin Höfling wrote: > Hi there, > > is it possible to put the methods of a class in different files? I just > want to order them and try to keep the files small. Technically, yes - but in a somewhat hackish way. But you *really* should not have such a need at first. Smells like a design (or co

Re: How to get hours and minutes from 'datetime.timedelta' object?

2006-08-07 Thread Ant
John Machin wrote: ... > 1. If that's what he wanted, it was a very peculiar way of asking. Do > you suspect that he needs to be shown how to conver 877.7... minutes > into hours, minutes and seconds??? Chill dude, It wasn't an attack :-) The datetime class has hour, minute and second attributes

need an alternative to getattr()

2006-08-07 Thread [EMAIL PROTECTED]
Hi, AIM: I have a config file that contains configuration under headings like this: heading1: heading2: ... ... i parse this file to get heading1, heading2, etc and then i want to call heading1.process(), heading2.process(), etc. What i am trying to do is: (this is not the exact code, it jus

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread Ant
Martin Höfling wrote: > Hi there, > > is it possible to put the methods of a class in different files? I just > want to order them and try to keep the files small. The editor leo (http://webpages.charter.net/edreamleo/front.html) gives you a way of handling large files in this way without actuall

format a number for output

2006-08-07 Thread abcd
if i have a number, say the size of a file, is there an easy way to output it so that it includes commas? for example: 1890284 would be: 1,890,284 I am looking for something builtin to python, not a third party lib. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: is it possible to dividing up a class in multiple files?

2006-08-07 Thread Martin Höfling
Thanks for your suggestions, precompiling is not an option, cause I can't introduce extra dependencies from a precompiler. > Better yet is to not write huge classes and getting rid of strange > conventions or views that make the problem appear as such. To explain that: > I've never felt the need

Re: format a number for output

2006-08-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, abcd wrote: > if i have a number, say the size of a file, is there an easy way to > output it so that it includes commas? > > for example: > > 1890284 > > would be: > > 1,890,284 I think this comes close: In [23]: import locale In [24]: locale.setlocale(locale.LC_ALL

timeout calling local se

2006-08-07 Thread [EMAIL PROTECTED]
(Environment: RedHat Linux recent, Python 2.3.5) We have a batch processing script that on occasion needs to send out an email. We have a sendmail running locally. Sometimes we get a socket timeout on sending that email. Increasing the timeout to 30sec reduced but did not eliminate it. It seems

screensaver in Python

2006-08-07 Thread daniel Van der Borght
Programming a screensaver in Python, where and/or how di I start ? Daniel VdB -- http://mail.python.org/mailman/listinfo/python-list

Re: screensaver in Python

2006-08-07 Thread Ant
daniel Van der Borght wrote: > Programming a screensaver in Python, where and/or how di I start ? Google for "python screensaver". The first link has a module to use... -- http://mail.python.org/mailman/listinfo/python-list

Re: email client like mutt

2006-08-07 Thread cga2000
On Sun, Aug 06, 2006 at 04:15:08PM EDT, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > > > >I am looking for a python email client for the terminal... something like > >mutt; maybe, so powerfull ;-) > > What's wrong with mutt? Like he says it's n

PyMorphic Project

2006-08-07 Thread Anders Österholm
As a part of my Master Thesis in Cognitive Science at the University of Linköping in Sweden i have created a Squeak-like system in Python called PyMorphic. Project homepage is http://pymorphic.sourceforge.net/ I am about to make a new release with minor changes.There is a tutorial for you in the To

Re: need an alternative to getattr()

2006-08-07 Thread Uffe Wassmann
I think you would benefit from looking at the ConfigParser module. I haven't tried it yet, but it looks like a nice interface for writing and reading configuration files. -Uffe. On 7 Aug 2006 07:30:41 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > AIM: I have a config file that con

Re: screensaver in Python

2006-08-07 Thread daniel Van der Borght
are you Chris ? anyway : thank you... "Ant" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > > daniel Van der Borght wrote: >> Programming a screensaver in Python, where and/or how di I start ? > > Google for "python screensaver". The first link has a module to use... > -- http:

Re: Python open a named pipe == hanging?

2006-08-07 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > Donn Cave <[EMAIL PROTECTED]> wrote: > > > In article <[EMAIL PROTECTED]>, > > Rochester <[EMAIL PROTECTED]> wrote: > > > > > I just found out that the general open file mechanism doesn't work > > > for named

Re: screensaver in Python

2006-08-07 Thread Ant
daniel Van der Borght wrote: > are you Chris ? anyway : thank you... No - I really am Ant. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: need an alternative to getattr()

2006-08-07 Thread Ant
> getattr(heading, "process")(file_ptr) ... > Is there an alternatice to getattr() that will solve my problem, or is > there another way to do it. How about: eval("%s.process(%s)" % (heading, file_ptr)) -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Mod_python 3.2.10

2006-08-07 Thread Gregory (Grisha) Trubetskoy
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.2.10 release of mod_python. Mod_python 3.2.10 is considered a stable release, suitable for production use. Mod_python is an Apache HTTP Server module that embeds the Python language interpreter within

Re: need an alternative to getattr()

2006-08-07 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > import heading1 > import heading2 > While True: > heading = get_next_heading(file_ptr) # This func will return > "heading1", then "heading2"(on next call) > if heading = "": > break > getattr(heading, "process")(file_ptr

Python 2.5b2 and excepthook problem

2006-08-07 Thread Larry Bates
I have some classes that trap hook sys.excepthook and log exceptions prior to the program exiting. This has proven to be an effective way to log what is going on with many of my "lights out" processes. I'm doing some testing with Python 2.5b2 and can't seem to get it to work properly. Here is a v

Re: format a number for output

2006-08-07 Thread BartlebyScrivener
abcd wrote: > if i have a number, say the size of a file, is there an easy way to > output it so that it includes commas? > > for example: > > 1890284 > > would be: > > 1,890,284 see also this thread: http://tinyurl.com/qf6ew rd -- http://mail.python.org/mailman/listinfo/python-list

Re: Ann: SE 2.2b

2006-08-07 Thread Anthra Norell
If you go to http://www.python.org/pypi. you see it about in the middle of the recently updated packages. It's blue, so you can click it and you're there. The update page shows only the twenty most recent updates. So they drop out at the bottom rather fast. If it's gone by the time you chec

A problem from a Vim user

2006-08-07 Thread manuhack
When I use raw_input('Please type something.\n') in the python 2.4 command line windows, it doesn't have any problem. However, when I run the same command in vim 7 as :py raw_input('Please type something.\n'), there is an EOFError: EOF when reading a line. Is there a way to use that command withi

Re: Need a compelling argument to use Django instead of Rails

2006-08-07 Thread aaronwmail-usenet
Damjan wrote: > Yes, but your mod_python programs still run with the privileges of the > Apache process, as are all the other mod_python programs. This means that > my mod_python program can (at least) read files belonging to you - > including your config file holding your database password I

Re: Static Variables in Python?

2006-08-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paddy <[EMAIL PROTECTED]> wrote: . [substantial thread with many serious alternatives] . . >You can do things with function attributes > >def foo(x

Re: format a number for output

2006-08-07 Thread Tim Williams
On 7 Aug 2006 07:55:11 -0700, abcd <[EMAIL PROTECTED]> wrote: > if i have a number, say the size of a file, is there an easy way to > output it so that it includes commas? > > for example: > > 1890284 > > would be: > > 1,890,284 > I was bored !! >>> a = 1890284 >>> ','.join([str(a)[::-1][x:x+3] f

Resource temporarily unavailable launching idle under cygwin

2006-08-07 Thread jcmendez
Hello everyone. Trying to run idle from a cygwin session on Win2k (yuk, but I must) I'm getting the following error message. It seems something more Windoze-driven that Python driven, and I'm not and don't wanna be an expert on that OS. Since the group has a good mix of users in different plat

Installing a Windows Printer

2006-08-07 Thread D
I would like to create a script for Windows 2000 that will create a Standard TCP/IP printer port and install a printer (I have the applicable printer drivers needed for the install on a network share). My plan is to use py2exe and distribute (also via network share) the script so that administrator

Re: Resource temporarily unavailable launching idle under cygwin

2006-08-07 Thread jcmendez
PS: I already tried what suggested in a previous message on the groups "Python 2.3.2 spawn problem" - Uninstalling and reinstalling python without luck. Python 2.4.3 (#1, May 18 2006, 07:40:45) [GCC 3.3.3 (cygwin special)] on cygwin Thanks! jcmendez wrote: > Hello everyone. Trying to run idle

Re: Initializing the number of slots in a dictionary

2006-08-07 Thread Jon Smirl
On Mon, 07 Aug 2006 00:33:33 -0400, Tim Peters wrote: > ... > > [Jon Smirl] >> I know in advance how many items will be added to the dictionary. Most >> dictionary implementations I have previously worked with are more >> efficient if they know ahead of time how big to make their tables. > > Ric

Re: format a number for output

2006-08-07 Thread Yu-Xi Lim
Tim Williams wrote: a = 1890284 ','.join([str(a)[::-1][x:x+3] for x in range(len(str(a)))[::3]])[::-1] > '1,890,284' > > Ugly ! > >>> b = 189028499 >>> ','.join([str(b)[::-1][x:x+3] for x in range(len(str(b)))[::3]])[::-1] '-,189,028,499' >>> c = 1890284.1 >>> ','.join([str(c)[::

Re: format a number for output

2006-08-07 Thread Yu-Xi Lim
Yu-Xi Lim wrote: > >>> b = 189028499 > >>> ','.join([str(b)[::-1][x:x+3] for x in range(len(str(b)))[::3]])[::-1] > > '-,189,028,499' Oops, mis-paste >>> b = -189028499 >>> ','.join([str(b)[::-1][x:x+3] for x in range(len(str(b)))[::3]])[::-1] -- http://mail.python.org/mailman/listinfo/pyt

Re: Initializing the number of slots in a dictionary

2006-08-07 Thread Fuzzyman
Jon Smirl wrote: > On Sun, 06 Aug 2006 15:33:30 -0700, John Machin wrote: [snip..] > > > > Do you have an application with a performance problem? If so, what makes > > you think inserting 1M items into a Python dict is contributing to the > > problem? > > I know in advance how many items will be a

Re: Installing a Windows Printer

2006-08-07 Thread Jon
Hi D, I would suggest that you look here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_7mgj.asp at AddPort and and AddPrinter. Though I have not tried to use them in python, I would assume that using win32com [http://www.python.net/crew/mhammond/win32/Downloads.html

ST_CTIME convert to yyyymmdd

2006-08-07 Thread Hitesh
Hi, Any hint on converting time from ST_CTIME secs into mmdd format? sorry for one-liner stupid question.. I couldn;t find (or rather figure out) in docs. Thank you, hj -- http://mail.python.org/mailman/listinfo/python-list

Re: ST_CTIME convert to yyyymmdd

2006-08-07 Thread Hitesh
All right I got it. Thank you anyway... create_date = os.stat(pathname)[ST_CTIME] print time.strftime("%Y%m%d", time.gmtime(create_date)) Hitesh wrote: > Hi, > > Any hint on converting time from ST_CTIME secs into mmdd format? > sorry for one-liner stupid question.. I couldn;t find (or rathe

Re: where can I find Python acceptance test suite?

2006-08-07 Thread The Eternal Squire
Thanks. Terry Reedy wrote: > "The Eternal Squire" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I've been doing some hacking of the Python engine, and I've been > > looking for > > where the comprehensive regression tests are kept so that I can > > determine > > where I've brok

Re: How to get hours and minutes from 'datetime.timedelta' object?

2006-08-07 Thread John Machin
Ant wrote: > John Machin wrote: > ... > > 1. If that's what he wanted, it was a very peculiar way of asking. Do > > you suspect that he needs to be shown how to conver 877.7... minutes > > into hours, minutes and seconds??? > > Chill dude, It wasn't an attack :-) I didn't think it was. > > The d

distutils setup.py

2006-08-07 Thread Saketh
I'm having trouble getting the data_files argument of my setup.py to work with "python setup.py sdist" under Windows XP. Here is the data_files argument that I pass to setup(). data_files = [\ ('res','app.ico'), ('', 'preferences.xml'), ('res', glob.glob

Re: format a number for output

2006-08-07 Thread Paul Rubin
"abcd" <[EMAIL PROTECTED]> writes: > 1890284 > > would be: > > 1,890,284 "To iterate is human; to recurse, divine": def commafy(n): if n < 0: return '-' + commafy(-n) if n >= 1000: return '%s,%03d' % (commafy(n//1000), n % 1000) return '%s'% n I don't like the locale s

Getting previous file name

2006-08-07 Thread Hitesh
Hi, I have a small script here that goes to inside dir and sorts the file by create date. I can return the create date but I don't know how to find the name of that file... I need file that is not latest but was created before the last file. Any hints... I am newbiw python dude and still trying t

Re: Getting previous file name

2006-08-07 Thread Larry Bates
Hitesh wrote: > Hi, > > I have a small script here that goes to inside dir and sorts the file > by create date. I can return the create date but I don't know how to > find the name of that file... > I need file that is not latest but was created before the last file. > Any hints... I am newbiw pyt

Re: format a number for output

2006-08-07 Thread BartlebyScrivener
Paul Rubin wrote: > "To iterate is human; to recurse, divine": > > def commafy(n): >if n < 0: return '-' + commafy(-n) >if n >= 1000: return '%s,%03d' % (commafy(n//1000), n % 1000) >return '%s'% n > > I don't like the locale solution because of how messy locales are.

Re: Design Patterns in Python

2006-08-07 Thread Gabriel Genellina
At Saturday 5/8/2006 22:22, Alex Martelli wrote: > But does anyone know of a complete discussion/analysis of patterns in > Python? Books, articles, web pages... Thanks to all of you for your pointers on this subject! Gabriel Genellina Softlab SRL _

Re: Python Projects Continuous Integration

2006-08-07 Thread Fuzzyman
Dave Potts wrote: > Hi, > > I'm just starting a development project in Python having spent time in > the Java world. I was wondering what tool advice you could give me > about setting up a continuous integration environment for the python > code: get the latest source, run all the tests, package

do people really complain about significant whitespace?

2006-08-07 Thread infidel
Where are they-who-hate-us-for-our-whitespace? Are "they" really that stupid/petty? Are "they" really out there at all? "They" almost sound like a mythical caste of tasteless heathens that "we" have invented. It just sounds like so much trivial nitpickery that it's hard to believe it's as common

Re: Getting previous file name

2006-08-07 Thread Tim Williams
On 7 Aug 2006 13:52:16 -0700, Hitesh <[EMAIL PROTECTED]> wrote: > > I have a small script here that goes to inside dir and sorts the file > by create date. I can return the create date but I don't know how to > find the name of that file... > I need file that is not latest but was created before th

Re: Python Projects Continuous Integration

2006-08-07 Thread Grig Gheorghiu
Ziga Seilnacht wrote: > Dave Potts wrote: > > Hi, > > > > I'm just starting a development project in Python having spent time in > > the Java world. I was wondering what tool advice you could give me > > about setting up a continuous integration environment for the python > > code: get the latest

Re: Getting previous file name

2006-08-07 Thread John Machin
Hitesh wrote: > Hi, > > I have a small script here that goes to inside dir and sorts the file > by create date. I can return the create date but I don't know how to > find the name of that file... > I need file that is not latest but was created before the last file. > Any hints... I am newbiw pyth

Re: do people really complain about significant whitespace?

2006-08-07 Thread Jason
infidel wrote: > Where are they-who-hate-us-for-our-whitespace? Are "they" really that > stupid/petty? Are "they" really out there at all? "They" almost sound > like a mythical caste of tasteless heathens that "we" have invented. > It just sounds like so much trivial nitpickery that it's hard to

Re: do people really complain about significant whitespace?

2006-08-07 Thread crystalattice
infidel wrote: > Where are they-who-hate-us-for-our-whitespace? Are "they" really that > stupid/petty? Are "they" really out there at all? "They" almost sound > like a mythical caste of tasteless heathens that "we" have invented. > It just sounds like so much trivial nitpickery that it's hard to

Class attributes, instances and metaclass __getattribute__

2006-08-07 Thread Pedro Werneck
Hi all I noticed something strange here while explaining decorators to someone. Not any real use code, but I think it's worth mentioning. When I access a class attribute, on a class with a custom metaclass with a __getattribute__ method, the method is used when acessing some attribute directly

Re: do people really complain about significant whitespace?

2006-08-07 Thread John Machin
infidel wrote: > Where are they-who-hate-us-for-our-whitespace? Are "they" really that > stupid/petty? Are "they" really out there at all? "They" almost sound > like a mythical caste of tasteless heathens that "we" have invented. All societies demonise outsiders to some extent. It's an unfortu

Re: do people really complain about significant whitespace?

2006-08-07 Thread bearophileHUGS
Jason wrote: > He points out that if some code gets accidentally dedented, it is > difficult for another programmer to determine which lines were supposed > to be in the indented block. I pointed out that if someone > accidentally moves a curly brace, the same problem can occur. I like significan

Re: A problem from a Vim user

2006-08-07 Thread Luis Armendariz
manuhack wrote: > When I use raw_input('Please type something.\n') in the python 2.4 > command line windows, it doesn't have any problem. However, when I run > the same command in vim 7 as :py raw_input('Please type something.\n'), > there is an EOFError: EOF when reading a line. Is there a way t

Re: Subtyping a non-builtin type in C/C++

2006-08-07 Thread johan2sson
Martin v. Löwis wrote: > [EMAIL PROTECTED] schrieb: > > I am trying to create a subclass of a python class, defined in python, > > in C++, but I am having some problems. > > Is the base class a classic class or a new-style class? Depending on > the answer, the code you should write varies significa

singleton decorator

2006-08-07 Thread Andre Meyer
While looking for an elegant implementation of the singleton design pattern I came across the decorator as described in PEP318.Unfortunately, the following does not work, because decorators only work on functions or methods, but not on classes. def singleton(cls):instances = {}def getinstan

Re: singleton decorator

2006-08-07 Thread Farshid Lashkari
Andre Meyer wrote: > Am I missing something here? What is the preferred pythonic way of > implementing singleton elegantly? The "Open Issues" section of that PEP says the following: "It's exceedingly unlikely that class decorators will be in Python 2.4" So it might not be in the current version

Re: do people really complain about significant whitespace?

2006-08-07 Thread Ben Finney
"infidel" <[EMAIL PROTECTED]> writes: > It just sounds like so much trivial nitpickery that it's hard to > believe it's as common as we've come to believe. As others have pointed out, these people really do exist, and they each believe their preconception -- that significant whitespace is intrins

Re: do people really complain about significant whitespace?

2006-08-07 Thread Jason
[EMAIL PROTECTED] wrote: > Jason wrote: > > He points out that if some code gets accidentally dedented, it is > > difficult for another programmer to determine which lines were supposed > > to be in the indented block. I pointed out that if someone > > accidentally moves a curly brace, the same pr

Re: singleton decorator

2006-08-07 Thread bearophileHUGS
Andre Meyer: > What is the preferred pythonic way of implementing singleton elegantly? Maybe to just use a module. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

python - HTML processing - need tips

2006-08-07 Thread wipit
I need to process a HTML form in python. I'm using urllib2 and HTMLParser to handle the html. There are several steps I need to take to get to the specific page on the relevant site the first of which is to log in with a username/password. The html code that processes the login consists of 2 edit b

Re: do people really complain about significant whitespace?

2006-08-07 Thread bearophileHUGS
Jason wrote: > But newsgroup managers are certainly an issue. > For comment thingies online, the preformat tag is your friend, too. Time ago I used to add a | or something similar at the beginning of lines, to avoid the leading whitespace stripping done by Google Groups. Other (silly) solutions ar

  1   2   >