this feature has been removed in python3 in accordance to the PEP 3113
(http://www.python.org/dev/peps/pep-3113/), you should consider using the *
operator
http://docs.python.org/tutorial/controlflow.html#unpacking-argument-lists .
--
http://mail.python.org/mailman/listinfo/python-list
Thanks a million Oleg!
Cheers,
Daniel
On 11/20/11, Oleg Broytman wrote:
> Hello!
>
> I'm pleased to announce version 1.2.0, the first stable release of branch
> 1.2 of SQLObject.
>
>
> What is SQLObject
> =
>
> SQLObject is an object-relationa
x27;d like
to subclass "cb" not from "ca", but from the Python "class A" - if possible?!
Could somepne kindly point out my mistake(s) and set me back on track?
Thanks
Daniel
--
#include
typedef struct {
PyObject_HEAD
} ca;
static PyTypeObject ca_Type
On Saturday 14 January 2012 22:15:36 Daniel Franke wrote:
> Here I'd expect "" instead?! And I never managed a proper
> subclass :|
Found an explanation on type/class at [1]: "he difference between the two is
whether the C-level type instance structure is flagged as hav
r
-> the function name also comes with a leading underscore '_', i.e.
"_initfoo", not "initfoo"
Could someone knowledge with Windows and MinGW help me to sort this out? Tools
used: cmake-2.8.3, mingw-? with gcc-4.4 and Python-2.7.2 from python.org.
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
e's
> structure. When type->tp_flags & Py_TPFLAGS_BASETYPE is true then
> subclassing is allowed. But I know of no way to retrieve that
> information from Python code.
There is an (undocumented and CPython-specific) way:
>>> range.__flags__ & (1 << 10)
0
>&
Today, being the last day of lectures at school, my instructor ran briefly
through Tkninter and GUIs. I'd been looking forward to this particular lesson
all semester, but when I got home and copied a sample program from my textbook
verbatim, IDLE does nothing. No error, no nothing. Any ideas? He
Hello,
Does anyone know which methods do I have to override for allowing Nones
to be accepted and sended from SimpleXMLRPCServer to the client?
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ch better than PyGTK. PyGTK is good if you intend to develop
for Linux.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ain__':
print 'Your mac address is %s' % get_macaddress('localhost')
It works perfect under W2K and above. But I would like to run it on
Win98 too. Any help?
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Good question, I have the same anxiety.
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> So wxPython doesn't need a runtime? I don't think so. wxPython for me
> sucks under Linux (built on gtk2) and I don't like its API at all. It
> seems a bit awkward to me. Anyway... what do you mean with "much better" ?
It's much better:
- Its portability is superior over PyGTK
- Its look & feel
Thank you very much! I will try it as soon as possible, and write you
back with my results.
Best regards
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
By the way:
> Under windows, only needs some dlls
py2exe does this job :)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi, Scott,
Thanks for your answer
>> Hi, I tried: ...
>> # Convert binary data into a string.
>> macaddr = ''
>> for intval in struct.unpack('BB', buffer):
>> if intval > 15:
>> replacestr = '0x'
>> else:
>> replacestr = 'x'
>> macad
I have class 'x' with member 'content' and another member 'a' which is an instance of class '_a'. The class '_a' is callable and has a method 'func' which I would like to use to modify 'content' but I don't know how to address 'content' from the class '_a'. Is it possible?
Here is the code that
Hello Daniel
You've certainly got a lot going on here.The heart of your question seems to be how a nested (inner) class _a can access
its parent, x. The short answer is that, in Python, it can't without some help. _a and its instances are unaware of the context in which they are defin
eas welcome
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi Michael, one more thing.
As you could see my only goal was to be able to say
1 inst = x()
2
3 inst.a("some string")
4 inst.a.func()
5
6 inst.b("some other string")
7 inst.b.func()
and (3) should modify 'inst.content' in some way depending on "some
string" and the attribute 'a' while (4)
Hi There!I created a few python scripts and everything is working fine. But to
make it easier to run the procedure i want to couple these scripts inone big script. Is there a possibility to do this, can I for examplemake a script dat 'calls' the other script in the right order?Many thanks!
Sander
> I was looking on how to get MAC address universally (Windows and Linux) and
> found one package that is doing that and more...
> http://libdnet.sourceforge.net/
Thank you for the info too :)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi Dody!
It works perfect! Now, I want the SimpleXMLRPCServer.py not to be on
the same directory, but in my /lib directory. I tried it, but it seems
that the module loads from python24/ first. How can I change this?
Thank you!
--
http://mail.python.org/mailman/listinfo/python-list
t re
... if re.match("^[-+]?[0-9]+$", n):
... return True
... return False
does not recognize 0x numbers, but this is easy to fix
if wanted
>>> def isNumber(n):
... import re
... if re.match("^[-+]?[0-9A-Fa-f]+$", n):
... re
he extension (the OP's next post is probably going
to be 'why doesn't redirection work?').
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi to all,
I'm using adodb for accessing mysql and postgres. My problem relies on
the mysql access.
Sometimes, when I try to execute a query (using ExecTrans method
below), I get this error:
'NoneType' object has no attribute 'cursor'
Maybe this error ocurrs not in my code, but in the mysql mod
[1, 2, 3, 4]
or even if you "could" copy instances
class X:
def __init__(self, filename = "/path/file")
self.file = file(filename, "w+")
def modifyByteAt(offset):
self.file.tell(offset)
self.file.write("
I was not very clear about it
> or even if you "could" copy instances
>
> class X:
> def __init__(self, filename = "/path/file")
> self.file = file(filename, "w+")
> def modifyByteAt(offset):
> self.file.tell(offset)
> self.file.write("X")
>
> this is untested pse
... for i in range(a):
... for j in range(b):
... for k in range(c):
... sum += 1
...
(1) fails to compile
is it possible to pass parameters to a decorator function?
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
re considered to be in closure?
Or what is the right denotation for them?
Can someone give me some pointers to the metaprogramming in Python?
links etc
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
. I can sit
down and build all this stuff, but I would like to know if someone had
passed through this. Any tips?
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
re, like
complex numbers (maybe in Python 3)
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ld be opened at a time, so using cursors in parallel present some
problems to the driver implementor.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Robin Haswell wrote:
> On Thu, 19 Jan 2006 14:37:34 +0100, Daniel Dittmar wrote:
>>If you use a threading server, you can't put the connection object into
>>the module. Modules and hence module variables are shared across
>>threads. You could use thread local storage,
ding the cursors with an actual
cursor object.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
seem to be that
essential to Python thread programming.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
base), you'd use one connection per thread. If you want to use
transactions, then it is the only way.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
re\2.4 (or whatever version
you're using)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> Hey I'm pretty new to python and I have a question. I'm trying to write:
> "[BOOT]
> run=C:\windows\aawin.bat"
>
> in my win.ini
> So I went about it like this:
>
> win = open('C:\windows\win.ini', 'a')
> win.write('[BOOT]')
> win.write('\n')
> win.write('run=C:\windows\aawin.bat')
>
> I expecte
What is the simplest way to instantiate all classes that are
subclasses of a given class in a module?
More precisely I have a module m with some content:
# m.py
class A:
pass
class x( A ):
pass
class y( A ):
pass
# all kinds of other objects follow
# end of m.py
and then in another m
> > More precisely I have a module m with some content:
> >
> > # m.py
> > class A:
> > pass
> > class x( A ):
> > pass
> > class y( A ):
> > pass
> > # all kinds of other objects follow
> > # end of m.py
> >
> > and then in another module I have currently:
> >
> > # n.py
> > import m
>
> > >>> from inspect import isclass
> > >>>
> > >>> class x:
> > ... def __getattr__( self, attr ):
> > ... pass
> > ...
> > >>> y = x( )
> > >>> isclass( y )
> > True
>
> Which reinforces Michael Spencer's instinct that the inspect.isclass()
> implementation is a bit too clever
Wou
> > What is the simplest way to instantiate all classes that are
> > subclasses of a given class in a module?
> >
> > More precisely I have a module m with some content:
> >
> > # m.py
> > class A:
> > pass
> > class x( A ):
> > pass
> > class y( A ):
> > pass
> > # all kinds of other o
> I have a problem with python. When I try to connect to
> postgresql. It appears a message.
>
> ]$ python
>
> >>> from pg import DB
> Traceback (most recent call last):
>
>File "", line 1, sn?
>
> ImportError:
Of course, when I sent them a request on behalf of the company I work for,
I ever only received an automated reply, so don't expect too much.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
or tuple.
Python/bltinmodule.c min_max demonstrates how to allow either a sequence
or a variable number of arguments.
Modules/itertools.c has probably lots of examples on how to work with
iterators at the C API level.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ummy module:
import sys
for name, entry in sys.__dict__.iteritems ():
if callable (entry):
print '''def %s ():\n\t""""%s""""\n\tpass\n\n''' \
% (name, entry.__doc__)
Put the generated modules in a directory o
ly quite useful for other files. Of course
there might be differences if a comment starts
- on the first character
- on the first non-blank character
- anywhere in the line
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
tion so
> that it quite happily accepted generator expressions, rather than
> changing a conditional to use len() just so that an equivalent
> exception could happen a bit earlier.
Premature generalization: the new 'premature optimization'.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ll methods of HandcraftedPerson.Person into
GeneratedPerson.Person is left as an exercise.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Sion Arrowsmith wrote:
> Daniel Dittmar <[EMAIL PROTECTED]> wrote:
>> if line [:1] == '#':
>
> What's wrong with line[0] == '#' ? (For one thing, it's fractionally
> faster than [:1].)
>
Matter of taste. Occasionally, I use line
up.py" then just run
>
> python setup.py install
if there are more versions of python installed
and one wants to install for specific version then
/pool/pathToMyInstalledSoftware/bin/python2.4 setup.py install
/pool/pathToPetersInstalledSoftware/bin/python2.2 setup.py install
this is what I figured out
my 2 cents
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
choosen?
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
he only minor point is that no relationship
can be expressed
settings = {
"NumNode" : 10,
"MinNode" : settings["NumNode"] / 2,
"MaxNode" : settings["NumNode"]
}
but I think the solution is nevertheless ok
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
correction :)
> class Graph:
> settings = {
> "NumNodes" : 10,
> "MinNodes" : 2,
> "MaxNodes" : 5
> }
> def randomizeEdges(self,
> lowhigh = (settings["MinNodes"], settings["MaxNodes"])):
of course this should be
Graph.settings["MinNodes"], Graph.sett
set the path so that the XP can run python
without the full path?
Thank you very much
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hello Dennis:
> A second suggestion would be: don't install Python in "Program
> Files", but put it at the top level of the partition (ie; C:\Python24\)
>
I guess your comment is right.
However, I would like to install Python under directory
"C:\Program Files\Python24"
Also, I list some scr
u, is Python there?
>
> Cheers
> Ray
>
> Daniel Mark wrote:
> > Hello all:
> >
> > I have set the PATH for Python as follows:
> >
> > My Computer->Properties->Advanced->Environment Variables->System
> > Variables->Path
> >
>
Hello John:
I did try, however, it doesn't work on my machine.
Thank you
-Daniel
John Salerno wrote:
> Daniel Mark wrote:
>
> > Maybe there is not solution to this problem:)?
>
> Did you not try Sybren's suggestion? Remove the space between the
> semicolon and
from this forum.
My heartfelt thanks go out to John and all friends here:)
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
e Beginner
http://www.amazon.com/gp/product/1592000738/104-2712970-0839936?v=glance&n=283155
which seems to use a game as demo project.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
, but draws some shapes on the input
image.
Thank you
-daniel
--
http://mail.python.org/mailman/listinfo/python-list
###
It works under command line
C:\>python testPath.py
00299.jpg
Done
But it doesn't work after I convert it as EXE application
The error message I got from screen is as follows:
C:\dist>testPath.exe
cannot identify image file
Done
It seems that function 'Image.open' cannot read image file under EXE
application.
What should I do for this problem?
Thank you
-Daniel
--
http://mail.python.org/mailman/listinfo/python-list
PEP 318 provides some great examples:
http://www.python.org/dev/peps/pep-0318/
For more information no the decorator pattern in general:
http://en.wikipedia.org/wiki/Decorator_pattern
How one actually makes use of decorators beyond the above is an
exercise of imagination.
Wolfgang Draxinger wrot
> I'm just building a Python CGI Tutorial and would appreciate any
> feedback from the many experts in this list.
>
> Regards, Clodoaldo Pinto Neto
>
Perhaps you want to post this to the mod_python list as well:
http://mailman.modpython.org/mailman/listinfo/mod_python
--
http://mail.python.org/ma
> Can these operators be overloaded?
> If so. How?
>
http://www.python.org/doc/ref/numeric-types.html
HTH,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
s can be that people encourage
you to write a PEP, this is probably the most important stage, please
see http://www.python.org/dev/peps/ and
http://www.python.org/dev/peps/pep-0001/
7. once you are successful in writing a PEP just submit it and wait
for acceptance/rejection
HTH,
Daniel
--
ht
> > How to execute a linux command by python?
> > for example: execute "ls" or "useradd oracle"
> > Who can help me?
>
> start here:
>
> http://www.python.org/doc/lib/
>
And continue here:
http://www.python.org/doc/lib/os-process.html
--
http://mail.python.org/mailman/listinfo/python-list
e of the format, it is an arbitrary chunk.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
','A'], X(), 4)
how does python handle heterogenous items in the list
in this case?
first I assumed that cmp function used in sort
is based on len, when the items are sequences, but this is wrong
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
Last time I checked PIL was not able to apply lossless transformations
to jpeg images so I've created Python bindings (or is it a wrapper? I
never knew the difference :)) for the jpegtran utility of the
Independent Jpeg Group.
The jpegtran utility is written in C and is very efficient, fa
> Hi all,
>
> Last time I checked PIL was not able to apply lossless transformations
> to jpeg images so I've created Python bindings (or is it a wrapper? I
> never knew the difference :)) for the jpegtran utility of the
> Independent Jpeg Group.
>
> The jpegtran utility is written in C and is very
> folks
> I have two lists
>
> i am trying to loop thorough them simultenously.
>
> Here is the code i am using
[...]
> Is there any efficient doing this
>
Try the zip function:
>>> list1 = [ 'a', 'b', 'c' ]
>>> list2 = [ 'A', 'B', 'C' ]
>>> for i, j in zip( list1, list2 ):
... print i, j
g? Or some other reason which I don't see?
I'm asking because I would like to avoid possible difficulties (which
I don't see yet but maybe someone who has thought about it before for
example PIL developers do) while I try to create bindings for all jpeg
related stuff that can be found on www.ijg.org.
Thanks,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
y the same thing?
Can someone provide an example where 2 patterns yield
different results.
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
nterpreter instances
> (Py_NewInterpreter) with extra GIL in the same process.
If I understand Python/ceval.c, the GIL is really global, not specific
to an interpreter instance:
static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
g. I'm not sure what happens when the garbage
collector looks at objects rooted in another interpreter.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ifferent at all.
Since Python 2.?, there's a mark-and-sweep garbage collection in
addition to the reference counting scheme. This was put into Python to
be able to reclaim object cycles.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
answer then was that
error messages in case of a forgotten colon would be misleading, at the
wrong position, or both.
Today:
if a or b
print x
File "colontest.py", line 2
if a or b
^
SyntaxError: invalid syntax
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
lue in x:
> if key == 'host':
> print value
>
If I were you I would use a dictionary for such a thing:
mydict = dict( password01='unk', host='dragonstone.org', port='1234',
character01='Thessalus' )
And then you would look up host by:
mydict[ 'host' ]
HTH,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
I recently came across the program 'sloccount' that attempts to
calculate the time and money that went into writing software.
http://www.dwheeler.com/sloccount/
If ran on the source code of python 2.5 the results are the following:
Total Physical Source Lines of Code (SLOC) = 689,99
I have a few Python programs that use popen2, and they work quite
nicely and dependably, so I don't really have any reason to change
them to use the new subprocess module...unless of course there any
future plans to deprecate popen2.
Is this something I will have to plan for ?
--
http://mail.pyth
so you won't be able to use multiple CPUs/cores yet.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ariables.
It works better with SELECTs as you can choose the output columns in the
SQL. With stored procedures, there's always the possibility of someone
changing the structure of the result set.
There exists a general library for your solution:
http://opensource.theopalgroup.com/
Daniel
--
[EMAIL PROTECTED] schrieb:
> does anyone know a module or something to convert numbers like integer
> to binary format ?
unfortunately there is no builtin function for this
>>> int("111",2)
7
>>> str(7)
'7'
>>> str(7,2)
Traceback (most recent call last):
File "", line 1, in ?
TypeError: str
(100):
result[c.flip()] += 1
or many many more
the important thing is .. to know what is the
most suitable data representation for you
is it throw-away-code or is this going to be read
by other people .. etc
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> I've been learning python for the past couple of months and writing
> misc scripts here and there, along with some web apps.
> I'm wondering if anyone has ideas of programs I might try my hand at
> making?
You could put together a handy CSS generator library that could be
used from a python weba
> > I made this Python calculator that will take an equation as an input
> > and will display the computed curves on a shiny Tkinter interface
>
> well, it doesn't sound like you're quite as newbie-ish as many other
> newbies ;-)
>
> > Now, I'd like to make this application available on a public we
it's import-ed only once
# magic.py file
#!/usr/bin/python
print "here"
import magic# try to import itself
then try
# bad_magic.py
#!/usr/bin/python
print "here"
import bad_magic
reload(bad_magic)
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
>>> f3()
Traceback (most recent call last):
File "", line 1, in ?
File "", line 5, in wrapped
AssertionError
>>>
I can imagine that stuff like this may be extremely usefull
when testing you program
later one could parse and remove all such assertations
easy and cut them all at once
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> > Scrape means simply scraping pixel colors from locations on the screen.
> > I'll worry about assembling it into meaningful information.
>
> import ImageGrab
> im = ImageGrab.grab()
> v = im.getpixel((x, y))
>
> requires:
>
> http://www.pythonware.com/products/pil/
>
>
##
#
is searching for the \n. Trying to read
too much could lead to deadlocks as well. (Although I'm sure that the
code is written to return fewerbytes than requested if there isn't
enough data pending in the pipe). A safer variant might be to transfer a
fixed number of bytes containing the length n of the following data, and
then n bytes containing the actual data.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
#x27;, 'b', 'c') is probably not what you intend
to do.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
on.org/pipermail/python-list/2000-January/020463.html
for some hints.
I assume that the stream returned by subprocess.popen are also opened in
text mode and you have to change them tobinary, see the second hint in
the link mentioned above.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
robably haven't installed the OpenSSL-dev rpm. When the Python
configure couldn't find the SSL header files, it struck _ssl from the
list of compilable modules.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ame))?\s*;',
re.DOTALL | re.MULTILINE | re.IGNORECASE)
something must be wrong with (?P\w+) inside the main pattern
thanks in advance
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
tion, so my question is
does it make sence to have
except:
print "unknown exception in PackageParser"
sys.exit(1)
or is it a dead code?
are there some good reference sources to see what file() and read()
may throw, IMHO it
uot; then ... dead code is more like
if False:
do_something()
thank you
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
one:
print "nothing"
sys.exit(1)
print m.group("content")
print m.group("name")
# testing
bash % ./parser.py
nothing
ps:
>>> sys.version
'2.4.2 (#2, Mar 3 2006, 13:32:59) \n[GCC 3.2.2 20030222 (Red Hat Linux
3.2.2-5)]'
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
"Paul McGuire" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Shouldn't
>
> End Package Test;
>
> read:
>
> End Package Test123;
>
>
> -- Paul
yes it must :)
my mistake
thx
--
http://mail.python.org/mailman/listinfo/python-list
gt;
> I gather that there's a path problem then. My script is in
> ~/pyscripts/. How do I get my scripts to run without using "./"?
Add ~/pyscripts to your path for example by putting this into your
.bash_profile if you are using bash:
PATH=$PATH:$HOME/pyscripts
export PATH
HTH,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
601 - 700 of 1788 matches
Mail list logo