Re: indentation

2008-10-20 Thread GHUM
> I can't remember having seen any other "standard" so far. there is this meme flowing around: Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not inden

messages from pylint - need some reasoning

2008-10-17 Thread GHUM
Hello, I am pylinting some software of mine. Now pylint throws messages, and I know of pylint --help-msg to get some more text. What is missing out are explanation, WHY some things are bad, so I am searching for explanations and ways to improve my code: Example: 1st) "to many local variables" I

Re: translating "create Semaphore" to Linux

2008-08-29 Thread GHUM
Tim, > ... why use a Semaphore rather than a Mutex? as much as I understood the documentation at MSDN http://msdn.microsoft.com/en-us/library/ms686927(VS.85).aspx http://msdn.microsoft.com/en-us/library/ms686946(VS.85).aspx a mutex seems to be nothing else than a special case of a semaphore? Th

translating "create Semaphore" to Linux

2008-08-29 Thread GHUM
hello, in my application I am using hSem = win32event.CreateSemaphore (None, 1, 1,"stringincludinginterfaceandport") rt=win32event.WaitForSingleObject (hSem, 0) if rt != win32event.WAIT_TIMEOUT: really_do_start_my_app() else: print "application allready running" to make sure that only ONE

Re: Corrupted images after attempting to store PNG images as BLOBs in MySQL?

2008-08-13 Thread GHUM
Keith, > still becoming familiar with python. Originally we were not using the > database to store images, > but we started testing out storing images there as well as meta-data. just a remark: I am using PostgreSQL to store BLOB-Data as there are "Images", "PDFs", "Microsoft Office Files". The

Re: is it possible to add a property to an instance?

2008-07-22 Thread GHUM
> Does anyone know if it is possible to add a property to an instance at > runtime? I didn't see anything about it in the standard library's new > module, google hasn't turned up much either. yes. You need nothing special, just add it: class fish(object): pass a=fish() a.legs=4 print a.legs

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread GHUM
Evan, > I hear this problem is fixed in 0.6.8, but unfortunately there's no > standalone installer for py2exe 0.6.8 - the most recent version that Maybe you can solve your problem via updating the build_exe.py after installing py2exe 0.6.6 So: a) use the 0.6.6 installer b) update the build_exe.p

Re: Python Success stories

2008-04-22 Thread GHUM
> Which big aplications are written in python. I see its development, There are no big applications written in Python. Big applications are written in JAVA or COBOL or C# or other legacy programming systems. If you programm in Python, your applications become quite small. Only frameworks in Pyth

Re: Python-by-example - new online guide to Python Standard Library

2008-04-02 Thread GHUM
Tobu, I like this idea. Deducting from an example is really another way to wisdom. What struck me as most diffuclt to understand: abs(-5.5) - 5.5 -> you are using "-" as symbol for "will give the result", which is really, really hard to parse. Take something else, please. Unicode has THAT many

how long do the different python-vm bytecodes take?

2008-03-17 Thread GHUM
I looked at the virtual machine bytecode of python programs: def f(whatever): text="Hallo"+whatever return text import dis dis.dis(f) 2 0 LOAD_CONST 1 ('Hallo') 3 LOAD_FAST0 (whatever) 6 BINARY_ADD 7 STORE

Re: app runs fine with interpreter, but not under py2exe

2008-03-16 Thread GHUM
Doug, > as I quickly noticed that "library.zip" does NOT contain ANY .pyd files. > I'm guessing that they can't be in library.zip for a reason (i.e., they are > DLL files, essentially, and thus must be readily available to be loaded > into memory). .dll and .pyd files CAN be within library.zip an

Re: app runs fine with interpreter, but not under py2exe

2008-03-13 Thread GHUM
Doug, > Precision.py is part of the Numeric package. AFAIKT, the problem is during > the module initialization. The first lines of Precision.py are: > > from multiarray import zeros > import string > [.] and your program is crashing on the lst.append( (zeros( (1,), t ).itemsize()*8, t) )

Re: Py2exe and Multi Treading problem.

2008-03-12 Thread GHUM
Farsheed Ashouri , > Here is my script > #** > #** > import threading > import socket > def openSocket(portNum): > mySocket = socket.socket ( socket.AF_INET,

Re: app runs fine with interpreter, but not under py2exe

2008-03-12 Thread GHUM
Doug, > File "VisionTrainer.py", line 49, in > File "SessionController.pyc", line 53, in > File "VisionEgg\__init__.pyc", line 42, in > File "VisionEgg\ParameterTypes.pyc", line 28, in > File "Numeric.pyc", line 93, in > File "Precision.pyc", line 26, in > File "Precision.pyc",

