> 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
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
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
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
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
> 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
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
> 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
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
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
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
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) )
Farsheed Ashouri ,
> Here is my script
> #**
> #**
> import threading
> import socket
> def openSocket(portNum):
> mySocket = socket.socket ( socket.AF_INET,
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",
> 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.
> 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
> > 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
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
> 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.(
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
> > [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
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
> 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
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
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
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
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
>
> 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
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.
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
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
--
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
> 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
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"]
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
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__',
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
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
> > 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
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
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
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
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
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
(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
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
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
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.
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
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,
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
#
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
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
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
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
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
56 matches
Mail list logo