mg wrote:
> Hello,
>
> I am writting bindings for a FEM application. In one of my function
> 'initModulename', called when the module is imported, I would like to
> get the argc and argv arguments used in the main function of Python.
> So, my question is: does the Python API containe fonctions
Hello,
I am writting bindings for a FEM application. In one of my function
'initModulename', called when the module is imported, I would like to
get the argc and argv arguments used in the main function of Python.
So, my question is: does the Python API containe fonctions like
'get_argc()' and
In Han Kang wrote:
> So each of the sub classes plots a different type of graph. The
> superclass defines methods that are the same for all the plots. I want
> to be able to pick some points and be able to generate a more plots.
> What I was wondering if I could define in a method in the supe
On Sun, Jun 19, 2005 at 11:12:05PM -0700, Didier C wrote:
> Hi!
>I was wondering if we can pass some arguments to system("cmdline")?
>
> E.g in Perl, we can do something like:
>
> $dir="/home/cypher";
>
> system("ls $dir");
>
> which would instruct Perl to do an "ls /home/cypher"
>
> But i
Didier C wrote:
> Hi!
>I was wondering if we can pass some arguments to system("cmdline")?
>
> E.g in Perl, we can do something like:
>
> $dir="/home/cypher";
>
> system("ls $dir");
>
> which would instruct Perl to do an "ls /home/cypher"
>
> But in python, doing something like
>
> dir="/
Hi!
I was wondering if we can pass some arguments to system("cmdline")?
E.g in Perl, we can do something like:
$dir="/home/cypher";
system("ls $dir");
which would instruct Perl to do an "ls /home/cypher"
But in python, doing something like
dir="/home/cypher"
system("ls dir")
would cause p
In article <[EMAIL PROTECTED]>,
"Xah Lee" <[EMAIL PROTECTED]> wrote:
>A[n] easy way to see this, is to ask yourself: how come in mathematics
>there's no such thing as "addresses/pointers/references".
Yes there are such things in mathematics, though not necessarily under
that name.
For instance
On 6/18/05, D H <[EMAIL PROTECTED]> wrote:
> I would hardly call using a
> dictionary as a switch statement, the "equivalent". The fact that
> people use a dictionary as a conditional is a python wart.
Not at all. A case statement is nothing more than a literal mapping of
constant values to the e
wxDesigner + XRCed = The best.
I would like the Boa approach but with xrc exports. It would
reaally be the best of the best!
And don't get me wrong too, but "to be better than the competition you
need to be better than the competition" - Christoph Rackwitz
Daniel
--
http://mail.python.org/m
Don't use print, write directly to sys.stdout.
Print is not intended for precise output formatting;
it's intended for quick outputs that are useable
most of the time.
John Roth
"Paul Watson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> #!/usr/bin/env python
>
> # Using a prin
>...it's this last one that causes the problem. In the real code, the
>call to type.__setattr__ referred to above seems to lead to a call to
>something like cls.__base__.__dict__[attr].__set__(cls, value).
Uhm ... sounds right, but I a bit confused. Could you please give us a
doctest showing us wh
On 2005-06-19, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> Such lovely things allowed as: embedding non-printable control
> characters into file names.
Don't most OSes allow that? Unix does, and IIRC VMS did as
well. In VMS there was a system call that let you change the
name shown by
#!/usr/bin/env python
# Using a print statement to stdout results in an
# unwanted space character being generated at the
# end of each print output. Same results on
# DOS/Windows and AIX.
#
# I need precise control over the bytes that are
# produced. Why is print doing this?
#
impor
On Sunday 19 June 2005 05:34 pm, Xah Lee wrote:
> in coding Python yesterday, i was quite stung by the fact that lists
> appened to another list goes by as some so-called "reference". e.g.
>
> t=range(5)
> n=range(3)
> n[0]='m'
> t.append(n)
> n[0]='h'
> t.append(n)
> print t
Day one in learning
I think the only reason I read your posts is for comedy, seeing if this
is yet another "Xah Lee just threw a tantrum" post. I don't know why
I'm wasting my time responding, though... It's against my better
judgment and my previous advice to the group.
Xah Lee wrote:
>in coding Python yesterd
On Saturday 18 June 2005 10:35 pm, James Carroll wrote:
> Hi, I'm creating an extension called _bright.so on linux. I can
> import it with import _bright, but how can I import bright and get the
> package?
>
> On windows, I've been able to import bright instead of import _bright,
> but on Linux i
In Han Kang wrote:
> So each of the sub classes plots a different type of graph. The
> superclass defines methods that are the same for all the plots. I want
> to be able to pick some points and be able to generate a more plots.
> What I was wondering if I could define in a method in the supe
You should be able to access regular dlls and handle callbacks with
the ctypes module without needing to resort to any real c code:
http://starship.python.net/crew/theller/ctypes/
-Chris
On 18 Jun 2005 02:10:59 -0700, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi together,
>
> i have a Windo
Joseph Garvin wrote:
> Peter Otten wrote:
>
>> I found 136 occurrences of "do {" versus 754 of "while (" and 1224 of
>> "for
>> (" in the Python 2.4 source, so using these rough estimates do-while
>> still
>> qualifies as "rarely used".
>>
>> Peter
>>
>>
>>
> That's 136 times you'd have to use
Peter Hansen wrote:
> Bo Peng wrote:
>
>> I need to pass a bunch of parameters conditionally. In C/C++, I can do
>> func(cond1?a:b,cond2?c:d,.)
>>
>> Is there an easier way to do this in Python?
>
>
> Please read the FAQ to learn the answer and much other useful ...
The answer is no. Use i
Peter Hansen wrote:
> D H wrote:
>
>> Peter Hansen wrote:
>
> [some stuff Doug didn't like]
>
Actually, this is what you snipped, stuff you didn't like, because the
very mention of "boo" causes you such fits:
> Since you and Steve Holden agree that a case statement is useful, why
> don't yo
Hi,
I am trying to login a website that using PHP and javascript. This is
what happend if you browse that website using IE, after you login, you
can go anywhere without enter your name and password again, as long as
you keep that IE open, but after you close that IE, then later on open
that websit
Peter Hansen wrote:
> D H wrote:
>> So you say he "has done relatively little serious development" and
>> that he may not even know about Python. I didn't see any evidence
>> from those pages to draw either conclusion. In fact the 4th paragraph
>> quite contradicts them both.
>
>
> Clearly
Xah said unto the world:
>oops... it is in the tutorial... sorry.
>
>though, where would one find it in the python reference?
i>.e. the function def with variable/default parameters.
>
>This is not a rhetorical question, but where would one start to look
>for it in the python ref?
>
>a language is
So each of the sub classes plots a different type of graph. The
superclass defines methods that are the same for all the plots. I want
to be able to pick some points and be able to generate a more plots.
What I was wondering if I could define in a method in the superclass of
an object the ab
In Han Kang wrote:
> Anyway, I was wondering...I have an super class which is the superclass
> for 5 other classes. However, I want to be able to call the subclass
> constructors from the super class. Is this possible?
Are you trying to use your superclass as a factory?
If so, one option is s
>
> In hindsight analysis, such language behavior forces the programer to
> fuse mathematical or algorithmic ideas with implementation details. A
> easy way to see this, is to ask yourself: how come in mathematics
> there's no such thing as "addresses/pointers/references".
Mathematics also has no
Xah Lee wrote:
> oops... it is in the tutorial... sorry.
>
> though, where would one find it in the python reference?
> i.e. the function def with variable/default parameters.
>
> This is not a rhetorical question, but where would one start to look
> for it in the python ref?
> a language is use
in coding Python yesterday, i was quite stung by the fact that lists
appened to another list goes by as some so-called "reference". e.g.
t=range(5)
n=range(3)
n[0]='m'
t.append(n)
n[0]='h'
t.append(n)
print t
in the following code, after some 1 hour, finally i found the solution
of h[:]. (and th
Xah Lee wrote:
> oops... it is in the tutorial... sorry.
>
> though, where would one find it in the python reference?
> i.e. the function def with variable/default parameters.
>
> This is not a rhetorical question, but where would one start to look
> for it in the python ref?
Oddly enough, http:
No. You will go into an infinite loop - at least I get there when I try
someting like this:
class Base:
def __init__(self):
Derived.__init__(self)
print 'Base'
class Derived(Base):
def __init__(self):
Base.__init__(self)
[EMAIL PROTECTED] writes:
> If anyone is interested, I've implemented a faster and more space
> efficient gherkin with a few bug fixes.
It would be nice if you just posted the PEP.
--
http://mail.python.org/mailman/listinfo/python-list
oops... it is in the tutorial... sorry.
though, where would one find it in the python reference?
i.e. the function def with variable/default parameters.
This is not a rhetorical question, but where would one start to look
for it in the python ref?
a language is used by programers. Subroutine def
In Han Kang wrote:
> Hello everyone and thank you for being such a good community.
>
> Anyway, I was wondering...I have an super class which is the superclass
> for 5 other classes. However, I want to be able to call the subclass
> constructors from the super class. Is this possible?
If you h
Thanks it works!
pujo
--
http://mail.python.org/mailman/listinfo/python-list
Hello everyone and thank you for being such a good community.
Anyway, I was wondering...I have an super class which is the superclass
for 5 other classes. However, I want to be able to call the subclass
constructors from the super class. Is this possible?
Thank you in advance
--
http://mail.
[EMAIL PROTECTED] writes:
> > See also bug# 471893 where jhylton suggests a PEP. Something really
> > ought to be done about this.
>
> I know this, you know this... I don't understand why the suggestion is
> meeting so much resistance. This is something I needed for a real world
> system which mo
Fuzzyman wrote:
> To the best of my knowledge jython is languishing at Python 2.1. The
> PSF has funded a push to implement new style classes which will allow
> it to be brought up to date.
It's really not languishing any more. There is a lot of activity spearheaded by
Brian Zimmer (who received
<[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
| Hello,
|
| I have python code which use tab=2. Recently I would like to change it
| into tab=4.
|
| Anyone has suggestion to convert easily and safely ?
Look at "reindent.py" in Tools\Scripts.
--
Vincent Wehren
|
| pujo
|
"John Roth" wrote:
> Unfortunately it doesn't work: getitem can be defined for
> a class that acts like a dictionary: that is, the items are
> not integers, let alone integers that extend in a strict
> sequence from 0.
This is true, but that's the current behaviour of iterators for classes
that d
"George Sakkis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Michele Simionato wrote:
>> I think strings do not have __iter__ on purpose, exactly to distinguish
>> them from other iterables, since sometimes it is nice to consider them
>> atomic, but I am not sure of this. You shou
Hello,
I have python code which use tab=2. Recently I would like to change it
into tab=4.
Anyone has suggestion to convert easily and safely ?
pujo
--
http://mail.python.org/mailman/listinfo/python-list
Bo Peng wrote:
> Roy Smith wrote:
>
>> Can you give us some idea of what it is that you're trying to do? It
>> pretty unusual to see a requirement like that.
>
>
> def func(type_of_obj1, type_of_obj2, .):
> callfunc( [
> type_of_obj1 and obj1a() or obj1b(),
> type_of_obj2 and obj
Michele Simionato wrote:
> I think strings do not have __iter__ on purpose, exactly to distinguish
> them from other iterables, since sometimes it is nice to consider them
> atomic, but I am not sure of this. You should ask the developers. Anyway, the
> right definition of iterable is (as I was tol
I think strings do not have __iter__ on purpose, exactly to distinguish
them
from other iterables, since sometimes it is nice to consider them
atomic,
but I am not sure of this. You should ask the developers. Anyway, the
right definition of iterable is (as I was told) "an object X such that
iter(X)
McBooCzech <[EMAIL PROTECTED]> wrote:
> sorry for bothering you with my comment. From my point of view, the
> situation on the IDE (GUI??) development field for Python is really
> strange. Just try to imagine the same situation around the Python.
> Plenty of different approaches, versions, philosop
"Michele Simionato" wrote:
> In this case I have used hasattr(obj, "__iter__") instead of
> isinstance(obj, list)
> (strings are iterable but do not have __iter__ method). I think hasattr
> is much better
> since it works for tuples and custom iterables too.
The fact that strings don't have __ite
Dave Cook wrote:
> On 2005-06-18, cpunerd4 <[EMAIL PROTECTED]> wrote:
>>thanks all for the advice. The reason I was thinking about using java
>>(or C or something) was that it is a little more secure than
>>distributing the source code isn't it?
>
> 14 and he already wants to horde his source co
"Bo Peng" wrote:
> Roy Smith wrote:
>
> > Can you give us some idea of what it is that you're trying to do? It
> > pretty unusual to see
> > a requirement like that.
>
> def func(type_of_obj1, type_of_obj2, .):
>callfunc( [
> type_of_obj1 and obj1a() or obj1b(),
> type_of_obj2
On 2005-06-18, cpunerd4 <[EMAIL PROTECTED]> wrote:
> I see your point, although I don't think there is much a 14 year old
> can do to sue someone. . . I'm sure my code won't be that valuable
> untill I'm older though. Thanks
It's valuable as something to show prospective employers or clients: "I
Kent Johnson wrote:
> letters = {}
> for letter in ascii_lowercase:
> letters[letter] = 0
Or more simply:
letters = dict.fromkeys(ascii_lowercase, 0)
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>, Bo Peng <[EMAIL PROTECTED]> wrote:
> Roy Smith wrote:
>
> > Can you give us some idea of what it is that you're trying to do? It
> > pretty unusual to see
> > a requirement like that.
>
> def func(type_of_obj1, type_of_obj2, .):
>callfunc( [
> type
On 2005-06-18, cpunerd4 <[EMAIL PROTECTED]> wrote:
> thanks all for the advice. The reason I was thinking about using java
> (or C or something) was that it is a little more secure than
> distributing the source code isn't it?
14 and he already wants to horde his source code.
Dave Cook
--
htt
Roy Smith wrote:
> Can you give us some idea of what it is that you're trying to do? It pretty
> unusual to see
> a requirement like that.
def func(type_of_obj1, type_of_obj2, .):
callfunc( [
type_of_obj1 and obj1a() or obj1b(),
type_of_obj2 and obj2a() or obj2b(),
On 2005-06-17, rh0dium <[EMAIL PROTECTED]> wrote:
> I am starting to play with pysqlite, and would like to know if there is
> a function to determine if a table exists or not.
sqlite_master has already been mentioned, so I'll point out some useful
pragmas (under "Pragmas to query the database sch
On 2005-06-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> How are the development tools for the Mac? I'll use IDLE if it's
> available, but I like Scintilla better.
Idle is
/System/Library/Frameworks/Python.framework/Versions/2.3/bin/idle
First thing you want to do is install readline to m
In this case I have used hasattr(obj, "__iter__") instead of
isinstance(obj, list)
(strings are iterable but do not have __iter__ method). I think hasattr
is much better
since it works for tuples and custom iterables too.
Michele Simionato
--
http://mail.python.org/mailman/listinfo/pyt
I have a peculiar problem that, naturally, I cannot reproduce outside
the fairly long-winded code that spawned it. Thus the code snippets here
should be taken as shorthand for what I think are the relevant bits,
without actually leading to the erroneous (or at least undesired)
behaviour described.
If your test variable has specific values to branch on, the standard
way is to have those values be keys in a dictionary, and do:
branched_func_obj = dict_of_values.get(testvar)
And the lambda hack is here, courtesy of Peter Norvig
http://www.norvig.com/python-iaq.html
--
http://mail.python.or
See Pep 315, which is still open, and targeted at 2.5.
It survived the recent spate of PEP closings and rejections.
http://www.python.org/peps/pep-0315.html
John Roth
"Remi Villatel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there,
>
> There is always a "nice" way to do t
"Michael Hoffman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> John Roth wrote:
>
>> you need _both_ isinstance and the types module to do a correct
>> check for any string type: isinstance(fubar, types.StringTypes).
>> That's because both string and unicode are subtypes of one
If anyone is interested, I've implemented a faster and more space
efficient gherkin with a few bug fixes.
http://developer.berlios.de/project/showfiles.php?group_id=2847
--
http://mail.python.org/mailman/listinfo/python-list
Hmmm... the page is a *bit* out of date (which is to be expected I
suppose).
There is a port of Python 2.3 for Pocket PC.
I think pippy is pretty dead and wasn't that useable. On this newsgroup
not long ago someone announced they were working on a new PalmOS port.
To the best of my knowledge jyt
"Björn Lindström" schrieb
>
> > A great analysis, but what's a "pogo stick" and where can I get
one?
>
> http://search.ebay.com/pogo-stick
>
Yes, that explains the "bouncing with the pogo stick"; I would have
poked around
with a stick.
ROTFL, thank you.
Martin
--
http://mail.python.org/mailma
<[EMAIL PROTECTED]>, Bo Peng <[EMAIL PROTECTED]> wrote:
> I have around 10 of them. Using these if/else, it will take 50 lines for
> a function call. It also bothers me to have 10 variables left in the
> namespace, in addition to finding 10 meaningful names.
If you've got 10 different conditiona
"Martin Blume" <[EMAIL PROTECTED]> writes:
> A great analysis, but what's a "pogo stick" and where can I get one?
http://search.ebay.com/pogo-stick
--
Björn Lindström <[EMAIL PROTECTED]>
Student of computational linguistics, Uppsala University, Sweden
--
http://mail.python.org/mailman/listinfo
"John Machin" schrieb
>
> [analysis of super() "oddness"]
>
A great analysis, but what's a "pogo stick" and where
can I get one?
Thanks
Martin
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
[snip..]
> results. Now, I was thinking today, I'd really like to create a program that
> can go to a specific directory and upload all the files in the directory to a
> specific url for backup purposes, and I have the feeling that the python
> implementation would be ruthl
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299271
or the nice recipe, page 403 of cookbook2, that i can't find in ASPN
--
http://mail.python.org/mailman/listinfo/python-list
John Roth wrote:
> you need _both_ isinstance and the types module to do a correct
> check for any string type: isinstance(fubar, types.StringTypes).
> That's because both string and unicode are subtypes of one base.
But basestring, their base class is a built-in.
--
Michael Hoffman
--
http://
Peter Hansen wrote:
> Michael, tai64nlocal is a program that converts a special "packed"
> timestamp to human-readable form.
Thanks Peter. I was asking somewhat rhetorically but I have a love of
UNIX arcana and now I know. :)
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python
http://dmoz.org/Computers/Programming/Languages/Python/Ports/
--
http://mail.python.org/mailman/listinfo/python-list
"Casey Hawthorne" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What platforms have Python Virtual Machines and what version(s) of
> Python do they support?
> In particular:
> Palm OS
> PocketPC
Try using Google (Python PocketPC, for instance) or the equivalent
TJR
--
http:/
> See also bug# 471893 where jhylton suggests a PEP. Something really
> ought to be done about this.
I know this, you know this... I don't understand why the suggestion is
meeting so much resistance. This is something I needed for a real world
system which moves lots of data around to untrusted
Hello All,
I'm trying to embed Python in a C application.
What I didn't find is how to create an instance once I have a class object.
I'd like to do the equivalent of:
from a import A
obj = A()
obj.foo(10)
The following code omits error checking for clarity.
--- a.py ---
class A:
75 matches
Mail list logo