Re: translating Python to Assembler...sorry if this is duplicated...it's unintentional

2008-01-23 Thread GHUM
> My expertise, if any, is in assembler. I'm trying to understand Python > scripts and modules by examining them after they have been > disassembled in a Windows environment. Maybe you could also profit from diassembling Pythons bytecode into MNEmonics of the Python Virtual Machine ? http://docs.

Re: building psycopg2 on windows using mingw, "cannot find -lpq"

2008-01-22 Thread GHUM
> I use psycopg2 all the time on windows. I use the binary installer > instead of source. Works great for me. > > -Tom Me2. Just in 7 out of 200 it does not work with the currently available binary installer, on some startups, so I decided to follow a recommendation out of the psycopg2 list to comp

Re: building psycopg2 on windows using mingw, "cannot find -lpq"

2008-01-22 Thread GHUM
> > The compile works, BUT linking fails: > > > 2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc: > > \python25\PCBuild -Lc:/p > > ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build > > >  -Lc:/postgres/83RC2/lib > > Are you sure using forward slashes in the path works here? Not

building psycopg2 on windows using mingw, "cannot find -lpq"

2008-01-21 Thread GHUM
The compile works, BUT linking fails: 2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc: \python25\PCBuild -Lc:/p ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build \lib.win32-2.5\psy copg2\_psycopg.pyd c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot

Re: Intranet Project - Rad Or Waterfall

2008-01-08 Thread GHUM
> Option 1 - Waterfall I recommend to google "waterfall". First hit after those beatifull pictures will be: http://en.wikipedia.org/wiki/Waterfall_model Within the first paragraph there is: """Ironically, Royce was actually presenting this model as an example of a flawed, non-working model.(

create pywintypes.CreateGuid() compatible guids on Linux ?

2007-11-27 Thread GHUM
Hello, I created lots of guids via pywintypes.CreateGuid() on windows. Now I would like to run the same software on Linux / Solaris / FreeBSD. So I should produce "compatible" GUIDS on that systems. "compatible" having the meaining: "Providing similiar likelehood of collisions". of course "go

Re: OPLC purchase period extended

2007-11-25 Thread GHUM
> > [http://laptopgiving.org/en/terms-and-conditions.php] > > I'm sure that some people would be willing to serve as middleware... So, which US-Pythoneer is willing to serve as middleware for my buying of the XO? Please contact me. Harald -- GHUM Harald Massa persuadere et p

Re: Yet another comparison of Python Web Frameworks

2007-10-10 Thread GHUM
Michele, > At work we are shopping for a Web framework, so I have been looking at > the available options on the current market. just because you were involved in creating an own version of Python does NOT free you from the social obligation to create your own Python web framework. So stop shoppi

Re: import data.py using massive amounts of memory

2007-06-27 Thread GHUM
> Note that once it has made the .pyc file the subsequent runs take even > less memory than the cpickle import. Could that be the compiler compiling? Without knowing to much details about that process, but from 2.4 to 2.5 the compiler was totally exchanged, to AST. That would explain the drop f

EuroPython: Draft program posted, today last day of early registration

2007-06-08 Thread GHUM
Dear Pythonistas! On www.euroypython.org the draft program and timetable has been posted! http://www.europython.org/sections/tracks_and_talks/draft-timetable Do a click and check out the fabulous talks. Then check in, best today, the 8th of June, the last day of early bird registration. EuroPyt

EUROPYTHON: Talk submission deadline extended up to Friday, 25th of May

2007-05-20 Thread GHUM
We took longer then planned to open the registration. Some potential speakers came in late. To make it even, we extended talk submission deadline for ONE WEEK. New deadline is Friday, 25th of May 2007. So, if you made a fortune with Python: tell others about it at EuroPython. If you have a gre

Re: While we're talking about annoyances

2007-04-29 Thread GHUM
Steven, > def index(sequence): > decorated = zip(sequence, xrange(len(sequence))) > decorated.sort() > return [idx for (value, idx) in decorated] would'nt that be equivalent code? def index(sequence): return [c for _,c in sorted((b,a) for a, b in enumerate(sequence))] tested, g

Re: cx_Oracle and unicode data

2007-03-15 Thread GHUM
loo ping, > But it's not what I call a 'clean' solution and I suppose that it must > exist another way to force the client DB to use UTF8, or another > solution to get my data. I share your feeling. I asked a similiar question ~1 year ago; and: your solution is the only one. The oracle-libs get

Re: Questions about app design - OOP with python classes

2007-03-02 Thread GHUM
> > if hmmCurrentHeight <= hinCriticalHeight: > then you should instantly recognise that there's a problem. all civilized nations but one use metric systems. Of course there is a problem if you spot inches somewhere. Harald -- http://mail.python.org/mailman/listinfo/python-list

Re: New Pythin user looking foe some good examples to study

2007-02-12 Thread GHUM
Johnny, look no further than your harddrive. The Python Standard Lib is full of code examples of Python programming for various uses. Just find where your packagemanager has installed them; within windows it is usually python24/lib or python25/lib I suspect them to be below usr/lib on linux.

Re: win32com.client

2007-02-02 Thread GHUM
btw... the statement with "youtube" was a joke. I really applaud rzed you for giving this detailed descriptions, people like him make the spirit of c.l.p.: People get help here WAY over what commercial support usually gets you. Thanks for doing that, rzed! best wishes, HArald -- http://mail.p

Re: win32com.client

2007-02-02 Thread GHUM
rzed, > 1) In your browser, enter this URL:http://sourceforge.net/projects/pywin32/ > [...] > Try those steps, then try importing win32com again. man, you are SO 2005. Could'nt you please make a screen cap video, upload it to youtube and give a pointer to it on your blog? *wink* Harald --

