Python 3.8 pip installation on Windows 7

2023-02-14 Thread christoph sobotta via Python-list
Hello, The installation file Python-3.8.10.exe (last version compatible with Windows 7 (32 bit) ? ) does not automatically install pip on Windows 7. Are there compatibility problems with Windows 7 ? See attachment log file Greetings C.Sobotta ... MSI (s) (3C:FC) [13:32:28:993]: Hello, I'm your

pythonpath in ipython console

2017-07-12 Thread christoph
hello, I am a bit confused, i use spyder, when i execute in ipython console program start fails with message 'Attribute error' when I start same program via python console everything works fine, even start from terminal workes fine. It seems that i python does not load Pythonpath, although wdir

pycrypto

2015-11-04 Thread Christoph Zallmann
Hey there, i tried using Python 3.5.0 in combination with pycrypto and everything i got was crap. Really. I tried so many things, how to solve my problem - using environment variables, vs 2015 and many more. With python 2.7 or even 3.4 i heard it was no problem but using 3.5 all i got was one e

Re: Do you like the current design of python.org?

2014-12-09 Thread Christoph M. Becker
r it is useful (because it conveys correct information) or it is harmful (because it keeps visitors from submitting an explicit bug report). -- Christoph M. Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on lambdas

2014-12-09 Thread Christoph M. Becker
Ben Finney wrote: > Christoph Becker writes: > >> Ben Finney wrote: >> >>> It's best to remember that ‘lambda’ is syntactic sugar for creating >>> a function; the things it creates are not special in any way, they >>> are normal functions, n

Re: Question on lambdas

2014-12-08 Thread Christoph Becker
n beginner (not new to programming, though), and rather confused about your statement. -- Christoph M. Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread Christoph M. Becker
-) ACK. However, isn't log-out an idempotent action? -- Christoph M. Becker -- https://mail.python.org/mailman/listinfo/python-list

Content-Type (was: Fwd: Python Signal/Slot + QThred code analysis)

2014-11-25 Thread Christoph M. Becker
Juan Christian wrote: > OFF-TOPIC: You guys said that my emails had some trash HTML and strange > stuffs, is it OK now? You're still sending: Content-Type: multipart/alternative Please configure your MUA to send Content-Type: text/plain only. -- Christoph M. Becker

Re: Cycle around a sequence

2012-02-07 Thread Christoph Hansen
Mark Lawrence schrieb: I'm looking at a way of cycling around a sequence i.e. starting at some given location in the middle of a sequence and running to the end before coming back to the beginning and running to the start place. About the best I could come up with is the following, any better id

Re: SciPy/NumPy: read, write images using Python3

2011-10-15 Thread Christoph Gohlke
On Oct 9, 8:43 am, thegripper wrote: > In SciPy / NumPy, the primary way to read and write images is PIL. But > PIL does not yet support Python3. Is there some good way to read, > write, and resize images in a NumPy and Python3 environment? Try Scikits.image . It uses a

Re: How do I get curses to work in Python 3.2 on win-64?

2011-10-15 Thread Christoph Gohlke
On Oct 15, 1:13 pm, Jan Sundström wrote: > How do I get curses to work in Python 3.2 on win-64? > > I'm new to Python and when exploring Python in console I want to use > some > simple functions for console programming that don't emulate a > typewriter > terminal but rather a text screen terminal.

Re: problem with bcd and a number

2011-08-04 Thread Christoph Hansen
MRAB schrieb: The value is MSB * 100 + (LSB>> 4) * 10 + (LSB& 0xF) i would say (MSB >> 4)*100 + (MSB & 0xF)*10 + (LSB >> 4) but who knows -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with bcd and a number

2011-08-04 Thread Christoph Hansen
nephish schrieb: thanks for any tips on this. I'll try. In BCD a (decimal) digit is stored in a halfbyte (or a 'nibble'). So, in a byte you can store two decimal digits. For instance 42 would be nibble1 nibble2 0100 0010 42 >>> c=0b0110 >>> c 66 >>> c >> 4

