Jan Eden wrote:
> Jan Eden wrote on 22.11.2005:
>>Kent Johnson wrote on 20.11.2005:
>>
>>>Use getattr() to access attributes by name. SiteA is an attribute
>>>of Templates and Page is an attribute of SiteA so you can get use
>>>getattr() twice to get what you want:
>>>
>>>site = getattr(Templates,
Hi.
My application hosts a module A that contains only a (variable) number
of functions. In another part of this application I need to know which
functions are defined inside module A. Initially I thought to use
__dict__, but along with the functions of module A are listed all the
builtins too.
H
I want to create a program that uses
data from text files, makes appropriate calculations and produces report.
First I need to find out what is the right way to retrieve appropriate
information from an input file. This is a typical format of the input file:
1 Polonijna Liga Mistrzow
|from
Negroup - wrote:
>Hi.
>
>My application hosts a module A that contains only a (variable) number
>of functions. In another part of this application I need to know which
>functions are defined inside module A. Initially I thought to use
>__dict__, but along with the functions of module A are listed
Hello-
I am in the process of creating an XML document from information stored
in our database. One of my colleagues will use the record to
format our information (health care claims) into all sorts of forms,
reports, etc. He is partial to PHP5 but I like Python and would
like to know if there is
Hi!
I quick solution for a name module could be:
>>> import os
>>> for d in os.__dict__:
... a="os." + d
... if callable( eval(a) ):
... print "Callable %s" % ( eval(a))
but there should also be a recipe on activestate for that problem.
I think I've red something in the Pytho
Andrzej Kolinski wrote:
>
> I want to create a program that uses data from text files, makes
> appropriate calculations and produces report. First I need to find out
> what is the right way to retrieve appropriate information from an input
> file. This is a typical format of the input file:
>
Greg Lindstrom wrote:
> Hello-
> I am in the process of creating an XML document from information
> stored in our database. One of my colleagues will use the record to
> format our information (health care claims) into all sorts of forms,
> reports, etc. He is partial to PHP5 but I like Pytho
|
| With these tools the solution is pretty simple.
I agree that handling this with Python is pretty straightforward, but I'm
wondering if there exists some sort of mechanism for reading these types of
well structured (though not XML format, etc...) files. Something like a reverse
template, s
Hallo,
i have a list with the dirs/files from the current path.
When i use sort() to sort the list alphabetically the list
is still unsorted. How to use ?
dirs_files = os.listdir(os.getcwd())
print dirs_files
dirs_files.sort()
print dirs_files
Thank you.
_
Hi John and Alan,
I got it! Thank you both for explaining this situation.
Thanks,
Joe
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
On Tue, 22 Nov 2005, [EMAIL PROTECTED]
([EMAIL PROTECTED]
On Wed, 23 Nov 2005, lmac wrote:
> i have a list with the dirs/files from the current path. When i use
> sort() to sort the list alphabetically the list is still unsorted. How
> to use ?
>
> dirs_files = os.listdir(os.getcwd())
> print dirs_files
> dirs_files.sort()
> print dirs_files
Hi lmac,
On Wed, 23 Nov 2005, Chris or Leslie Smith wrote:
> I agree that handling this with Python is pretty straightforward, but
> I'm wondering if there exists some sort of mechanism for reading these
> types of well structured (though not XML format, etc...) files.
Hi Chris,
Yes, take a look at "pa
Hi! I'm using a program that I want to know if I'm running the program
in Linux or Windows. How can I do this? I want this because I created
all my program in Linux but if someone runs it in Windows I have to do
some things to make it work well, and I want to do this verification
automatically.
Th
Greg Lindstrom wrote:
> Hello-
> I am in the process of creating an XML document from information
> stored in our database. One of my colleagues will use the record to
> format our information (health care claims) into all sorts of forms,
> reports, etc. He is partial to PHP5 but I like Pytho
Danny Yoo wrote:
| On Wed, 23 Nov 2005, Chris or Leslie Smith wrote:
|
|| I agree that handling this with Python is pretty straightforward, but
|| I'm wondering if there exists some sort of mechanism for reading
|| these types of well structured (though not XML format, etc...) files.
|
| Hi Chris
Negroup - wrote:
> Hi.
>
> My application hosts a module A that contains only a (variable) number
> of functions. In another part of this application I need to know which
> functions are defined inside module A. Initially I thought to use
> __dict__, but along with the functions of module A are li
Diego Galho Prestes wrote:
> Hi! I'm using a program that I want to know if I'm running the program
> in Linux or Windows. How can I do this? I want this because I created
> all my program in Linux but if someone runs it in Windows I have to do
> some things to make it work well, and I want to do t
On Wed, 23 Nov 2005, Kent Johnson wrote:
> Diego Galho Prestes wrote:
> > Hi! I'm using a program that I want to know if I'm running the program
> > in Linux or Windows. How can I do this? I want this because I created
> > all my program in Linux but if someone runs it in Windows I have to do
>
> Great links, Danny. Thanks. I had seen mxTextTools before but didn't
> search for the right thing before raising the question. The pyparsing
> seems very interesting. The code that I attach below is a very
> light-weight version of a formatted reader. It assumes that you just
> want to pluck
Thank you Kent, Chris, Danny,
This is superb, let me work on my part
for now and I promise get back to the group with more ...
_/_/ _/ _/
_/ _/ _/ _/
_/_/_/_/ _/ _/
_/ _/ _/ _/
_/ _/ _/ _/
Andrzej Kolinski wrote:
>
> I want to create a
At 09:55 AM 11/23/2005, lmac wrote:
>i have a list with the dirs/files from the current path. When i use
>sort() to sort the list alphabetically the list is still unsorted.
When you say "unsorted" - are the list members in the same order as
before the sort?
>dirs_files = os.listdir(os.getcwd())
On 24/11/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
> The files that start with uppercase come first because of the way those
> strings compare to lowercase strings. If we want a case-insensitive sort,
> we can do something like this:
>
> ##
> >>> def case_insensitive_cmp(a, b):
> ... return
> In python2.4, you can also use the key= keyword argument:
>
> ###
> def toUpper(s):
> return s.upper()
> files.sort(key=toUpper)
> ###
>
> This is more efficient, I believe, because the key function is only
> called once for each element, whereas cmp is called more than once.
>
> (we could use
At 06:31 PM 11/23/2005, Diego Galho Prestes wrote:
>Hi! I'm using a program that I want to know if I'm running the program
>in Linux or Windows. How can I do this? I want this because I created
>all my program in Linux but if someone runs it in Windows I have to do
>some things to make it work well
Danny wrote:
| Hi Chris,
|
| Yes, I suspect that this happens a lot. I have my own little formatting
| reader that simulates some of the features of C's scanf, for example:
|
|http://hkn.eecs.berkeley.edu/~dyoo/python/scanf/
|
| so I think it's one of those little exercises that everyone e
26 matches
Mail list logo