ET(self):
context = self.server.context
...
server = MyHTTPServer(('', port), MyHandler)
server.serve_forever()
Bernhard
--
Bernhard Herzog | ++49-541-335 08 30 | http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück
[EMAIL PROTECTED] writes:
> So, once I start the C Program from the shell, I immediately get its
> output in my terminal. If I start it from a subprocess in python and
> use python's sys.stdin/sys.stdout as the subprocess' stdout/stdin I
> also get it immediately.
If stdout is connected to a term
"Paul McGuire" <[EMAIL PROTECTED]> writes:
> ... or if you prefer the functional approach (using map)...
>
> roundToInt = lambda z : int(z+0.5)
> Topamax = map( roundToInt, map( float, map(str, Topamax) ) )
>
> (Python also has a built-in round() function, but this returns floats, not
> ints - if
Norvell Spearman <[EMAIL PROTECTED]> writes:
> Lutz and Ascher have tuple and list assignment as separate entries in
> their assignment statement forms table so I was expecting there to be
> some difference; thanks for setting me straight.
In older Python versions there was a difference between l
[EMAIL PROTECTED] (Alex Martelli) writes:
> You could make a case for a "2D coordinate" class being "sufficiently
> primitive" to have immutable instances, of course (by analogy with
> numbers and strings) -- in that design, you would provide no mutators,
> and therefore neither would you provide
"Frank Millman" <[EMAIL PROTECTED]> writes:
>> > If I call sax.make_parser() from the interpreter or from a stand-alone
>> > program, it works fine on all machines, but in the following setup it
>> > works correctly on MSW, but segfaults on both FC4 and RH9.
[...]
>> Progress report - I have narro
Jorge Godoy <[EMAIL PROTECTED]> writes:
> How about iterating through the file? You can read it line by line, two lines
> at a time. Pseudocode follows:
>
> line1 = read_line
> while line2 = read_line:
> line_to_check = ''.join([line1, line2])
> check_for_desired_string
> line1
"Tim Golden" <[EMAIL PROTECTED]> writes:
> But as far as I can tell
> from my experience and from the docs -- and I'm not near a
> Linux box at the mo -- having used ctrl-r to recall line x
> in the history, you can't just down-arrow to recall x+1, x+2 etc.
> Or can you?
You can. It works fin
"Java and Swing" <[EMAIL PROTECTED]> writes:
> char *foo(const char *in) {
> char *tmp;
> tmp = (char *) malloc((strlen(in) * sizeof(char)) + 1);
> strcpy(tmp, in);
> ...
> ...
> free(tmp);
> return someValue;
> }
>
> Is that appropriate? I was under the impression tha
"Java and Swing" <[EMAIL PROTECTED]> writes:
> thanks for the tip, however even when I do not free aString or bString,
> i'm still crashing at the malloc in the c function, not the wrapper.
Do you have any more places where you use free incorrectly? In my
experience, calling free with invalid va
"Java and Swing" <[EMAIL PROTECTED]> writes:
> static PyObject *wrap_doStuff(PyObject *self, PyObject *args) {
[...]
> char *aString = 0;
> char *bString = 0;
[...]
> int ok = PyArg_ParseTuple(args, "sss", &in, &aString, &bString);
[...]
> free(aString);
> free(bStrin
Brandon K <[EMAIL PROTECTED]> writes:
> long* result = 0;
[...]
> result = doNumberStuff(in,x);
> len = sizeof(result)/sizeof(long);
I don't think this will do what you appear to expect it to do.
Bernhard
--
Intevation GmbH http://intevation.
[EMAIL PROTECTED] writes:
> On standard Unix fileystems, one way to check for this is to check that the
> st_nlink of the directory is 2.
In that case you only know that the directory doesn't have any
subdirectories. It may still contain ordinary files and other
non-directories.
Bernhard
-
Chris Spencer <[EMAIL PROTECTED]> writes:
> I'm trying to write a Gui in Python for manipulating rich graphical
> representations, similar to something like Inkscape. I've tried tkinter,
> wxPython, pyGtk, and while they all do traditional widgets well enough,
> none of them really handle anti-ali
Steve Juranich <[EMAIL PROTECTED]> writes:
> I'm running into problems where Python and VTK both ship with their
> own distribution of the Expat parser. As long as you never use the
> Python XML package, everything is fine. But if you try using the
> Python XML parser after doing an `import vtk'
Scott David Daniels <[EMAIL PROTECTED]> writes:
> Rocco Moretti wrote:
>> Joseph Garvin wrote:
>>
>> I'm not aware of a language that allows it, but recently I've found
>> myself wanting the ability to transparently replace objects
>> I mainly look for it in the "object replaces self" form, bu
Grant Edwards <[EMAIL PROTECTED]> writes:
> On 2005-05-11, jeff elkins <[EMAIL PROTECTED]> wrote:
>
>> I'm totally new to Python (obvious,yes?) so how might argv[0] fail?
>
> argv[0] contains whatever is put there by the program that
> exec'ed you, and can therefore contain just about anything (or
Torsten Bronger <[EMAIL PROTECTED]> writes:
>> http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
>
> I see only one argument there: "Inclusion of the upper bound would
> then force the latter to be unnatural by the time the sequence has
> shrunk to the empty one." While this surely is unaesth
Torsten Bronger <[EMAIL PROTECTED]> writes:
> It's interesting to muse about a language that starts at "1" for all
> arrays and strings, as some more or less obsolete languages do. I
> think this is more intuitive, since most people (including
> mathematicians) start counting at "1". The reason
Stefan Seefeld <[EMAIL PROTECTED]> writes:
> Is there anything wrong with 'exec source in a, b' where
> a and b are distinc originally empty dictionaries ? Again,
> my test code was
>
> class Foo: pass
> class Bar:
>foo = Foo
>
> and it appears as if 'Foo' was added to 'a', but when evaluating
Michael Spencer <[EMAIL PROTECTED]> writes:
> So, here's factorial in one line:
> # state refers to list of state history - it is initialized to [1]
> # on any iteration, the previous state is in state[-1]
> # the expression also uses the trick of list.append() => None
> # to both update the state
Jeremy Bowers <[EMAIL PROTECTED]> writes:
> On Tue, 08 Feb 2005 17:36:19 +0100, Bernhard Herzog wrote:
>> Nick Vargish <[EMAIL PROTECTED]> writes:
>>> "Xah Lee" <[EMAIL PROTECTED]> writes:
>>>> is it possible to write python code
Nick Vargish <[EMAIL PROTECTED]> writes:
> "Xah Lee" <[EMAIL PROTECTED]> writes:
>
>> is it possible to write python code without any indentation?
>
> Not if Turing-completeness is something you desire.
It's possible to implement a turing machine with a single list
comprehension. No indentation
Bernhard Herzog <[EMAIL PROTECTED]> writes:
> Steve Holden <[EMAIL PROTECTED]> writes:
>> if package:
>> module.__path__ = sys.path
>
> You usually should initialize a package's __path__ to an empty list.
Actually, normally it's a
Peter Hansen <[EMAIL PROTECTED]> writes:
> Miki Tebeka wrote:
>>>Hi all, I'm trying to write a multiplatform function that tries to
>>>return the actual user home directory.
>>>...
>> What's wrong with:
>> from user import home
>> which does about what your code does.
>
> :-)
>
> I suspect he
Steve Holden <[EMAIL PROTECTED]> writes:
> What *I* would like to know is: who is allowing the import of bsddb.os,
> thereby somehow causing the code of the os library module to be run a
> second time.
I would guess (without actually running the code) that this part is
responsible:
> if
[EMAIL PROTECTED] (Alex Martelli) writes:
> OK then -- vars(type(object)) is a dict which has [[the unbound-method
> equivalent of]] object.__subclasses__ at its entry for key
> '__subclasses__'. Scratch 'vars' in addition to 'getattr'. And 'eval'
> of course, or else building up the string 'obj
"It's me" <[EMAIL PROTECTED]> writes:
> May be flatten should be build into the language somehow
That shouldn't be necessary as it can easily be written in a single list
comprehension:
a = [[1,2,4],4,5,[2,3]]
flat_a = [x for cur, rest in [[a[:1], a[1:]]] for x in cur
if (not isin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> I forgot one file, btw:
>
>>> $ rm /usr/somewhere/bin/python
>
> $ rm /usr/somewhere/bin/python2.3
There are also pydoc and idle.
Bernhard
--
Intevation GmbH http://intevation.de/
Skencil
Riko Wichmann <[EMAIL PROTECTED]> writes:
> I'm using emacs (with python-mode) to do most of my editing.
[...]
> Maybe I just don't know to comment out whole blocks using editor
> commands.
comment-dwim (usually bound to M-; ) comments out the region if it's
active, or, if the region is already c
30 matches
Mail list logo