Re: connect SIGINT to custom interrupt handler

2011-05-18 Thread Christoph Scheingraber
On 2011-05-15, Miki Tebeka wrote: > Why not just catch KeyboardInterrupt? Would it be possible to continue my program as nothing had happened in that case (like I did before, setting a flag to tell main() to finish the running data download and quit instead of starting the next data download {it'

Re: connect SIGINT to custom interrupt handler

2011-05-15 Thread Christoph Scheingraber
On 2011-05-15, Thomas 'PointedEars' Lahn wrote: > > Obviously. `signal' refers to an `int' object, probably by something like > > signal = 42 > > before. E.g. `print' or a debugger will tell you, as you have not showed > the relevant parts of the code. The problem is that I am running someon

Re: connect SIGINT to custom interrupt handler

2011-05-15 Thread Christoph Scheingraber
result: File "/usr/local/bin/obspysod", line 586, in interrupt_handler signal.siginterrupt(signal.SIGINT, False) AttributeError: 'int' object has no attribute 'siginterrupt' Could there be a namespace problem? On 2011-05-15, Nobody wrote: > On Sun, 15 M

Re: dict: retrieve the original key by key

2011-05-15 Thread Christoph Groth
Steven D'Aprano writes: > On Sun, 15 May 2011 11:11:41 +0200, Christoph Groth wrote: > >> I would like to avoid having _multiple_ objects which are equal (a == >> b) but not the same (a is not b). This would save a lot of memory. > > Based on the idea of intern

connect SIGINT to custom interrupt handler

2011-05-15 Thread Christoph Scheingraber
Hi, I am trying to connect SIGINT (^c) to a custom interrupt handler like this (no threading, just straightforward): if __name__ == "__main__": quit = False def interrupt_handler(signal, frame): global quit if not quit: print "blabla, i'll finish my task and quit kind of messag

Re: dict: retrieve the original key by key

2011-05-15 Thread Christoph Groth
Chris Rebert writes: > On Sun, May 15, 2011 at 1:28 AM, Christoph Groth wrote: >> I use a huge python dictionary where the values are lists of that >> dictionary's keys (yes, a graph).  Each key is thus referenced >> several times. >> >> As the keys are

dict: retrieve the original key by key

2011-05-15 Thread Christoph Groth
alues in my dictionary. Is there a better solution? thanks, Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting an array of string to array of float

2011-03-25 Thread Christoph Brand
If you want to have it even shorter and you are using Python 2.5 or greater you can also use: list1 = [float(list_item) for list_item in list1] Am 25.03.2011 16:27, schrieb Jason Swails: I'm guessing you have something like list1=['1.0', '2.3', '4.4', '5.5', ...], right? You can do this: for

Re: distutils, cygwin, ' not a regular file

2010-11-15 Thread Christoph Michalke
ed in on Windows with CR LF line endings and now you are reading it in cygwin (or in any Unix like environment) and you are getting a file name "sample.py\r" instead of "sample.py". The file "sample.py" exists and is a regular file. But the file "sample.py\

Re: Python use with Mightex Buffer USB camera

2010-10-27 Thread Christoph Gohlke
On Oct 27, 7:16 am, Greg Miller wrote: > Does anyone have any experience using Python and ctypes to interface > with one of the Mightex USB cameras?  I am following the CPP code > example and so far I think I've done pretty well talking to the dll. > I am able to get serial number information back

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Christoph Gohlke
On Aug 8, 9:54 pm, "W. eWatson" wrote: > On 8/8/2010 5:51 PM, Steven D'Aprano wrote: > > > On Sun, 08 Aug 2010 16:15:45 -0700, W. eWatson wrote: > > >> To suggest Google as above, makes no sense to me. This is the place to > >> ask, as another poster stated. > > > He may have stated it, but the ev

Re: constructing an object from another instance of the same class

2010-06-18 Thread Christoph Groth
Steven D'Aprano writes: > On Fri, 18 Jun 2010 16:30:00 +0200, Christoph Groth wrote: > >> If other is of type Base already, just "pass it on". Otherwise, >> construct an instance of Base from it. >> >> *

Re: constructing an object from another instance of the same class

2010-06-18 Thread Christoph Groth
My confusion arose from the expectation that there had to be some mechanism to do the conversion automatically. But actually a simple def bar(arg): if not isinstance(arg, Base): arg = Base(arg) # Do something with arg. is a simple and explicit solution of the problem. Th

Re: constructing an object from another instance of the same class

2010-06-18 Thread Christoph Groth
Bruno Desthuilliers writes: >> It seems to me that in this way I might get problems when I pass an >> instance of Derived_from_my_type to bar, as it will become an >> instance of My_type. > > The instance you pass to bar won't "become" anything else. You create > a new My_type instance from the D

constructing an object from another instance of the same class

2010-06-18 Thread Christoph Groth
reference to My_type. Then I could use it directly with instances of My_type, Derived_from_my_type and other types which can be converted into My_type. thanks Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread Christoph Zwerschke
m here. The solution suggested in that thread, using a dual-stacked socket for the TCPserver, seems a good one to me. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread Christoph Zwerschke
rdmur...@bitdance.com schrieb: Quoth Christoph Zwerschke : With Py 2.3 (without IPv6 support) this is only the IPv4 address, but with Py 2.4-2.6 the order is (on my Win XP host) the IPv6 address first, then the IPv4 address. Since the IPv6 address is checked first, this gives a

Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread Christoph Zwerschke
or connect to 'localhost', you will always consistently do this via IPv4 or IPv6, depending on what is preferred on your platform. Does this sound reasonable? Any better ideas? -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing exceptions in PEP 3107

2008-08-17 Thread Christoph Zwerschke
ould be clearer here and explicitly mention the thrown exceptions as a use case instead of only speaking about return values. Of course, if you're Dutch, it may be obvious, but for a dimwitted German things are not always obvious. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing exceptions in PEP 3107

2008-08-17 Thread Christoph Zwerschke
ound, while the str.find() method should never throw a ValueError. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing exceptions in PEP 3107

2008-08-17 Thread Christoph Zwerschke
EP3107 at all (as Duncan suggests), or whether this question has just not yet been settled. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing exceptions in PEP 3107

2008-08-15 Thread Christoph Zwerschke
there. > (**) - Actually there is a minor policy recommendation: that the pydoc > and inspect module learn to understand and display the annotations. What do you mean with "understand" here when no semantics exists? Do you mean that they should just be able to parse and display t

Re: Missing exceptions in PEP 3107

2008-08-15 Thread Christoph Zwerschke
Matimus wrote: > Christoph wrote: >> Maybe the following syntax would be even more intuitive: >> >> def foo(a: "a info", b: "b info") return "ret info" raise "exc info": >> return "hello world" > > That

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Christoph Zwerschke
Duncan Booth schrieb: There is no currently recommended way to make such annotations, so how could the PEP mention it? Then it could mention the fact that there is currently no recommended way (and maybe make some suggestions, like those given by you). -- http://mail.python.org/mailman/listin

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Christoph Zwerschke
this may get standardized as well. But maybe the PEP should then at least mention what's the currently recommended way to make annotations about thrown exceptions. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Christoph Zwerschke
ot;hello world" And then the annotation dictionary would contain another key "raise" containing the exc info. This cannot conflict with the name of any other parameter either. Maybe the following syntax would be even more intuitive: def foo(a: "a info", b: "b info") return "ret info" raise "exc info": return "hello world" I don't know how determined the "->" syntax is already. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Missing exceptions in PEP 3107

2008-08-09 Thread Christoph Zwerschke
ould check that the function really raises only these exceptions (as in C++), or we could even have checked exceptions (as in Java, but this seems to be a controversial issue). Has this already been discussed, or is it in a different PEP? -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: strip() using strings instead of chars

2008-07-12 Thread Christoph Zwerschke
pecialized functions available. But I'm not sure whether the need for removing string prefix/suffixes in general is really so rare that we shouldn't worry to offer a simpler solution. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: strip() using strings instead of chars

2008-07-11 Thread Christoph Zwerschke
refix in ('http://', 'https://'): if url.startswith(prefix): url = url[len(prefix):] break -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

strip() using strings instead of chars

2008-07-11 Thread Christoph Zwerschke
dex parameters that may be useful). Or did I overlook anything and there is already a good idiom for this? Btw, in most other languages, "strip" is called "trim" and behaves like Python's strip, i.e. considers the parameter as a set of chars. There is one notable exception: In MySQL, trim behaves like stripstr proposed above (differently to SQLite, PostgreSQL and Oracle). -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: First post from a Python newbiw

2008-03-03 Thread Christoph Zwerschke
Arnaud Delobelle schrieb: > It's a FAQ: > http://www.python.org/doc/faq/programming/#how-do-i-create-a-multidimensional-list Somewhere on my todo list I have "read through the whole Python FAQ", but so far never got round doing it. Should probably set it to prio A.

Re: tuples, index method, Python's design

2008-03-02 Thread Christoph Zwerschke
ers: http://groups.google.de/group/comp.lang.python/browse_thread/thread/430a692bc634a04f/ I don't think this was very encouraging for people who wanted to do something about it. Anyway, it's good to see this happened now. Thanks to Raymond. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: First post from a Python newbiw

2008-03-02 Thread Christoph Zwerschke
; a = [[0] * 3 for dummy in xrange(3)] Why not simply [[0]*3]*3 ? -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Error on base64.b64decode() ?!

2007-10-13 Thread Christoph Krammer
out of luck. This seems to work in some cases, but not all. Whats the deal with this adding of "="? Is there an implementation error in python, or are other implemenations of base64 more robust then they have to be? Christoph -- http://mail.python.org/mailman/listinfo/python-list

Error on base64.b64decode() ?!

2007-10-12 Thread Christoph Krammer
imageenc to some other base64 decode (like this one: http://www.php-einfach.de/base64_generator.php?code=1), I get the correct result. One example content is included below. Is this a bug in the base64 module, or is there something wrong with

Re: Python-list Digest, Vol 48, Issue 301

2007-09-20 Thread Christoph Scheit
Hello, is there a way to do something like for i,j in l1, l2: print i,j ? Thanks in advance, Chris -- M.Sc. Christoph Scheit Institute of Fluid Mechanics FAU Erlangen-Nuremberg Cauerstrasse 4 D-91058 Erlangen Phone: +49 9131 85 29508

Re: Memory Problem

2007-09-18 Thread Christoph Scheit
-objects, each itself being an integer pointer (index) to the i-th row. Im using this list in order to sort the table by sorting the index-list instead of realy sorting the entries. (or to filter). -- M.Sc. Christoph Scheit Institute of Fluid Mechanics FAU Erlangen-

Re: Memory Problem

2007-09-18 Thread Christoph Scheit
On Tuesday 18 September 2007 15:10, Marc 'BlackJack' Rintsch wrote: > On Tue, 18 Sep 2007 14:06:22 +0200, Christoph Scheit wrote: > > Then the data is added to a table, which I use for the actual > > Post-Processing. The table is actually a Class with several "Column

Memory Problem

2007-09-18 Thread Christoph Scheit
[i].add(rowData[i]) # add row i and increment number of rows self.rows.append(DBRow(self, self.nRows)) self.nRows += 1 Maybe somebody can help me. If you need, I can give more implementation details. Thanks in advance, Christoph -- M.Sc. Christoph Sch

Re: MemoryError on reading mbox file

2007-09-13 Thread Christoph Krammer
ch message, with the git-mailsplit tool, that is included in the gitk package. This solved the problem for now. Thanks for all your help. Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: MemoryError on reading mbox file

2007-09-12 Thread Christoph Krammer
there be a problem within the mailbox module while processing too large files? Regards, Christoph -- http://mail.python.org/mailman/listinfo/python-list

MemoryError on reading mbox file

2007-09-12 Thread Christoph Krammer
run out at an early stage of this. Is there a way to clean up memory for messages already processed? Thanks and regards, Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Database intensive application

2007-08-12 Thread Christoph Haas
to learn Python? http://wiki.python.org/moin/PythonBooks Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: re.sub does not replace all occurences

2007-08-07 Thread Christoph Krammer
Neil Cerutti schrieb: > In other words, the fourth argument to sub is count, not a set of > re flags. I knew it had to be something very stupid. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

re.sub does not replace all occurences

2007-08-07 Thread Christoph Krammer
removed when doing multiple runs. Perhaps anyone can tell me why this regex is behaving like this. Thanks and regards, Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread Christoph Haas
> but this takes lot of time. I guess Python is trying to get the list > of all keys first and probbaly keep it in memory. Is there a way to > avoid this, since I just want to access keys serially. Does db.iterkeys() work better? Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Why PHP is so much more popular for web-development

2007-07-25 Thread Christoph Haas
ould point a beginner in web programming more likely to PHP than torture them with frameworks. It's just too heavy. OTOH full-featured frameworks are way more complicated and have eviler requirements but there are hardly any limitation on the kinds of sites you can power with them. EO2¢ Cheers Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Lazy "for line in f" ?

2007-07-22 Thread Christoph Haas
EOF before yielding the first line. Standard input is a weird thing in Python. Try sending two EOFs (Ctrl-D). There is some internal magic with two loops checking for EOF. It's submitted as a bug report bug the developers denied a solution. Otherwise it's fine. In a pipe you shouldn't even notice. Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Re-raising exceptions with modified message

2007-07-15 Thread Christoph Zwerschke
Christoph Zwerschke wrote: > Here is a simple solution, but it depends on the existence of the args > attribute that "will eventually be deprecated" according to the docs: Just found another amazingly simple solution that does neither use teh .args (docs: "will eve

Re: Re-raising exceptions with modified message

2007-07-15 Thread Christoph Zwerschke
Christoph Zwerschke wrote: > Here is a simple solution, but it depends on the existence of the args > attribute that "will eventually be deprecated" according to the docs: Ok, here is another solution that does not depend on args: def PoliteException(e): E = e.__cl

Re: Re-raising exceptions with modified message

2007-07-15 Thread Christoph Zwerschke
Christoph Zwerschke wrote: > But my __getattr__ solution does not work either, since the attributes > are set to None when initialized, so __getattr__ is never called. Here is a simple solution, but it depends on the existence of the args attribute that "will eventually be deprecated

Re: Re-raising exceptions with modified message

2007-07-15 Thread Christoph Zwerschke
samwyse wrote: > NewStyle.__name__ = old.__class__.__name__ Simple, but that does the trick! > new.__dict__ = old.__dict__.copy() Unfortunately, that does not work, since the attributes are not writeable and thus do not appear in __dict__. But my __getattr__ solution does not work either, si

Re: A Python newbie ask a simple question

2007-07-13 Thread Christoph Haas
mpt". That function returns a list and you are getting the first ([0]) value from that list. Cheers Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Re-raising exceptions with modified message

2007-07-12 Thread Christoph Zwerschke
samwyse wrote: > TypeError: __class__ must be set to a class > > Excpt ceratinly appears to be a class. Does anyone smarter than me > know what's going on here? Not that I want to appear smarter, but I think the problem here is that exceptions are new-style classes now, whereas Empty is an old-

Re: Re-raising exceptions with modified message

2007-07-08 Thread Christoph Zwerschke
samwyse wrote: > def test(code): > try: > code() > except Exception, e: > try: > raise e.__class__, str(e) + ", sorry!" > except TypeError: > raise SorryFactory(e)() Ok, you're suggestig the naive approach if it works and the factory approach I came up with last as a f

Re: Re-raising exceptions with modified message

2007-07-08 Thread Christoph Zwerschke
Did you run this? With Py < 2.5 I get a syntax error, and with Py 2.5 I get: new.__class__ = old.__class__ TypeError: __class__ must be set to a class -- Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Re-raising exceptions with modified message

2007-07-07 Thread Christoph Zwerschke
Gerard Flanagan wrote: > Would a decorator work here? Depends on how you want to use that functionality. In my use case I only need to catch the excpetion once. Note that in your code the exception has not the right type which is what I targeted in my last posting. I.e. the following will raise

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Alex Popescu wrote: > Probably the simplest solution would be to create a new exception and > wrapping the old one and the additional info. Unfortunately, this > may have a huge impact on 3rd party code that was catching the > original exception. So, I think you should create an utility > factor

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Sorry for the soliloquy, but what I am really using is the following so that the re-raised excpetion has the same type: def PoliteException(e): class PoliteException(e.__class__): def __init__(self, e): self._e = e def __getattr__(self, name): retu

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Seems that no simple solution exists, so for now, I will be using something like this: class PoliteException(Exception): def __init__(self, e): self._e = e def __getattr__(self, name): return getattr(self._e, name) def __str__(self): if isinstance(self._e,

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Kay Schluehr wrote: > If you are sure that the exception isn't caught on another level just > use the following showtraceback() function, manipulate it's output > slightly and terminate your program with sys.exit() That's what I want to avoid. In my case the error is displayed and evaluated in a

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Neil Cerutti wrote: > You may need the traceback module to get at the error message, if > trying to read e.message can fail. > > Something like this mess here: ;) > >... >except Exception, e: > etype, evalue, etb = sys.exc_info() > ex = traceback.format_exception_only(etype, eva

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Christoph Zwerschke
Steven D'Aprano wrote: > I'm not a professional set theorist, but in 15-odd years of studying and > teaching maths I've never come across mathematicians using intersect as a > verb except as informal short-hand. I often say "North Street and South > Street don't intersect", but "the intersection of

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Christoph Zwerschke
Nis Jørgensen wrote: > The problem is, these functions can be read as "X is [consisting only > of] digit[s]", "X is lower [case]" etc, where the bits in brackets have > been removed for brewity. In the case of "s1 is intersect s2" there is > no way I can see of adding words to get a correct sentenc

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Neil Cerutti wrote: > The documentation for BaseException contains something that might > be relevant: > >[...] If more data needs to be attached to the exception, >attach it through arbitrary attributes on the instance. All > > Users could get at the extra info you attached, but it wouldn

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Thomas Heller wrote: > I have the impression that you do NOT want to change the exceptions, > instead you want to print the traceback in a customized way. But I may be > wrong... No, I really want to modify the exception, supplementing its message with additional information about the state of

Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
What is the best way to re-raise any exception with a message supplemented with additional information (e.g. line number in a template)? Let's say for simplicity I just want to add "sorry" to every exception message. My naive solution was this: try: ... except Exception, e: raise e.__

Re: web development without using frameworks

2007-06-05 Thread Christoph Haas
it's listed there). Or you write plain-old CGIs with Python's "cgi" module. I have also started like that but currently only use frameworks because the "cgi" module is pretty limited (compared to what Perl offers) and for serious applications not really the way to go. My 2¢ Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Real globals inside a module

2007-05-13 Thread Christoph Haas
to make a global manager object > that I need to pass around all the time, that would be silly.. Indeed. That would suck. Christoph -- http://mail.python.org/mailman/listinfo/python-list

Read binary data from MySQL database

2007-05-10 Thread Christoph Krammer
lid. The data in the database is correct, I can restore the image with tools like the MySQL Query Browser. Thanks in advance, Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: N00b question on Py modules

2007-05-07 Thread Christoph Haas
ables. But if you change or reassign them the change will be only local to the function. If you want to change the global variable your def needs to be: def setExitCode(): global _exitcode _exitcode = 1 Kindly Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: More newbie help required with dictionaries

2007-04-16 Thread Christoph Haas
What you mean: machines.update({ machinekey:[0,1,0,0,0,0,0,0,0,0,0,0,0] }) Or: machines[machinekey] = [0,1,0,0,0,0,0,0,0,0,0,0,0] Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor/IDE on Linux?

2007-04-13 Thread Christoph Haas
as derivates like Xubuntu) pida because it embeds the 'vim' editor which I love and adds useful features without really getting in my way. And it's the only IDE I found that supports bazaar-ng (bzr) repositories. Christoph -- http://mail.python.org/mailman/listinfo/python-list

Broken pipe with os.popen3()

2007-04-10 Thread Christoph Krammer
to stdout before the first bytes are written to stdin. Any idea how to solve this issue? How do I read and write simultaneously? Thanks in advance, Christoph -- http://mail.python.org/mailman/listinfo/python-list

How to access multiple group matches?

2007-04-06 Thread Christoph Krammer
d till the next appearance of header or the end of the file. But if I iterate over iter, I only get one match and this match only contains one group. How to access the other matches? Data may contain tens of them. Thanks in advance, Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Using os.popen3() to get binary data

2007-04-06 Thread Christoph Krammer
Just got the solution... After sending the image data with "si.write(image)", I have to close the pipe to tell the program to convert the image with "si.close()". Now everything works fine. Christoph -- http://mail.python.org/mailman/listinfo/python-list

Using os.popen3() to get binary data

2007-04-06 Thread Christoph Krammer
pam/scripts/all_in_one.py", line 46, in ? frames = so.readlines() KeyboardInterrupt close failed: [Errno 32] Broken pipe Can somebody tell me, which command I have to use that the pipe will be closed when the giftopnm returns? This program just prints the converted images to stdout and te

Re: Sharing Objects in Python

2007-03-16 Thread Christoph Haas
database? Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiline code - trailing slash usage

2007-03-15 Thread Christoph Haas
uot;. > x = {'name' : \ > 'bob'} Not needed because you are inside the curly brackets {} and it's clear where the statement ends. > Do I need to use the "\" in the above examples? When do i need to use > it? Cheers Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with reimporting modules

2007-02-11 Thread Christoph Zwerschke
reloaded. Anyway, I have solved the problem in a different way now. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with reimporting modules

2007-02-11 Thread Christoph Zwerschke
Yes I know about reload(), but TurboGears (TurboKid) does not use it and the docs say that removing modules from sys.module is possible to force reloading of modules. I don't want to rewrite everything since it's a pretty complex thing with modules which are compiled from templates which can de

Problem with reimporting modules

2007-02-11 Thread Christoph Zwerschke
print_hello() The second print_hello() prints "None" instead of "Hello!". Why is that? I had expected that it either prints an error or print "Hello!" as well. Is this intended behavior of Python? -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: No latin9 in Python?

2006-12-17 Thread Christoph Zwerschke
Martin v. Löwis schrieb: > Christoph Zwerschke schrieb: >> Shall I proceed writing such a patch? Shall I also add latin0 and l0 >> which are other inofficial aliases? > > Sure, go ahead. I see no need for the latin0/l0 aliases, though: they > predate the formal adoption of

Re: tuple.index()

2006-12-16 Thread Christoph Zwerschke
James Stroud wrote: > Christoph Zwerschke wrote: >> Maybe there would be less dispute if this dogma/convention(?) "Tuples >> are for heterogeneous data, list are for homogeneous data" would be >> written down somewhere in the tutorial, reference or in PEP8, so

Re: tuple.index()

2006-12-16 Thread Christoph Zwerschke
ed very frequently. So that would be another practical aspect why a long list of tuples could be better than a long list of lists - but does anybody know whether this is even true for CPython? -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-15 Thread Christoph Zwerschke
Tim Golden wrote: > Christoph Zwerschke wrote: >> And can somebody explain what is exactly meant with >> "homogenous data"? > > This seems to have been explained a few times > recently :) Basically, if you have a "list of xs" > and remove one item

Re: No latin9 in Python?

2006-12-15 Thread Christoph Zwerschke
then be recognized automatically since I think capitalization and hyphens do not matter anyway (I'll check that). Shall I proceed writing such a patch? Shall I also add latin0 and l0 which are other inofficial aliases? -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   >