sheeps be carefull of Python

2007-01-06 Thread GHUM
sometimes Python is more dangerous than documented: http://news.nationalgeographic.com/news/2006/09/060915-python-ewe.html Harald -- http://mail.python.org/mailman/listinfo/python-list

Re: Roundtrip SQL data especially datetime

2006-12-18 Thread GHUM
> One side effect of this being third party code is that hosting > services may not have it available, even when they have both Python > and MySQL up. This is never a problem with Perl or PHP, so that's > a negative for Python. I for one think it is a good thing to not have MySQL adapters int

how to get all the "variables" of a string formating?

2006-12-06 Thread GHUM
imagine: template=""" Hello %(name)s, how are you %(action)s""" we can use it to do things like: print template % dict (name="Guido", action="indenting") Is there an easy (i.e.: no regex) way to do get the names of all parameters? get_parameters(template) should return ["name", "action"]

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

2006-11-04 Thread GHUM
robert, > Interprocess communication is tedious and out of questio [...] > I expect to be able to directly push around Python Object-Trees between the 2 > (or more) interpreters by doing some careful locking. Please do yourself a favour and have a look at pyro. pyro makes InterComputer and Inter

Re: codecs - where are those on windows?

2006-11-04 Thread GHUM
Fredrik Lundh schrieb: > > If your installation directory is C:\Python25, then look in > > C:\Python25\lib\encodings > > that's only the glue code. the actual data sets are provided by a bunch > of built-in modules: > >>> import sys > >>> sys.builtin_module_names > ('__builtin__', '__main__',

codecs - where are those on windows?

2006-10-30 Thread GHUM
I stumbled apon a paragraph in python-dev about "reducing the size of Python" for an embedded device: """ In my experience, the biggest gain can be obtained by dropping the rarely-used CJK codecs (for Asian languages). That should sum up to almost 800K (uncompressed), IIRC. """ So, my question is

Re: python html rendering

2006-10-04 Thread GHUM
Pierre, > Hi, Im looking for a way to display some python code > in html: with correct indentation, possibly syntax hiliting, dealing > correctly with multi-line comment, the usual way is to create your own web-framework If it is just "some" Python code and you have to do it "once", just look

Re: Best way to handle large lists?

2006-10-04 Thread GHUM
> > Maybe the application should use sets instead of lists for these > > collections. > What would sets do for me over lists? searching for an element in a list is O(n) searching for an element in a set is O(1) (for reasonable distributed elements) Harald -- http://mail.python.org/mailman/lis

Re: does anybody earn a living programming in python?

2006-09-27 Thread GHUM
walterbyrd, Answer: Yes. Definitely. And, to be correct, there are some who earn a rather comfortable living programming in Python. > If so, I doubt there are many. depending on your definition of "many". if "many" is something around "1% of population of earth", you are right. If "many" is "mo

Re: Talking to marketing people about Python

2006-09-25 Thread GHUM
Roy Smith schrieb: > > Can anybody suggest some good material I can give to him which will help > explain what Python is and why it's a good thing, in a way that a > marketing/product management person will understand? please also look for the "Python success stories" There is also a aviation con

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-19 Thread GHUM
Magnus Lycka schrieb: > > http://effbot.org/zone/python-objects.htm > > may be useful for those who haven't already seen it. > >Shouldn't it be incorporated into the standard tutorial? >I think it's very helpful for people who are used > to the way C etc handles variables. That would also be

PIL 2.5 win32 binaries?

