Re: Problem using cx_Freeze > auto-py-to-exe

2022-08-18 Thread David at Booomer
From: Dennis Lee Bieber > > On Wed, 17 Aug 2022 12:09:14 -0600, David at Booomer > declaimed the following: > >> executables=[ >> Executable( >> >> "prjui.py","Maiui.py","about.py","dict.py

Re: Problem using cx_Freeze

2022-08-17 Thread David at Booomer
mention of adding self which is in these lines already. Previously I had search for __init__() which returned no lines due to the closing ). I had visited the page you provided (https://cx-freeze.readthedocs.io/en/latest/setup_script.html#cx-freeze-executable) but didn’t noticed the 11 plus self as 12

Re: Problem using cx_Freeze

2022-08-15 Thread David at Booomer
has self. Thanks, David > On Aug 15, 2022, at 5:51 PM, Jim Schwartz wrote: > > This link covers how to use BDist_dmg. > > https://cx-freeze.readthedocs.io/en/latest/setup_script.html > > Sent from my iPhone > >> On Aug 15, 2022, at 12:11 PM, David at Booomer

Problem using cx_Freeze

2022-08-15 Thread David at Booomer
I’m trying to use cx_Freeze (https://pypi.org/project/cx-Freeze/) in a python app but running into an error message: AttributeError: module 'cx_Freeze' has no attribute ‘BdistDMG’ I’m using Anaconda and error appears with the import command: from cx_Freeze import * From the terminal the comma

Jython but portable?

2020-07-19 Thread vjp2 . at
How do you use Jython Standalone Jar? Do you have to "Intall"? I usually use most standalone jars directly without intalling. And I want to use this thing in Portable Apps, so I din't want to install anything. Because it might end up in my Windows system and I won't kn

Query regarding python 2.7.11 release

2016-04-14 Thread Gaurav Rastogi -X (garastog - ARICENT TECHNOLOGIES MAURIITIUS LIMITED at Cisco)
Hi, We are currently using Python 2.6.7 in our product. We have received below vulnerabilities from field: CVE-2014-7185 Integer overflow in bufferobject.c in Python before 2.7.8 allows context-dependent attackers to obtain sensitive information from process memory via a large size and offset i

Re: Jython standalone

2015-11-14 Thread vjp2 . at
Jython is python in java at jython.org. I tried clicking and double clicking. I does a wait cycle (rotating arrow) then returns to attention. I'm trying to run RDKIT, an app written for jython. THen I realised jython wasn't working at all. I've had same problem with some jav

Jython standalone

2015-11-13 Thread vjp2 . at
I click jython.org standalone jar and it just does a wait cycle. What does it need to give me a prompt? - = - Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist http://www.panix.com/~vjp2/vasos.htm ---{Nothing her

Re: Jython from bathc file?

2015-05-09 Thread vjp2 . at
I have to try this and see if there is ome kind of init file in jython/python sorta like autoexec.bat. Ialso have no idea if the commands they provide are all it takes to run the app or I have to stay in jython.. sorry, I'm thinking at loud.. ok, thanks t

Re: Jython from bathc file?

2015-05-09 Thread vjp2 . at
Tee from gnuutils?? - = - Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist http://www.panix.com/~vjp2/vasos.htm ---{Nothing herein constitutes advice. Everything fully disclaimed.}--- [Homeland Security mean

Re: Jython from bathc file?

2015-05-09 Thread vjp2 . at
Thanks.. I suspected it wasn't meant to be taken as in the file THe one thing I'm not sure if Jython is suppsosedto keep running after the initisl stuff is loaded in.. To put the question in purely DOS terms if you run a program can you pipe it some commands and then keep it running to take the

Jython from bathc file?

2015-05-08 Thread vjp2 . at
How do I do this in a .bat file? Do I include the Jython or pipe it? % CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar; jython -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper Jython 2.2.1 on java1.6.0_20 Type "copyright", "credits" or "license" for more information.

Re: Packaging a proprietary Python library for multiple OSs

2013-12-05 Thread mherrmann . at
tem, I think I'll have a hard time getting at this person. If I even manage to find out where the person is at all. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pattern-match & Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 18:16:18 UTC+5, Peter Otten wrote: > AT wrote: > > > > > I am new to python and web2py framework. Need urgent help to match a > > > pattern in an string and replace the matched text. > > > > > > I've this

Re: Pattern-match & Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 16:27:19 UTC+5, Thomas Bach wrote: > On Wed, Dec 19, 2012 at 02:42:26AM -0800, AT wrote: > > > Hi, > > > > > > I am new to python and web2py framework. Need urgent help to match a > > > pattern in an string and replace th

Re: Pattern-match & Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 15:51:22 UTC+5, Steven D'Aprano wrote: > On Wed, 19 Dec 2012 02:42:26 -0800, AT wrote: > > > > > Hi, > > > > > > I am new to python and web2py framework. Need urgent help to match a > > > pattern in an string

Pattern-match & Replace - help required

2012-12-19 Thread AT
Hi, I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. I've this string (basically an sql statement): stmnt = 'SELECT taxpayer.id, taxpayer.enc_name, taxpayer.age, taxpayer.occupation FROM

Re: 10 sec poll - please reply!

2012-11-20 Thread mherrmann . at
That's a very good suggestion Emile!! So I might eventually need both 'press' and 'release' (or press_key/release_key). Thanks for this! To everyone else who has been so kind to reply thus far: What do you think of generate_keystrokes? It's a bit long but describes exactly what the function wou

Decorator behavior

2011-07-22 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I am just trying to wrap my head around decorators in Python, and I'm confused about some behavior I'm seeing. Run the code below (slightly adapted from a Bruce Eckel article), and I get the following output: inside myDecorator.__init__() inside aFunction() Finished decorating aFunction() inside

returning all matching groups with re.search()

2011-02-03 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
Here's a scenario: import re m = re.search('e','fredbarneybettywilma') Now, here's a stupid question: why doesn't m.groups() return ('e','e','e'). I'm trying to figure out how to match ALL of the instances of a pattern in one call - the group() and groups() return subgroups... how do I get my se

Re: Question to logging

2009-12-16 Thread Vinay Sajip at Red Dove
On 16/12/2009 12:49, stefan.messerl...@postfinance.ch wrote: > I have the following error and no clue, how to solve that. Up to python > version 2.5 the following script worked without an error, but since python > 2.6. I get the following error: > > #!/usr/bin/env python > # -*- coding: ISO-8859-

Fwd: Re: Logging question

2009-12-16 Thread Vinay Sajip at Red Dove
Original Message Subject:Re: Logging question Date: Tue, 15 Dec 2009 18:28:54 + From: Vinay Sajip at Red Dove To: Yaroslav Molochko On 15/12/2009 14:29, Yaroslav Molochko wrote: > Hello Vinay Sajip, > > my name is Yaroslav, I'm tryi

Appending to sys.path

2009-03-24 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I have an application where I would like to append to the python path dynamically. Below is a test script I wrote. Here's what I thought would happen: 1) I run this script in a folder that is NOT already in PYTHONPATH 2) The script creates a subfolder called foo. 3) The script creates a file cal

Re: Ban Xah Lee

2009-03-09 Thread Dirk Bruere at NeoPax
Kenneth Tilton wrote: Dirk Bruere at NeoPax wrote: Larry Gates wrote: On Sun, 08 Mar 2009 04:09:52 +, Dirk Bruere at NeoPax wrote: Dirk Bruere at NeoPax wrote: Well, don't worry - nobody is going to ban you from Usenet (except possibly the Chinese govt). OTOH, nobody here much

Re: Ban Xah Lee

2009-03-09 Thread Dirk Bruere at NeoPax
Larry Gates wrote: On Sun, 08 Mar 2009 04:09:52 +, Dirk Bruere at NeoPax wrote: Dirk Bruere at NeoPax wrote: Well, don't worry - nobody is going to ban you from Usenet (except possibly the Chinese govt). OTOH, nobody here much cares. So, rant on - it's what Usenet is for. ☄

Re: Ban Xah Lee

2009-03-07 Thread Dirk Bruere at NeoPax
Dirk Bruere at NeoPax wrote: Xah Lee wrote: Of interest: • Why Can't You Be Normal? http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html • Ban Xah Lee http://xahlee.org/Netiquette_dir/ban_Xah_Lee.html I consider this post relevant because i've been perennially gossipe

Re: Ban Xah Lee

2009-03-07 Thread Dirk Bruere at NeoPax
t on fighting, the reason they cited to ban me was spreading propaganda. For some account of this incident, see bottom of: Why Can't You Be Normal?. The fighting and discussion can be seen on my talk page, at: User talk:P0lyglut. The writing where i defended my edit, that got removed from my

Re: curses.setsyx()?

2008-09-23 Thread brad . at . school
a call to doupdate to force those changes to take effect > >> > visually. > >> > -- > >> > Tim Roberts, [EMAIL PROTECTED] > >> > Providenza & Boekelheide, Inc. > > >> I added it and it still doesn't work. This is what I'm doing wh

Re: Python Written in C?

2008-07-21 Thread bojannastic at googlemail
On Jul 20, 6:50 pm, [EMAIL PROTECTED] wrote: > So I was suspecting the Python compiler or interpreter is written in a > REAL language like C#. So, Wiki says it's written in C! It's almost as > if it were an intentional trick...write your own, new language in an > OLD, real world language that is pa

Re: Why Turn "Print" into "Print()"????

2008-05-25 Thread Prisoner at War
On May 25, 8:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > See http://www.python.org/dev/peps/pep-3105/ > That should answer all your questions. Hey, thanks, I missed that one! Not that I understand the rationale given (iman00b), but oh well, so it looks like a real function now.

Why Turn "Print" into "Print()"????

2008-05-25 Thread Prisoner at War
Hi, your friendly neighborhood n00b here, just wondering why on earth the Py3K folks want to mess with a simple thing like the "print" "command" (is that what it's called, a command?), turning it into "print()"...I mean, what's the point, exactly?? To look like a more "traditional" computer-langu

Re: Problems building zlib module on RHEL

2008-03-18 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Mar 18, 8:42 am, "mhearne808[insert-at-sign-here]gmail[insert-dot- here]com" <[EMAIL PROTECTED]> wrote: > I can't seem to get the zlib module to build on an RHEL box. > > I did the following: > 1) Download zlib 1.2.3 > 2) configure;make;make install >

Problems building zlib module on RHEL

2008-03-18 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I can't seem to get the zlib module to build on an RHEL box. I did the following: 1) Download zlib 1.2.3 2) configure;make;make install 3) Download python 2.5.2 4) configure;make;make install 5) >>> import zlib => "ImportError: No module named zlib" In the make install step for python, I notice t

Re: help please, splitter windows like in maya or 3ds max

2008-03-13 Thread John at Quintivity
Sounds like this might do exactly what you need... http://xoomer.alice.it/infinity77/main/FourWaySplitter.html Cheers, John On Thu, Mar 13, 2008 at 1:45 AM, moonrie <[EMAIL PROTECTED]> wrote: > On Mar 13, 12:47 pm, "Andrew Rekdal" <@comcast.net> wrote: > > T

Re: compiling python 2.5, missing zlib

2007-11-21 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Nov 19, 8:22 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Those headers are already installed, according to "up2date". Is there > > a way to specify the header files used? > > It will automatically use them if they are good. What's the value of > ZLIB_VERSION in /usr/include/zlib.h? > >

Re: compiling python 2.5, missing zlib

2007-11-19 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Nov 19, 2:19 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Neither seems to work. What am I missing here? > > You forgot to install the zlib header files, which come in > an RPM provided by Redhat (probably called zlib-dev or some > such). > > Regards, > Martin Those headers are already

compiling python 2.5, missing zlib

2007-11-19 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm trying to compile Python 2.5 on a RHEL system, using "./ configure;make;make install". The build seems to go alright, but the zlib module is missing. I've tried the following: 1) Download and build the zlib libraries myself 2) Specify '--without-system-zlib' to ./configure Neither seems to w

Getting file timestamp from url

2007-11-16 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
Is is possible to get the timestamp of a file on a web server if it has a URL? For example, let's say that I want to know when the following file was created: http://www.w3schools.com/xml/note.xml I can get an HTTPMessage object using urllib2, like this:

Creating installer with external extension modules

2007-11-09 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm creating a piece of software which will be used by in-house users. My code will all be written in pure Python; however, it depends heavily on a number of third-party Python modules, many of which have C/C++ dependencies (numpy, scipy, etc.) Installing these packages on my machine involved a m

Re: PYTHONPATH on OS X

2007-10-11 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Oct 10, 4:59 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Oct 11, 8:00 am, "mhearne808[insert-at-sign-here]gmail[insert-dot- > > > > here]com" <[EMAIL PROTECTED]> wrote: > > I'm missing something major here. I'm trying to add a

PYTHONPATH on OS X

2007-10-10 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm missing something major here. I'm trying to add a directory to my python path using the PYTHONPATH environment variable, and it's being ignored by the Python interactive shell. Below is a capture of what I did. Note that my newfolder appears nowhere on the list of directories in sys.path. H

Don't understand module search path...

2007-10-04 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I think I don't understand how the module search path works... Let's say I have a folders called 'test'. Underneath it, I create two more folders called 'foo' and 'bar'. In 'foo', I create an empty '__init__.py' file, indicating that this folder is a package 'foo'. I then create a simple python

Re: fcntl problems

2007-08-31 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
gt; f = open('foo', 'w+') > try: >fcntl.flock(f.fileno(),fcntl.LOCK_EX |fcntl.LOCK_NB) > except IOError, e: > if e.args[0] == 35: > sys.exit(1) > else: > raise > f.seek(0, 2) # seek to end > # do your thing with the file > f.fl

Re: fcntl problems

2007-08-31 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
rocess. > > > According to my Python Cookbook: > > "Exclusive lock: This denies all _other_ processes both read and write > > access to the file." > > This is only for mandatory locking; POSIX flock is advisory locking, > which states: "Only one process m

Re: fcntl problems

2007-08-30 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Aug 30, 4:19 pm, "mhearne808[insert-at-sign-here]gmail[insert-dot- here]com" <[EMAIL PROTECTED]> wrote: > I'm having a number of problems with the fcntl module. First off, my > system info: > > Mac OS X > Darwin igskcicglthearn.cr.usgs.gov 8.10.1 Darwin Ke

fcntl problems

2007-08-30 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm having a number of problems with the fcntl module. First off, my system info: Mac OS X Darwin igskcicglthearn.cr.usgs.gov 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386 Python 2.5.1 (built from source) OK, the weirdness: First o

Re: accessing parts of large files with File.seek()

2007-08-08 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Aug 8, 7:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 8, 11:46 am, "mhearne808[insert-at-sign-here]gmail[insert-dot- > > > > here]com" <[EMAIL PROTECTED]> wrote: > > I'm having a problem with the File object'

accessing parts of large files with File.seek()

2007-08-08 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm having a problem with the File object's seek() method. Specifically, I cannot use it to seek to a location in a binary file that is greater than 2^31 (2147483648). This seems unnecessarily limiting, as it is common these days to have files larger than 2 GB. Is there some LargeFile object out

Re: Matching Strings

2007-02-09 Thread rshepard-at-appl-ecosys . com
On 2007-02-10, James Stroud <[EMAIL PROTECTED]> wrote: > Assuming item is "(u'ground water',)" > > import re > item = re.compile(r"\(u'([^']*)',\)").search(item).group(1) James, I solved the problem when some experimentation reminded me that 'item' is a list index and not a string variable. by

Re: Matching Strings

2007-02-09 Thread rshepard-at-appl-ecosys . com
On 2007-02-10, [EMAIL PROTECTED] wrote: > if item == selName: Slicing doesn't seem to do anything -- if I've done it correctly. I changed the above to read, if item[2:-2] == selName: but the output's the same. Rich -- http://mail.python.org/mailman/listinfo/python-list

Python Guru needed in San Jose!

2007-01-02 Thread Brent Rogers -X (breroger - Spherion at Cisco)
Start the New Year off with a new Python job! Cisco Systems (San Jose, CA) Posted 16-Nov-2006 Technical Leader I (759661) Description We are looking for a Software Development Engineer who will work in development of a new Cisco product. Architect and develop high per

Re: Conditional iteration

2006-12-14 Thread at
I am not claiming that it was THE motivation, but it solves my problem... Carl Banks wrote: > > at wrote: >> By the way, >> >> I think by approving >> >> a = b if condition else c >> >> used to avloind >> >> if condition: >>

Re: Conditional iteration

2006-12-14 Thread at
consuming too much additional resources. Kind regards, Arjan Duncan Booth wrote: > at <[EMAIL PROTECTED]> wrote: > >> By the way, >> >> I think by approving >> >> a = b if condition else c >> >> used to avloind >> >> if condition

Re: Conditional iteration

2006-12-14 Thread at
Dear Diez, True, I was just mentioning a workaround for a typical case. Kind regards, Arjan Diez B. Roggisch wrote: >> Is it redundant according to your criteria, yes I would say: >> >> a = {True: a, False: c}[condition] >> >> or >> >> a = [c, a][condition] >> >> would yield exactly the sa

Re: Conditional iteration

2006-12-14 Thread at
Hi Paul, I appreciate your explanation! Thanx @ Paul Rubin wrote: > at <[EMAIL PROTECTED]> writes: >> > for x in (x for x in [-2, -1, 0, 1, 2, 3, 4] if x > 0): >> >... more code ... > >> Do you know if this generates a new list internally

Re: Conditional iteration

2006-12-14 Thread at
}[condition] or a = [c, a][condition] would yield exactly the same even in one sentence Cheers, @ at wrote: > My comments below. > > Kind regards, > @ > > > Carl Banks wrote: > >> at wrote: >>> Well, all I can say that for me as a user it wo

Re: Conditional iteration

2006-12-13 Thread at
xt thing I think is 'hm, not all of the list' and even worse should I worry if more restrictions can be found when I read further... All the best, @ greg wrote: > at wrote: > >> It is not the addional line containing 'if x > 0:' that bothers me, but >>

Re: Conditional iteration

2006-12-13 Thread at
Thanx Paul! Do you know if this generates a new list internally (memory consumption?) @ Paul Rubin wrote: > at <[EMAIL PROTECTED]> writes: >> You proposal, seems nice to me but it doesn't work with Python 2.4.3, >> should it work with 2.5? >> >> Again I

Re: Conditional iteration

2006-12-13 Thread at
My comments below. Kind regards, @ Carl Banks wrote: > at wrote: >> Well, all I can say that for me as a user it would make sense... > > Which is, like, step one out of a hundred for getting a syntax change > into the language. > >> Curiosity: in what sense is it

Re: Conditional iteration

2006-12-13 Thread at
alternatives that don't do that. Does Guido ever change his mind? Cheers, @ Carl Banks wrote: > at wrote: >> I am not looking for a work around but more interest if other people >> might judge this syntax would come in handy? > > Of course people have expressed interest in

Re: Conditional iteration

2006-12-13 Thread at
The proposed solution impairs readability because there's a "surprise" > at the end. List comprehensions already open the language up to > readability abuse. Lets not add more. > > To avoid the unwanted indentation, I would go with the already > suggested "if not x&g

Re: Iterating over several lists at once

2006-12-13 Thread at
for" loop. > > Thanks for replying me. > > > On Dec 13, 3:58 pm, Roberto Bonvallet <[EMAIL PROTECTED]> > wrote: >> Gal Diskin wrote: >> > Hi, >> > I am writing a code that needs to iterate over 3 lists at the same >> >

Re: Conditional iteration

2006-12-13 Thread at
ep. Unless of course nobody appreciates it. That's the discussion I'd like to have here in the forum. All the best @ Roberto Bonvallet wrote: > at wrote: >> More pythonic in view would be: >> >> for x in [-2, -1, 0, 1, 2, 3, 4] if x > 0: >>...

Re: Conditional iteration

2006-12-13 Thread at
x in some_list if some_condition: --- etc... I am not looking for a work around but more interest if other people might judge this syntax would come in handy? Interested in any feedback! Kind regards, @ Paul Rubin wrote: > at <[EMAIL PROTECTED]> writes: >> I

Conditional iteration

2006-12-13 Thread at
I would like to spark the discussion about the following syntax problem I encounter. THE PROBLEM I have a lot times the following code: for x in [-2, -1, 0, 1, 2, 3, 4]: if x > 0: ... more code... It is not the addional line containing 'if x > 0:' that bothers me, but

Re: Difference between two dates in seconds

2006-09-27 Thread Claes at work
On 9/27/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Claes at work wrote: > > why would you have to do that yourself? why not let Python do it for > you? here's the code: > > seconds = td.days * 86400 + td.seconds > Thanks, but that is exactly what I mea

Difference between two dates in seconds

2006-09-27 Thread Claes at work
Hi, I am learning Python and want to perform what I think is a very simple task: calculating the difference between two dates in seconds. Reading through the documentation I am puzzled: I can't find a way to do this without doing manually what I think belongs to a standard library method. Please

Re: Python is fun (useless social thread) ;-)

2006-06-20 Thread bruno at modulix
Max M wrote: > bruno at modulix wrote: > >> Max M wrote: >> >>> bruno at modulix wrote: >>> >>>>> Or did you just like what you saw and decided to learn it for fun? >>>> >>>> >>>> Well, I haven't be real

Re: Python is fun (useless social thread) ;-)

2006-06-20 Thread bruno at modulix
Max M wrote: > bruno at modulix wrote: > >>> Or did you just like what you saw and decided to learn it for fun? >> >> >> Well, I haven't be really impressed the first time - note that it was at >> the very end of the last century, with v1.5.2. &g

Re: Calling every method of an object from __init__

2006-06-20 Thread bruno at modulix
Tim Chase wrote: (snip) class Foo(object): > ... def __init__(self): > ... for method in dir(self): > ... if method == method.strip("_"): if not method.startswith('_'): -- bruno desthuilliers python -c "print '@'.join(['.'.join([

Re: Specifing arguments type for a function

2006-06-20 Thread bruno at modulix
K.S.Sreeram wrote: > bruno at modulix wrote: > >> if type(arg) is type([]): > > > Just a tiny nitpick > You can just use 'list' instead of 'type([])' I know. Note that I wrote "*A* right way to write this", not "*The* right way

Re: Specifing arguments type for a function

2006-06-20 Thread bruno at modulix
an iterable - and the exception >> will >> come from arg not being iterable. >> >> But what you can't do is make python complain about this: >> >> def f(arg): >> for e in arg: >> print e >> >> >> f(100) >> &

Re: [OT] code is data

2006-06-20 Thread bruno at modulix
Diez B. Roggisch wrote: > bruno at modulix wrote: > > >>Diez B. Roggisch wrote: >> >>>>>because lots of people know how to describe XML transformations, and >>>>>there are plenty of tools that implement such transformations >>>>>e

Re: [OT] code is data

2006-06-20 Thread bruno at modulix
Diez B. Roggisch wrote: >>> because lots of people know how to describe XML transformations, and >>> there are plenty of tools that implement such transformations >>> efficiently ? >> >> >> Efficiently enough for dynamic (runtime) use ? > > > Using XML-transformation for AST manipulation isn't my

Re: Function definition

2006-06-20 Thread bruno at modulix
faulkner wrote: (pelase don't top-post - fixed) > aarondesk wrote: > (snip) >>Now I've tried putting the function declaration after the call but the >>program wouldn't work. Is there anyway to put function declarations at >>the end of the program, ra

Re: [OT] code is data

2006-06-19 Thread bruno at modulix
Fredrik Lundh wrote: > Laurent Pointal wrote: >> Bruno Desthuilliers wrote: >>> Anton Vredegoor wrote: The idea is to have a way to transform a Python (.py) module into XML and then do source code manipulations in XML-space using ElementTree. > >>> > >>> My my my... I'm not against th

Re: Formatted string to object

2006-06-19 Thread bruno at modulix
janama wrote: > Hi, > > can such a thing be done somehow? > > > aaa = self.aaa > bbb = %s.%s % ('parent', 'bbb') Given the first line, I assume this is inside a method body, and parent is a local var. Then the answer is: bbb = getattr(locals()['parent'], 'bbb') read the doc for these two func

Re: Formatted string to object

2006-06-19 Thread bruno at modulix
Tim Chase wrote: >> Can you use strings or %s strings like in the above or >> >> aaa = 'string' >> aaa.%s() % 'upper' >> >> Somehow? > > > Looks like you want to play with the eval() function. > aaa = 'hello' result = eval("aaa.%s()" % 'upper') result > 'HELLO' Using eval() or ex

Re: [OT] code is data

2006-06-19 Thread bruno at modulix
Anton Vredegoor wrote: > bruno at modulix wrote: > >> I still don't get the point. > > > Well, I've got to be careful here, lest I'd be associated with the > terr.., eh, the childp..., eh the macro-enablers. > > The idea is to have a way to transf

Re: Just out of curiosity: Which languages are they using at Google and what for?

2006-06-19 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > I know Google are using Python for testing purposes. Not only: """ Where is Python used? * The Google build system is written in python. All of Google's corporate code is checked into a repository and the dependency and building of this code is managed by python.

Re: Check if a file is closed

2006-06-19 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > How to check if a file is closed? >>> f = open('trashme.txt', 'w') >>> f >>> dir(f) ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__iter__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'close', '

Re: code is data

2006-06-19 Thread bruno at modulix
Ravi Teja wrote: (snip) > Annoted variables, symbols and code > layout visually cue more efficiently to the object nature than do > explicit text definitions. Of course, this is only sensible when there > aren't too many of any of those. In that case, the cognitive cost of > notation outweighs the

Re: code is data

2006-06-19 Thread bruno at modulix
Ravi Teja wrote: > BJörn Lindqvist wrote: > >>>Personally, I would like to see macros in Python (actually Logix >>>succeeding is good enough). But I am no language designer and the >>>community has no interest in it. When I absolutely need macros, I will >>>go elsewhere. >> >>One must wonder, when

Re: code is data

2006-06-19 Thread bruno at modulix
BJörn Lindqvist wrote: >> Personally, I would like to see macros in Python (actually Logix >> succeeding is good enough). But I am no language designer and the >> community has no interest in it. When I absolutely need macros, I will >> go elsewhere. > > > One must wonder, when is that? When do y

Re: [OT] code is data

2006-06-19 Thread bruno at modulix
for a long time already, and metatypes and > generators are having some strange unexplored possibilities too, but the > day will come soon (and at last when PyPy is reaching execution speeds > close to cPython) where Python will be able to swallow smaller > languages, and finally it will b

Re: any subway web dev experiences

2006-06-19 Thread bruno at modulix
a wrote: > subway is pythons ruby on rails competitor Nope - it's a Python MVC web framework. Like Django, Pylons and Turborgears. And FWIW, there have been recently some discussions about merging Subway and Turbogears. > pls tell me if u hav any expereinces Please take time to learn and write r

Re: Python is fun (useless social thread) ;-)

2006-06-17 Thread bruno at modulix
impressed the first time - note that it was at the very end of the last century, with v1.5.2. But still I found the language suprisingly simple to get up and running with - seemed like the language was almost always reading my mind about how I would have named a librairy, function or whatever !-) S

Re: Legitimate use of the "is" comparison operator?

2006-06-17 Thread bruno at modulix
isinstance(obj, klass) instead - and yet better, don't check type at all if you can avoid it. > and I was just wondering whether or not > it is considered bad practice in the Python Community to use it for > numerics as well. It's even worse than a bad practice : it's an er

Re: any subway experiences

2006-06-17 Thread bruno at modulix
a wrote: > thanks for reading > Too long experience with Paris (France) subway... Left Paris, feel better now !-) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/pyt

Re: Python is fun (useless social thread) ;-)

2006-06-16 Thread bruno at modulix
BartlebyScrivener wrote: (snip) > I am not touching OO, classes, You may not be aware of this, but as soon as you're programming in Python, you *are* using OO. Strings are objects, dicts are objects, tuples are objects, lists are objects, numbers are objects, and even functions and modules are ob

Re: Python is fun (useless social thread) ;-)

2006-06-16 Thread bruno at modulix
Scott David Daniels wrote: > BartlebyScrivener wrote: > >> I am not touching OO, classes, or GUIs until I understand >> EVERYTHING else. Could take a few years. ;) > > > You know how modules separate globals, right? That is, what you > write in one module doesn't affect the names in anothe

Re: Python is fun (useless social thread) ;-)

2006-06-16 Thread bruno at modulix
BartlebyScrivener wrote: >>>I'd like something a bit like a module, >>>but I'd like to make several of them, >>>and not have them interfere with each other." > > > Thank you. I sense what you are saying, but at this point I'd be > thin

Re: Python is fun (useless social thread) ;-)

2006-06-16 Thread bruno at modulix
BartlebyScrivener wrote: (snip) > Also, it seems to be a minimalist > language. *seems* minimalist, but is really not - have a look at the object model (metaclasses, descriptors etc), at closures and HOFs and decorators, at list-comp and generators and (coming in 2.5) coroutines... Defini

Re: a good programming text editor (not IDE)

2006-06-16 Thread bruno at modulix
BartlebyScrivener wrote: >>>Most IDEs are rather weak as text editors compared to emacsen. > > > That's true, but even emacs and xemacs don't offer simple automatic > word wrap (i.e. wrap a line without splitting words or putting an eol > or hard carriage r

Re: a good programming text editor (not IDE)

2006-06-16 Thread bruno at modulix
BartlebyScrivener wrote: > Emacs must be dying if this thread could get all the way to 20 with > nobody arguing with the vi folks. No need to argue. I started with vim, and finally switched to emacs less than one year later. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] f

Re: a good programming text editor (not IDE)

2006-06-16 Thread bruno at modulix
John Salerno wrote: > Ant wrote: > >> jEdit is for me still the best text editor available. Very extensible >> with macros (which can be written in Jython with the appropriate plugin >> installed). > > > I like the idea of being extensible, but of course I can only write in > Python. Jython is

Re: a good programming text editor (not IDE)

2006-06-16 Thread bruno at modulix
BartlebyScrivener wrote: > I see Eclipse mentioned here a lot. If you go for a Mammoth-weight GUI-only Java IDE and have a really powerful computer, why not ? -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -

Re: a good programming text editor (not IDE)

2006-06-16 Thread bruno at modulix
to effectively use a powerful and extensible test editor is the WiseThingTodo(tm). > (probably Vim, > since I hear it's lighter and faster). It's a bit faster at startup, yes. Else, I'm not sure it makes a real difference wrt/ performances and power. It's more a matter

Re: how you get Python files on websites?

2006-06-15 Thread bruno at modulix
[EMAIL PROTECTED] wrote: (snip) > i have a few questions about Python > > 1. Can Python work with databases like MySql,Oracle? (i think it sounds > silly) http://www.google.com/search?q=%2Bpython+%2Bdb > 2.the Python files have .py extension and i used Windows Command > Prompt(DOS) to execute th

Re: __cmp__ method

2006-06-15 Thread bruno at modulix
JH wrote: > Hi > > Can anyone explain to me why the following codes do not work? I want to > try out using __cmp__ method to change the sorting order. I subclass > the str and override the __cmp__ method so the strings can be sorted by > the lengh. I expect the shortest string should be in the fro

  1   2   3   4   5   6   7   >