Re: A tuple in order to pass returned values ?

2011-10-05 Thread Daniel Dorani
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

Re: SQLObject 1.2.0

2011-11-21 Thread Daniel Fetchinson
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

defining class and subclass in C

2012-01-14 Thread Daniel Franke
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

Re: defining class and subclass in C

2012-01-14 Thread Daniel Franke
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

building foo.pyd, _initfoo vs. initfoo

2012-01-22 Thread Daniel Franke
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

Re: subclassable types

2013-02-22 Thread Daniel Urban
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 >&

My gui

2013-04-24 Thread Daniel Kersgaard
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

allow_none=True in SimpleXMLRPCServer

2005-12-12 Thread Daniel Crespo
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

Re: Still Loving Python

2005-12-14 Thread Daniel Crespo
ch better than PyGTK. PyGTK is good if you intend to develop for Linux. Daniel -- http://mail.python.org/mailman/listinfo/python-list

How to get the local mac address?

2005-12-14 Thread Daniel Crespo
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

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Daniel Crespo
Good question, I have the same anxiety. Thanks Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Still Loving Python

2005-12-14 Thread Daniel Crespo
> 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

Re: allow_none=True in SimpleXMLRPCServer

2005-12-14 Thread Daniel Crespo
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

Re: Still Loving Python

2005-12-14 Thread Daniel Crespo
By the way: > Under windows, only needs some dlls py2exe does this job :) Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the local mac address?

2005-12-14 Thread Daniel Crespo
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

object oriented programming question

2005-12-17 Thread Daniel Nogradi
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

Re: object oriented programming question

2005-12-18 Thread Daniel Nogradi
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

outb, inb?

2005-12-18 Thread Daniel Schüle
eas welcome Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: object oriented programming question

2005-12-19 Thread Daniel Nogradi
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)

Re: coupling python scripts

2005-12-19 Thread Daniel Nogradi
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

Re: How to get the local mac address?

2005-12-19 Thread Daniel Crespo
> 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

Re: allow_none=True in SimpleXMLRPCServer

2005-12-20 Thread Daniel Crespo
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

Re: How to check if a string "is" an int?

2005-12-21 Thread Daniel Schüle
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

Re: Windows and python execution

2005-12-27 Thread Daniel Dittmar
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

A weird problem (adodb + mysql)

2006-01-05 Thread Daniel Crespo
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

Re: Copy an Object (Again?)