2006-09-18 Thread GHUM
On the PIL website I read: The current free version is PIL 1.1.5, which has been tested with Python 1.5.2 and newer, including 2.3 and 2.5. but in downloads I cannot see any binaries for windows and Python 2.5 Are they somewhere available? Best wishes, Harald -- http://mail.python.org/mailma

Re: Python programs always open source?

2006-09-18 Thread GHUM
Guy Fawkes schrieb: > I don't want my program to > be open-source and so far all the Python programs I've seen included the > source code. That's one of the great freedoms of Python and its licence: You are free to chose the licence for your product. No GPLish "you must be as free as we", more BS

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread GHUM
(result, $1); RETURN result; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; within python: cs.execute("select insfeuser(%(name)s)", dict(name="Karl Napf")) newid=cs.fetchone()[0] Hope that helps, Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Reinsburgstraße 202b 70197 Stuttgart 0173/9409607 -- http://mail.python.org/mailman/listinfo/python-list

accessing the DHCP Server Management API

2006-09-06 Thread GHUM
Hello, I need to get a list of active leases on a windows dhcp server. Experts from Microsoft statet: A: Go to the Address leases of each scope in the DHCP snap-in and dump the leases to a text file from the DHCP server snap-in. The text file gives you all the information for every active l

Re: programming with Python 3000 in mind

2006-08-24 Thread GHUM
Steven, you ask good questions! > (2) Will there be automated tools for converting source code from Python 2 > to Python 3000? If you would have been to the EuroPythom 2006, you may have heard the plans for PyPy 2.0; which may have per-module-switchable syntax compatibility for Py 2.2-3000. So b

Re: Python and STL efficiency

2006-08-23 Thread GHUM
Mc Osten schrieb: > Yes it is. But of course you can't sat that "Python is faster than C++". Of course not. Python is faster then assembler. Proofed @ EuroPython 2006 in CERN, near the LHC Beta, in the same room many Nobel laurates gave their presentations before. Harald -- http://mail.python.

Re: Compiling wxPython app for Windows; Single EXE

2006-08-15 Thread GHUM
Daniel, I am using py2exe since more then 4 years, so I am rather biased. I read PyInstaller page and was positively impressed by the manual and all the good words. There is one major difference which will keep me with py2exe: with PyInstaller and single file there is: "When first started, it fi

win32 load icon not from file, but from

2006-08-10 Thread GHUM
I have found a "make a icon in traybar" skript, and it loads its Icon from a file hinst = win32gui.GetModuleHandle(None) iconPathName= "c:/myapp/myapp.ico" icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE hicon = win32gui.LoadImage(hinst, str(iconPathName), win32con.IMAGE_ICON, 0,

need hint for refactoring

2006-08-09 Thread GHUM
I have a bunch of function like: def p2neufrage(_): """ create new element""" anfrage,ergebnis=getanfrage() if ergebnis.get("status","ok") == "ok": wert=anfrage["feld"] # do something # unique here ergebnis["innerHTML"]=. something #

Re: need help of regular expression genius

2006-08-03 Thread GHUM
Paul, > Pyparsing ships with JPG and PNG files containing class diagrams, plus an > htmldoc directory containing epydoc-generated help files. > There are also about 20 example programs included (also accessible in the > wiki). Yes. That's what I have been missing. Maybe you could add: "please als

Re: need help of regular expression genius

2006-08-03 Thread GHUM
Paul, > text = """ ... input source text ... "" > from pyparsing import SkipTo,Literal,replaceWith > ign1 = "$$" + SkipTo("$$") + "$$" > ign2 = "$_$" + SkipTo("$_$") + "$_$" > semi = Literal(";").setParseAction( replaceWith("; <***>") ) > print (ign1 | ign2 | semi).transformString(text) Thank you

need help of regular expression genius

2006-08-02 Thread GHUM
I need to split a text at every ; (Semikolon), but not at semikolons which are "escaped" within a pair of $$ or $_$ signs. My guess was that something along this should happen withing csv.py; but ... it is done within _csv.c :( Example: the SQL text should be splitted at "" (of course, those "spl

Last Call - proposals for talks in the business and application track at EP 2006

2006-05-29 Thread GHUM
In 2006, EuroPython will be from the 3rd to the 5th of July at CERN, near Geneva in Switzerland. In business & applications we want to hear about how you made your fortune with Python. Show us YOUR interesting released Python applications. Describe your fabulous business models with Open Source So

propose extension of mimetypes

2006-05-28 Thread GHUM
Hello, mimetypes lacks the guessing of .svg as image/svg+xml mimetypes.add_type("image/svg+xml",".svg", True) maybe this can be added to python 2.5 standard library Harald -- http://mail.python.org/mailman/listinfo/python-list