I have some XML, with a variable and somewhat unknown structure. I'd
like to encapsulate this in a Python class and expose the text of the
elements within as properties.
How can I dynamically generate properties (or methods) and add them to
my class? I can easily produce a dictionary of the
On 30 Jul, 20:30, Jason Tishler [EMAIL PROTECTED] wrote:
You need to build (and install) pysvn under Cygwin. The pre-built
Windows version will not work under Cygwin.
Thanks. Presumably this same problem would affect anything that uses
a .pyd under Cygwin?
--
I'm building Python tools to wrap up access to our Subversion / SVN
source control system. It's to run on my desktop (Cygwin under Windows
XP) and then later under Redhat.
Trying to install the pysvn module I'm running into problems getting
it to work under Cygwin. Works fine from a Windows
I have a problem involving lots of simple text files (Java properties
files), for which I'm building Python tools to manage their contents.
I'm also writing lots of Python modules and using doctest to embed
unit tests within them. Maintenance and shhared code ownership is an
issue here.
What's
On 26 Mar, 14:20, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
what are the advantages of using Python for
creating number crunching apps over Fortran??
If you have to ask, you've not experienced enough Fortran to know its
sheer horror.
You can write programs in Python that do usefully
On 16 Feb, 21:22, [EMAIL PROTECTED] wrote:
I am VB6 programmer and wants to start new programming language
Why? What is causing you to do this, and what do you need to achieve
by doing it?
i want to go through with GUI based programming language like VB.net
GUI-based is fairly unimportant as
On 14 Feb, 20:06, Beej [EMAIL PROTECTED] wrote:
http://linuxgazette.net/109/pramode.html
Thanks, that's a _really_ interesting link (Oh, I need to learn
Scheme!)
My code now looks like this, which I'm starting to feel much happier
about in a functional sense.
c_rot = lambda c, chars :
On 14 Feb, 21:59, Paul Rubin http://[EMAIL PROTECTED] wrote:
Why don't you describe the actual problem instead of the rot13 analogy.
I don't know what the actual problem is! I need to perform a complex
mapping between old style structured identifiers and new style
structured identifers. As the
On 15 Feb, 17:55, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
Sounds more like a case for a parser/lexer wherein the emitted code
tokens are the new style identifiers...
8-(I'm trying not to think about that
Fortunately I don't think it's _quite_ that bad.
--
I'm trying to write rot13, but to do it in a better and more Pythonic
style than I'm currrently using. What would you reckon to the
following pretty ugly thing? How would you improve it? In
particular, I don't like the way a three-way selection is done by
nesting two binary selections. Also I
On 14 Feb, 16:23, Neil Cerutti [EMAIL PROTECTED] wrote:
str.translate is what I'd do.
That's what I hope to do too, but it might not be possible (for the
live, complex example). It looks as if I have to make a test, then
process the contents of the code differently depending. There might
well
On 5 Feb, 19:40, Sells, Fred [EMAIL PROTECTED] wrote:
Years ago we used to get our FORTRAN card decks back from the DP center
with a piece of scrap paper saysing She No Work. top that.
I used to use a cross-compiler (targetting some obscure single-chip
hardware) that had just a single error
On 3 Feb, 15:43, [EMAIL PROTECTED] wrote:
How to access data from MS Access?
Can you access Access from Access ? from Excel / Visual Basic / SQL
Query? First of all check that the DSN is working and connects to the
back end MDB. This might not be Python's problem.
Secondly check whatever
I run build processes for a Java shop using Python (and some Ant).
Would anyone care to suggest favoured tools for manipulating the
innards of JARs? Or do I just treat them as plain zipfiles and get
stuck right in there?
Mainly I'm trying to query lists of classes and their embedded
versions and
king kikapu wrote:
Are they embarassed by their code?
hehehe...no, just worried about stealing their ideas...
Ever heard of Open Source ? I do better by letting other people
steal my ideas (and stealing theirs too) than I'd ever do by keeping
things secret.
--
Matias Jansson wrote:
I come from a background of Java and C# where it is common practise to have
one class per file in the file/project structure.
Don't confuse packages and files. Java commonly splits a package
across many files, Python binds a module to a single file. If you see
Java
Paul Melis wrote:
I've always been using the has_key() method to test if a dictionary
contains a certain key. Recently I tried the same using 'in', e.g.
I've found using the set type to be the quickest way to do many of
these tasks. That leads me to another problem: how to cast / convert
sets
Roberto Bonvallet wrote:
lstBugsChanged = [ bugId for bugId in setBugsChanged ]
In Python 2.4:
Hmmm. Thanks. Another reason to twist the admin's arm and get them to
upgrade the last 2.3.4 boxen
sorted(setBugsChanged)
Out of interest, whats the Pythonic way to simply cast
Imbaud Pierre wrote:
I have to add access to some XMP data to an existing python
application.
XMP is built on RDF,
I'm just looking at the XMP Spec from the Adobe SDK. First impressions
only, as I don't have time to read the whole thing in detail.
This spec doesn't inspire me with
Imbaud Pierre wrote:
I have to add access to some XMP data to an existing python
application.
XMP is built on RDF, RDF is built on XML.
RDF is _NOT_ built on top of XML. Thinking that it is causes a lot of
trouble in the architecture of big RDF projects. RDF is a data model,
not a
Burhan wrote:
Is there an easy way to generate barcodes using Python
Easy way for any application or language to generate barcodes is to
install a barcode font on the client machine, then just generate a
suitable text string for it. This is _very_ easy, if you can get the
font deployed. I
walterbyrd wrote:
I don't know if this is a fair comparison or not.
Who cares? Anything involving PHP is a billion flies can't be wrong
type of statement.
I agree completely with your observation about PHP's lower cost of
access. This is ostensibly a good thing, but it also means that every
[EMAIL PROTECTED] wrote:
I am involved in one project which tends to collect news
information published on selected, known web sites inthe format of
HTML, RSS, etc
I just can't imagine why anyone would still want to do this.
With RSS, it's an easy (if not trivial) problem.
With HTML
Paul Rubin wrote:
http://philip.greenspun.com/sql/
There was a time (some time in the mid 90s) when I thought that Philip
Greenspun had a Clue. Then I realised just how wrong he was (he started
off reasonably right, he just didn't keep up when the world moved on).
The highlight of this process
gord wrote:
As a complete novice in the study of Python, I am asking myself where this
language is superior or better suited than others.
I use it, and see it primarily, as a Perl killer. It also does for Ruby
and our infernal shell scripts.
I've never considered using Python instead of VB.
walterbyrd wrote:
If so, I doubt there are many.
I currently earn my living programming in Python.
This is particularly amusing given that it's a Java shop and I don't
even know Python!
I've only been using it for a few months as a replacement for the
previous shell scripts and instead of
[EMAIL PROTECTED] wrote:
I am looking for python code that takes as input a list of strings
[...] and outputs the python regular expression
(s1|s2|s3|s4|s5)
for strings of s1 etc.
Regex compilers are themselves quite good at optimising beyond this
--
Aravind wrote:
some of my friends told that python and java are similar in the idea of
platform independency.
Similar in goal, but quite different in approach.
Python supports lots of platforms and goes to great lengths to offer
facades around whatever features a platform does have, so as
I seem to be writing the following fragment an awful lot, and I'm sure
it's not the best and Pythonic way to do things. Any advice on better
coding style?
pluginVersionNeeded is a parameter passed into a method and it can
either be a simple scalar variable, or it can be a list of the same
Thomas Guettler wrote:
I like python, but sometimes i don't like that python allows
spaces and tabs. It would be easier if you had less choice and
must use four spaces.
That's the nice thing about Python. It doesn't care about indentation
distance, it just wants some and consistent.
I like
Bruno Desthuilliers wrote:
there's really no reason to
assume it should be a list - any iterable could - and IMHO should - be
accepted... expect of course for strings (royal PITA case, duh).
2/ test for pluginVersionsNeeded.__iter__ (an attribute of most
iterables except strings...):
[EMAIL PROTECTED] wrote:
Python and Ubuntu rock...go fot it.
That's nice. I've just burned myself a new Ubuntu f*ck-a-duck release
CD intending to rebuild a flakey old Deadrat box with it. Once it's
done I'd like to be running Python with some USB to Dallas one-wire
hardware on it, re-plugged
[EMAIL PROTECTED] wrote:
Is Windows
an okay enviornment in which to program under Python, or do you
recommend that I run a dual-boot of Linux or maybe a VMWare install to
program under Python?
Python is one of the best languages I've found for
platform-independence - significantly better
[EMAIL PROTECTED] wrote:
it seems that range() can be really slow:
if i in range (0, 1):
RTFM on range()
You're completely mis-using it here, using it with an if ... in ...
test. The purpose of range() in Python is as loop control, not
comparisons! It's not a SQL BETWEEN statement.
Simon Forman wrote:
There's more to it, but that's the basic idea.
This much I knew, but _why_ and _when_ would I choose to use list
comprehension (for good Python style), rather than using a simple
traditional loop ?
If I want to generate something that's simply ( [1] + [2] + [3]+... )
then
[EMAIL PROTECTED] wrote:
Python, like it's (evil?) cousin Perl,
Isn't that evil cousin Ruby? Perl's the mad old grandmother in the
attic, spewing out incomprehensible [EMAIL PROTECTED]% swearing all day.
can be used as a CGI. If you
don't have one already, go download Apache server to play
Python newbie: I've got this simple task working (in about ten
different ways), but I'm looking for the favoured and most Python
like way.
Forwards I can do this
for t in listOfThings:
print t
Now how do I do it in reverse? In particular, how might I do it if I
only wanted to iterate
Fredrik Lundh wrote:
for item in reversed(listOfThings):
Thanks! I was staring so hard at reverse() that I'd completely missed
reversed()
I think I prefer this to listOfThings[::-1]: as it's a little more
readable.
Not that I'm reacting to past bad experience of Perl, you understand
8-)
--
On Fri, 17 Mar 2006 11:22:06 +0100, Timo Stamm [EMAIL PROTECTED]
wrote:
Xah's posting was properly encoded and will display fine in every decent
newsreader.
Well mine killfiled it straight off, which I think is entirely proper
rendering for one of Xah Lee's kookery lessons.
--
39 matches
Mail list logo