2006-01-06 Thread Schüle Daniel
[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("

Re: Copy an Object (Again?)

2006-01-06 Thread Schüle Daniel
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

decorator question

2006-01-08 Thread Schüle Daniel
... 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: decorator question

2006-01-08 Thread Schüle Daniel
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

An app without GUI

2006-01-10 Thread Daniel Crespo
. 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

rational numbers

2006-01-17 Thread Schüle Daniel
re, like complex numbers (maybe in Python 3) Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Daniel Dittmar
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

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Daniel Dittmar
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,

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Daniel Dittmar
ding the cursors with an actual cursor object. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple modules with database access + general app design?

2006-01-20 Thread Daniel Dittmar
seem to be that essential to Python thread programming. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: DB API and thread safety

2006-01-20 Thread Daniel Dittmar
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: running python from a memory stick?

2006-07-13 Thread Daniel Dittmar
re\2.4 (or whatever version you're using) Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: When writing text. . .

2006-07-14 Thread Daniel Nogradi
> 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

instantiate all subclasses of a class

2006-07-16 Thread Daniel Nogradi
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

Re: instantiate all subclasses of a class

2006-07-16 Thread Daniel Nogradi
> > 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 >

Re: instantiate all subclasses of a class

2006-07-16 Thread Daniel Nogradi
> > >>> 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

Re: instantiate all subclasses of a class

2006-07-16 Thread Daniel Nogradi
> > 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

Re: Help!

2006-07-17 Thread Daniel Nogradi
> 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:

Re: Google Earth contact? (OT, sort of...)

2006-07-18 Thread Daniel Fischer
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

Re: How to use ParseTuple with unknown number of args?

2006-07-18 Thread Daniel Dittmar
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

Re: Using Visual Slick Edit for Python

2006-07-18 Thread Daniel Dittmar
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

Re: CSV with comments

2006-07-18 Thread Daniel Dittmar
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

Re: Coding style

2006-07-18 Thread Daniel Dittmar
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

Re: Partial classes

2006-07-19 Thread Daniel Dittmar
ll methods of HandcraftedPerson.Person into GeneratedPerson.Person is left as an exercise. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV with comments

2006-07-19 Thread Daniel Dittmar
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

Re: simple question

2006-07-25 Thread Schüle Daniel
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

self question

2006-07-25 Thread Schüle Daniel
choosen? Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: self question

2006-07-25 Thread Schüle Daniel
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

Re: self question

2006-07-25 Thread Schüle Daniel
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

Why XP can not run Python after being setting the PATH?

2006-07-27 Thread Daniel Mark
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

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
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

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
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 > > >

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
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

Re: Why XP can not run Python after being setting the PATH?

2006-07-28 Thread Daniel Mark
from this forum. My heartfelt thanks go out to John and all friends here:) -Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner Textbook

2006-08-15 Thread Daniel Dittmar
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

How to draw line on Image?

2006-08-18 Thread Daniel Mark
, but draws some shapes on the input image. Thank you -daniel -- http://mail.python.org/mailman/listinfo/python-list

py2exe: cannot identify image file

2006-08-18 Thread Daniel Mark
### 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

Re: What are decorated functions?

2006-08-22 Thread Daniel O'Brien
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

Re: CGI Tutorial

2006-10-05 Thread Daniel Nogradi
> 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

Re: operator overloading + - / * = etc...

2006-10-07 Thread Daniel Nogradi
> 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

Re: Python component model

2006-10-09 Thread Daniel Nogradi
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

Re: How to execute a linux command by python?

2006-10-18 Thread Daniel Nogradi
> > 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

Re: can't open word document after string replacements

2006-10-24 Thread Daniel Dittmar
e of the format, it is an arbitrary chunk. Daniel -- http://mail.python.org/mailman/listinfo/python-list

basic questions on cmp, < and sort

2006-10-25 Thread Schüle Daniel
','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

lossless transformation of jpeg images

2006-10-29 Thread Daniel Nogradi
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

Re: lossless transformation of jpeg images

2006-10-29 Thread Daniel Nogradi
> 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

Re: looping through two list simultenously

2006-10-29 Thread Daniel Nogradi
> 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

Re: lossless transformation of jpeg images

2006-10-30 Thread Daniel Nogradi
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

re question

2006-11-01 Thread Schüle Daniel
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

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-03 Thread Daniel Dittmar
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

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-03 Thread Daniel Dittmar
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

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-03 Thread Daniel Dittmar
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

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Daniel Dittmar
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

Re: Lists of lists and tuples, and finding things within them

2006-11-09 Thread Daniel Nogradi
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

Useless thread about some useless statistics

2006-11-16 Thread Daniel Nogradi
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

Will subprocess eventually deprecate popen2 ?

2006-11-16 Thread Daniel Klein
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

Re: Is anybody knows about a linkable, quick MD5/SHA1 calculator library ?

2006-05-30 Thread Daniel Dittmar
so you won't be able to use multiple CPUs/cores yet. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: DB-API: how can I find the column names in a cursor?

2006-06-01 Thread Daniel Dittmar
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 --

Re: integer to binary...

2006-06-01 Thread Schüle 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

Re: beginner code problem

2006-06-02 Thread Schüle Daniel
(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

Re: ideas for programs?

2006-06-04 Thread Daniel Nogradi
> 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

Re: newbie: python application on a web page

2006-06-06 Thread Daniel Nogradi
> > 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

Re: Importing again and again

2006-06-08 Thread Schüle Daniel
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

Re: @func call syntax

2006-06-11 Thread Schüle Daniel
>>> 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

Re: Screen Scraping for Modern Applications?

2006-06-11 Thread Daniel Nogradi
> > 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/ > > ## #

Re: Duplex communication with pipes - is possible ?

2006-06-16 Thread Daniel Dittmar
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

Re: XML, JSON, or what?

2006-06-16 Thread Daniel Dittmar
#x27;, 'b', 'c') is probably not what you intend to do. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Duplex communication with pipes - is possible ?

2006-06-20 Thread Daniel Dittmar
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

Re: 'module' object has no attribute 'ssl'

2006-06-21 Thread Daniel Dittmar
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

re question

2006-06-23 Thread Daniel Sch
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

what exceptions may file() and read() throw?

2006-06-23 Thread Daniel Sch
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&#x

Re: what exceptions may file() and read() throw?

2006-06-23 Thread Daniel Sch
uot; then ... dead code is more like if False: do_something() thank you Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: re question

2006-06-23 Thread Daniel Sch
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

Re: re question

2006-06-23 Thread Daniel Sch
"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

Re: Getting Python scripts to execute in RedHat

2006-06-23 Thread Daniel Nogradi
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

<    2   3   4   5   6   7   8   9   10   11   >