Filip Gruszczyński wrote:
> Hi!
>
> I have certain design problem, which I cannot solve elegantly. Maybe
> you know some good design patterns for this kind of tasks.
>
> Task:
>
> We have a model which has two kinds of objects: groups and elements.
> Groups can hold other groups (subgroups) and
Alex van der Spek wrote:
> Is there a way to read C# serialized objects into Python?
>
> I know the definition and structure of the C# objects. The Python docs
> say that pickle is specific to Python, which does not give me much hope.
> There may be a library however that I haven't come across ye
Ross wrote:
> There seems to be no shortage of information around on how to use the
> time module, for example to use time.ctime() and push it into strftime
> and get something nice out the other side, but I haven't found anything
> helpful in going the other way.
>
> That is, given some formatte
e4m...@gmail.com wrote:
> Coming from a scripting background where we used to write everything
> into one script, I'm now going modular with Python. I place related
> functions in one module, and other functions in other modules.
>
> This all works OK, but I'm a bit confused about importing modul
David Hláčik wrote:
> dictionary with cycle structure
>
> Hello guys,
>
> I have a linked list where *number of elements is unlimited* and
> **last element points on random (can be first, last, in middle ,
> anywhere) element within linked list** - this is important . My goals
> is to create an
asit wrote:
> import httplib
>
> class Server:
> #server class
> def __init__(self, host):
> self.host = host
> def fetch(self, path):
> http = httplib.HTTPConnection(self.host)
> http.request("GET", path)
> r = http.getresponse()
> print str(r.
vk schrieb:
Have there been ports of the Python standard library to other
languages?
I would imagine using pickle, urllib, and sys in C (with pythonic
naming conventions) would be easier than using other libraries to do
the same thing.
AFAIK not. You could try elmer (found on SF) to expose the
Kless schrieb:
On 3 ene, 19:40, Simon Forman wrote:
On Jan 3, 11:20 am, Kless wrote:
Afghanistan
AF
Out[19]: u'AF'
AFG
Out[19]: u'AFG'
004
Out[19]: u'004'
What?
That's the output got from ipython. As you can see, it prints
'Afghanistan' but it can not returns it. In change, the another
st
Kless schrieb:
On 3 ene, 19:12, "Diez B. Roggisch" wrote:
Kless schrieb:
How is possible that I can print a variable, but when I use *return
var* it returns an empty string
http://paste.pocoo.org/show/97588/
I don't see anything that indicates that the returned object is t
Kless schrieb:
How is possible that I can print a variable, but when I use *return
var* it returns an empty string
http://paste.pocoo.org/show/97588/
I don't see anything that indicates that the returned object is the
empty string. Simply because there is no code testing for that. And of
cou
sprad schrieb:
I've done a good bit of Perl, but I'm new to Python.
I find myself doing a lot of typecasting (or whatever this thing I'm
about to show you is called), and I'm wondering if it's normal, or if
I'm missing an important idiom.
It is normal, although below you make things needlessly
Hongtian schrieb:
Hi Friends,
My application is written in C/C++ and Python is embed to extend some
functions (several .py files are invoked). But I am confused how to
debug these embed Python? Can I use 'print-debuging'? and where can I
capture the output string?
Or Python can support 'break'
Kottiyath schrieb:
Hi,
How can I iterate over all the objects of a class?
I wrote the code like following:
class baseClass(object):
Consider adopting PEP 8 coding conventions.
__registry = []
def __init__(self, name):
self.__registry.append(self)
self.name = n
NoName schrieb:
On 25 дек, 00:37, "Diez B. Roggisch" wrote:
NoName schrieb:
i have 1.py in cp866 encoding:
# -*- coding: cp866 -*-
print ("ff")
It's not work in Python 3.0
Error:
File "", line 1
SyntaxError: encoding problem: with BOM
what's wrong?
Nikola Skoric schrieb:
I0m a python newbie with PHP background. I've tried to make a web app
from one of my python scripts (which I haven't done before) and I
ended up with:
which works really nice :-D
For some reason I can't find no "quick and dirty python web
programming tutorial for PHP pro
NoName schrieb:
i have 1.py in cp866 encoding:
# -*- coding: cp866 -*-
print ("ff")
It's not work in Python 3.0
Error:
File "", line 1
SyntaxError: encoding problem: with BOM
what's wrong?
I can only guess, but just because you write the coding-header that
doesn't mean that the editor yo
Anything else is madness. And the fact the Outlook doesn't do proper
referral fields just infuriates me. Sigh.
I'm overjoyed about the opaque winmail.dat attachments I get. Which seem
to appear randomly from the same sender sending the same stuff (like a
meeting invitation) to me - depend
Méta-MCI (MVP) schrieb:
Hi!
This info is interesting for many people.
IMO, it's a good idea to write the question in this newsgroup.
Which only makes sense if the author of PIL reads it. Which he seems not
to (or at least doesn't answer here, as he used to).
Diez
--
http://mail.python.org
Neal Becker wrote:
> Diez B. Roggisch wrote:
>
>> Neal Becker wrote:
>>
>>> Tino Wildenhain wrote:
>>>
>>>> Neal Becker wrote:
>>>> ...
>>>>>>> So if __str__ is "meant for human eyes", then why isn
Neal Becker wrote:
> Tino Wildenhain wrote:
>
>> Neal Becker wrote:
>> ...
> So if __str__ is "meant for human eyes", then why isn't print using
> it!
it is:
> print x
str
but dict just uses repr() for all its childs to print.
T.
>>> That makes no
Neal Becker wrote:
> Reading some FAQ, I see that __str__ is "meant for human eyes".
>
> But it seems that:
> class X(object):
> def __str__(self):
> return "str"
> def __repr__(self):
> return "repr"
>
> x = X()
> d = {0 : x}
> print d
> {0: repr}
>
> So if __str__ is "
Emanuele D'Arrigo wrote:
> Sorry for the previous post, hit the Enter button by mistake... here's
> the complete one:
>
> Hi everybody!
>
> I've written the code below to test the differences in performance
> between compiled and non-compiled regular expression matching but I
> don't quite under
walterbyrd wrote:
> For a language as well structured as Python, this seems somewhat
> sloppy, and inconsistant. Or is there some good reason for this?
>
> Here is what I mean:
>
> def a():
> x = 99
> print x
>
> def b():
> print x
>
> a()
> b() # raises an exception because x is
Diez B. Roggisch wrote:
> Hole wrote:
>
>> Hi all,
>>
>> I hope this is not an "overasked" question but I find myself quite
>> confused about python xml management (I have to use python for a
>> project and I come from java world, you know...where
Hole wrote:
> Hi all,
>
> I hope this is not an "overasked" question but I find myself quite
> confused about python xml management (I have to use python for a
> project and I come from java world, you know...where frameworks,
> libraries and tools to use are standard de iure or standard de facto
Duncan Booth schrieb:
"Diez B. Roggisch" wrote:
David Hlá�ik schrieb:
Hi guys,
i am really sorry for making offtopic, hope you will not kill me, but
this is for me life important problem which needs to be solved within
next 12 hours..
I have to create stable algorithm for
David Hláčik schrieb:
Hi guys,
i am really sorry for making offtopic, hope you will not kill me, but
this is for me life important problem which needs to be solved within
next 12 hours..
I have to create stable algorithm for sorting n numbers from interval
[1,n^2] with time complexity O(n) .
C
Christian Heimes schrieb:
Diez B. Roggisch schrieb:
I never tried this on windows - but what happens if you start python
inside GDB, and then set breakpoints inside your extension?
This works flawlessly for me under *nix.
The debug-build of python isn't needed for this - and I doubt
Cro schrieb:
Good day.
I've been trying to port HGE (http://hge.relishgames.com) to Python
for more than 4 months now...
HGE is a hardware accelerated 2D game engine.
It comes with the source and examples. In the folder "include", you
can find "hge.h", the file that i am talking about in all the
Grant Edwards schrieb:
On 2008-12-11, Diez B. Roggisch wrote:
I never tried this on windows - but what happens if you start
python inside GDB, and then set breakpoints inside your
extension?
This works flawlessly for me under *nix.
The debug-build of python isn't needed for this -
Paul Moore schrieb:
I'm writing a C extension. My environment is Python 2.5, with the
mingw compiler, on Windows XP. At the moment I'm debugging by
scattering printf() statements around, but it's not always easy. Is
there a better way of debugging - particularly for diagnosing crashes?
I have gd
SMALLp wrote:
> Hy. I have a problem! I'm making multi thread application (client,
> server) using wxPython for GUI, and threading.Thread for threding.
>
> Clients connect and when they are connected (evry thread handles one
> connection) threads change main window.
>
> I neded tip how to make c
[EMAIL PROTECTED] wrote:
> On Dec 9, 10:04 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
>> So, why do you think apt and not setuptools is The Right Way(tm)?
>
> I like to keep > 1 Python on my computer.
>
> 1. First, there's the system Python, which is installed by my OS and
> which I try not t
Laszlo Nagy schrieb:
There are others but they do not support both Python and PHP. Should
I implement my own ORB, or do you know a suitable solution?
The whole purpose of an ORB ist that it is interoperable. So if you
have a good python orb (I personally prefer OmniORB), and a good one
f
Márcio Faustino schrieb:
So, no chance of doing this:
# "A.py"
from __future__ import division, with_statement
# "B.py"
from A import *
print 1 / 2
...and printing 0.5, right? Too bad :)
Au contraire - *very* good. If it were otherwise, what would happen to
code that _relies_ on / returning
Sampsa Riikonen schrieb:
Dear All,
I am experiencing a weird problem with the
xml.dom.minidom module:
[EMAIL PROTECTED]:~/python> python easyxml.py
Traceback (most recent call last):
File "easyxml.py", line 1, in
import xml.dom.minidom
File "/u
Laszlo Nagy schrieb:
We have a problem here. We have a website written in PHP. and many
programs written in Python. The communication between the components is
messy. os.system calls are mixed with popen, xml-rpc and others. We
would like to make it consistent and portable. We would like to use
Val schrieb:
I've written my first module, "
" and uploaded it as an egg to
PyPI. I can use easy_istall to install my own module, but when I try
to import it I get an ImportError "No module named gpsparser".
So I've done some research and found that in my site-packages/
directory gpsparser exi
Jean-Paul Calderone wrote:
> On Mon, 08 Dec 2008 17:29:35 +0100, "Diez B. Roggisch"
> <[EMAIL PROTECTED]> wrote:
>>Robert Dailey wrote:
>>
>>> Hi,
>>>
>>> I'm looking for a portable way to download ZIP files on the internet
Robert Dailey wrote:
> Hi,
>
> I'm looking for a portable way to download ZIP files on the internet
> through Python. I don't want to do os.system() to invoke 'wget', since
> this isn't portable on Windows. I'm hoping the core python library has
> a library for this. Note that I'll be using Pytho
Peter Pearson schrieb:
On Sun, 07 Dec 2008 00:40:53 +0100, Stef Mientki wrote:
I want to give a small beep,
for windows there's message-beep,
and there seems to be something like " curses" ,
but that package seems to be totally broken in P2.5 for windows.
Any other suggestions ?
Many people h
Andreas Waldenburger schrieb:
This is a little puzzling.
Using ipython:
[EMAIL PROTECTED] Logstuff]$ ipython
Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
Type "copyright", "credits" or "license" for more information.
[snip ipython help message]
In [1]: import re
[EMAIL PROTECTED] schrieb:
How can I make a "var" parm, where the called function can modify
the value of the parameter in the caller?
def f(x):
x = x + 1
n = 1
f(n)
# n should now be 2
Chris showed one way, another is simply returning it. As python can
return ad-hoc created tuples & unp
Tim Golden schrieb:
walterbyrd wrote:
I am running cygwin on xp.
and I just noticed this vital bit. So not sure
how much of my other post applies. Sorry. Maybe it'll
help anyway. :)
Everything. The atrocity that the windows terminal window is isn't
mitigated by an out-of-the-box cygwi
k3xji wrote:
> Hi,
>
> Is there a way to hook a function call in python? I know __getattr__
> is doing for variables, it is giving us a chance before a field is
> initialized. Do we have same functionality for methods?
>
> Example:
>
> class Foo(object):
> def __call_method__(self, ...) # j
[EMAIL PROTECTED] schrieb:
> my code:
> −
> import base64
> def deflashget(st):
> if st.startswith('Flashget://'):
> return base64.decodestring(st[len('Flashget://'):])[10:-10]
> elif st.startswith('http://') or st.startswith('ftp://'):
>
TP wrote:
> Hi everybody,
>
c=[(5,3), (6,8)]
>
> From c, I want to obtain a list with 5,3,6, and 8, in any order.
> I do this:
>
[i for (i,j) in c] + [ j for (i,j) in c]
> [5, 6, 3, 8]
>
> Is there a quicker way to do this?
dunno if it's faster, but less cluttered:
list(sum(c, ()))
[EMAIL PROTECTED] schrieb:
Hi All,
How do I parse a variable inside an RE?
What is the re.search() syntax when your
search string is a variable?
It's easy to parse hardcoded RE's but not
if you use a variable.
Both are exactly equal in difficulty.
Here is my code, input and runtime:
$ cat t
Alexey Vlasov wrote:
> Hi.
>
> There's an already installed with easy_install packet, let's say flup,
> to the home catalog:
> $ ls -la ~/python/lib/python2.5/site-packages/
> total 176
> drwxr-xr-x 3 4096 Nov 29 18:57 .
> drwxr-xr-x 3 4096 Nov 29 18:51 ..
> -rw-r--r-- 1 208 Nov 29 18:57 easy-
Guy Doune schrieb:
Hi,
I try to figure out what gonna be the equivalent of :
(.*?)
For the same purpose on multiline basis.
I would like completed the variable part of elements that I searching for.
Example :
align="center">
Is the begining of the variable element that I wanna completed..
waltbrad schrieb:
PYTHONPATH is a concept I've never been able to get straight. I can't
see the difference between this and just setting paths in the Windows
environment variables. So, for the longest time I just never worried
about it.
Now, I'm going through James Bennett's "Practical Django P
r schrieb:
The fact _you_ don't like Ruby doesn't make it a bad language. If what
you want is a Python API to SketchUp, bashing Ruby certainly won't help
- quite on the contrary. And it won't help promoting Python neither.
Thanks Bruno,
I never said Ruby is a bad Language!
-food for though
r schrieb:
The fact _you_ don't like Ruby doesn't make it a bad language. If what
you want is a Python API to SketchUp, bashing Ruby certainly won't help
- quite on the contrary. And it won't help promoting Python neither.
Thanks Bruno,
I never said Ruby is a bad Language!
-food for though
Steven D'Aprano wrote:
> On Fri, 28 Nov 2008 02:36:28 -0800, manatlan wrote:
>
>> I'd like to make a "jquery python wrapper"
> [...]
>> here is my code :
> [...]
>
> What is the purpose of this code? As near as I can see, it would make an
> excellent entry to the Obfuscated Python Competition, e
>
> I just want to make a jquery wrapper, and let people use it to write
> jquery call on the server side in a python way ...
>
> o is a object, imagine a widget : like a textarea or input box
> "js" is a special attribut of "o", which will let you write javascript
> for this object.
>
> o=MyObj
ZelluX schrieb:
Hi, all
I want to write a version-tracking tool for Python projects, and need
some sample projects whose even smallest modifications can be
downloaded from the internet.
Could you recommend some to me?
Well, most of them have ... TADA ... Versioncontrol systems they use.
Whic
TP schrieb:
[EMAIL PROTECTED] wrote:
a=("1","2")
b=[("3","4"),("5","6")]
list(a)+b
['1', '2', ('3', '4'), ('5', '6')]
a = ("1", "2")
b = [("3", "4"), ("5", "6")]
[a] + b
[('1', '2'), ('3', '4'), ('5', '6')]
Thanks a lot.
Why this difference of behavior between list(a) and [a]?
Because th
lkcl schrieb:
On Nov 27, 7:43 pm, [EMAIL PROTECTED] wrote:
lkcl> Very simple question: how do you apply a decorator to an entire
lkcl> module?
Function-by-function or class-by-class. There is no decorator support for
modules.
awWww! i'm going to quietly throw my toys out of my pram.
tekion schrieb:
Hello,
I am getting the following error and my script is bailing out because
of it. I have tried capturing it but it does not seem to work. Below
is the error:
ValueError: I/O operation on closed file
the above error is received when, the following code snippet is
executed:
willie wrote:
> My code:
>
> from time import time
> def leibniz(terms):
>
>
> acc = 0.0
> num = 4.0 # numerator value remains constant in the series
> den = 1
> count = 0
> start_time = 0.0
> for aterm in range(terms):
> nextterm = num/den * (-1)**aterm # (-1)
tekion wrote:
> I have a while iterates forever. I would like to trap a SIGTERM signal
> and execute some clean up code. How would I do this in python? Thanks.
look into module "signal"
Diez
--
http://mail.python.org/mailman/listinfo/python-list
Viktor Kerkez wrote:
> Here is the situation:
>
> $ ls
> test
> $ cd test
> $ ls
> __init__.py data.py
> $ cat __init__.py
>
> $ cat data.py
> DATA = {}
>
> $ cd ..
> $ python
import os
from test.data import DATA
DATA['something'] = 33
os.chdir('test')
from data import
della wrote:
> On 27 Nov, 11:21, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
>> You can't do that. How should python distinguish between the two modules
>> with the same name?
>
> That's why I was trying to import them with different na
della wrote:
> Hi all,
>
> I've got some pickled files representing graphs (using networkx,
> http://networkx.lanl.gov if you're interested) that were produced
> using version 0.36 of the library.
>
> Now, they have released a new version of the library which is
> incompatible with respect to pi
dpapathanasiou schrieb:
I'm using the feedparser library to extract data from rss feed items.
After I wrote this function, which returns a list of item titles, I
noticed that most item attributes would be retrieved the same way,
i.e., the function would look exactly the same, except for the sing
Alphones wrote:
> On 11月26日, 下午9时28分, [EMAIL PROTECTED] wrote:
>> Alphones:
>>
>> > it is a little deferent from other script language.
>>
>> See also here:http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping
>>
>> Python doesn't have such automatic closures, probably for performance
>> reas
Alphones wrote:
> Hi all,
>
>
> def getFunc(x):
> return lambda y : x + y
>
> if __name__ == '__main__':
> todo = []
> proc = getFunc(1)
> todo.append(lambda: proc(1))
> proc = getFunc(2)
> todo.append(lambda: proc(1))
> proc = getFunc(3)
> todo.append(lambda: pr
k3xji wrote:
> On Nov 26, 1:34 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote:
>> k3xji wrote:
>> > I am new to Python C API and finding it difficult to debug C
>> > extensions. So, basically I want to see the value of an integer value
>> > during the C API. Here is the code:
>>
>> > #define LAST_MIX
[EMAIL PROTECTED] schrieb:
On Nov 25, 5:05 pm, peter <[EMAIL PROTECTED]> wrote:
BUT you now can do
p = print
p("f")
Voila, 4 keystrokes saved :-)
All right. Let's talk about that.
When I write "print", it is both effortless and instantaneous : my
hands do not move, a wave goes through my f
[EMAIL PROTECTED] schrieb:
On Nov 25, 4:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
You can't use ctypes for C++, only for C-style APIs.
Diez
With some work, you can convert your C++ objects to PyObject* and then
return the latter in a function with C bindings.
[EMAIL PROTECTED] wrote:
> On Nov 25, 4:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>> I used to use print a lot. Once I found
>>
>> import pdb; pdb.set_trace()
>>
>> I massively lost interest in it. And gained *much* more debugging
>&
[EMAIL PROTECTED] wrote:
> I want my productivity back.
>
> In Python 2.x, I could easily write things like -- print "f" / print
> "add" / print "done" -- to a lot of different places in my code, which
> allowed me to find bugs that I could not track otherwise. When I found
> out that "f" was not
Roy Smith wrote:
> In article <[EMAIL PROTECTED]>,
> Ryan Kelly <[EMAIL PROTECTED]> wrote:
>
>> * Migrated from SWIG to ctypes for the C binding:
>
> Ryan,
>
> I'm looking at a doing a Python wrapper for a C++ library. We've already
> done a Perl wrapper for this library using SWIG (I wasn't
alex23 wrote:
> On Nov 24, 5:47 pm, Dokorek <[EMAIL PROTECTED]> wrote:
>> Python 3000 (a.k.a. "Py3k", and released as Python 3.0) is a new
>> version of the language that is incompatible with the 2.x line of
>> releases. The language is mostly the same, but many details,
>> especially how built-in
Philipp Pagel wrote:
> Alfons Nonell-Canals <[EMAIL PROTECTED]> wrote:
>> Install python modules in a linux computer is really easy, it is because
>> the module is a package of the distribution or because the python
>> installation is really easy. But, in both situations, you need root
>> privileg
r schrieb:
I would like to install minimal version if python 2.6 on a linux laptop
(and no there is not one already installed...i checked)
i have no way to access the net with the laptop.
So basicly i down loaded the 2.6 source and unpacked it on my other
PC.
The files weigh in at 51MB and some c
Priya wrote:
> Hi,
> I'm writing a program where i iterate through the entries in a
> dictionary using a for loop. This for-loop is enclosed by another loop
> which traverses through a list and checks the relation between each
> entry in the list and each entry in the dictionary.
> while I know th
[EMAIL PROTECTED] wrote:
> Hello,
>
> I'm launching a script as follows:
>
> p = subprocess.Popen(['./p.py', 'aa'])
>
> p.wait()
>
>
> If p.py writes to sys.stdout, then it is shown on the console.
> Looking at the console, then, it is hard to distinguish the output of
> p.py from that
Jerzy Jalocha N wrote:
> I'm new in this list (and to Python), so I'd like to start saying
> hello to everyone first. I am really enjoying this new language!
>
> I am trying to use the standard tests (like test_list.py or
> test_dict.py) from the standard library (Python2.5), but they aren't
> av
Arnaud Delobelle wrote:
> jzakiya <[EMAIL PROTECTED]> writes:
>
>> I looked online and in books, but couldn't find a definitive answer to
>> this.
>>
>> I have an array and set multiple elements to either True or False at
>> one time.
>>
>> Question: Which way is faster (or does it matter)?
>>
>>
> Sorry if I misinformed; I have such symlinks in /usr/local/bin dated
> the same day as my custom Python install. I guess I could have created
> them myself, but I don't think I would have bothered creating a
> symlink for pythonw, for example since I never use it.
>
Did you really create a fram
Eric wrote:
> Hi,
>
> I've been trying to get my son interested in learning some simple
> programming for a while. While I understand that a structured tutorial
> is best, I think if we can write something cool at least once, it will
> encourage him to learn more. While I have a lot of experience
Philip Semanchuk wrote:
>
> On Nov 17, 2008, at 10:53 AM, Massi wrote:
>
>> Hi everyone, I'm trying to install Python2.6 on my mac (Leopard
>> 10.5.5), but I'm encountering some problems. To install the package I
>> followed the instructions I found at this link:
>> http://wiki.python.org/moin/M
[EMAIL PROTECTED] wrote:
> Hi,
>
> Is it possible to remove one of two instances of Python installed on
> the same machine? I have two Python-2.5.2, one in /usr/local/bin/
> python2.5 and the other one in /usr/bin/python2.5. The latter has the
> modules I use (kinterbasdb, psycopg, mod_python,...
John Machin schrieb:
On Nov 17, 4:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
Match matches the whole string.
*ONLY* if the pattern ends with "$" or r"\Z"
You think so?
import re
rex = re.compile("abc.*def")
if rex.match(&q
The Web President wrote:
> Dear all,
>
> this is really driving me nuts and any help would be extremely
> appreciated.
>
> I have a string that contains some numeric data. I want to isolate
> these data using re.match, as follows.
>
> bogus = "IFC(35m)"
> data = re.match(r'(\d+)',bogus)
> print
John O'Hagan wrote:
> On Sun, 16 Nov 2008, Diez B. Roggisch wrote:
>> > In other words, using the optparse object to hold as attributes
>> > everything needed by all the functions and methods in the module, and
>> > simply passing it holus bolus to a
> In other words, using the optparse object to hold as attributes everything
> needed by all the functions and methods in the module, and simply passing
> it holus bolus to all them and just pulling out what's actually needed
> inside the function, even adding new attributes or reassigning old ones
jzakiya schrieb:
I'm translating a program in Python that has this IF Then chain
IF x1 < limit: --- do a ---
IF x2 < limit: --- do b ---
IF x3 < limit: --- do c ---
.-
--
IF x10 < limt: --- do j ---
Alan Baljeu schrieb:
I'm new to Python, and just downloaded Py2.6. I also want to use Nose. So I downloaded the latest sources, but it's not at all clear what's the best way to put this stuff into the Python package system. Nose supports easy_install, easy_install doesn't have an installer for
Michel Perez wrote:
> Hi everybody:
> I'm trying to use JSON-RPC to provide my services but produce this
> exception:
>
> Traceback (most recent call last):
> File "", line 1, in
> File "jsonrpc/proxy.py", line 43, in __call__
> resp = loads(respdata)
> File "jsonrpc/json.py", line 21
Markus Mayer schrieb:
Hi folks.
I'm new to python and have a slight problem importing - or maybe
understanding - modules. I'm writing a GUI application using Qt4 and
wanted to separate the business from the view logic. So I have my folder
structure as following:
project/ main.py
import
[EMAIL PROTECTED] schrieb:
The thread on sorting in Python 3 got me to thinking. How could I sort a
list of complex numbers using key?
>>> lst = [random.random()+random.random()*1j for i in range(10)]
>>> lst
[(0.32672251849959244+0.41428983433288791j),
(0.35238056484609881+0.92758
Roy Smith schrieb:
In article <[EMAIL PROTECTED]>,
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
Also, I thought that part of the python philosophy was to allow any
sort of object in a list, and to allow the same methods to work with
whatever was in list.
Not really. W
Also, I thought that part of the python philosophy was to allow any
sort of object in a list, and to allow the same methods to work with
whatever was in list.
Not really. When the usual argument about the existence (and
justification) of lists & tuples comes along, one common distinction is
t
> Diez, Robert,
>
> OK. The practice of "going live" or doing non-trivial initialization
> in __enter__ is new to me. I'm new to Python with a C++ background, so
> that shouldn't be a surprise. :-)
>
> Ideally I would like to put all initialization in __init__ since then
> I would be able to use
oyster wrote:
> http://www.terrainformatica.com/htmlayout/ "uses its own lightweight
> HTML rendering engine", helps you to create applications with the "Web
> style" user interface
>
> http://ubrowser.com/ "is a library that makes it a little easier to
> embed the Mozilla Gecko rendering engine
Kurda Yon wrote:
> Hi,
>
> I have the following small problem. I run Python interactively. In the
> beginning of the run I import many functions from many modules. Than I
> execute some commands and notice that one of the imported functions
> contains a mistake. I open another terminal in which I
brasse wrote:
> Hello!
>
> I have been running in to some problems when using
> contextlib.nested(). My problem arises when using code similar to
> this:
>
> from __future__ import with_statement
>
> from contextlib import nested
>
> class Foo(object):
>
> def __init__(self, tag, fail=Fal
Mr.SpOOn wrote:
> Hi,
> I have a problem with this piece of code:
>
>
> class NoteSet(OrderedSet):
> def has_pitch(self):
> pass
> def has_note(self):
> pass
>
> class Scale(NoteSet):
> def __init__(self, root, type):
> self.append(root)
> self.type =
901 - 1000 of 3917 matches
Mail list logo