Re: Bored.

2009-11-30 Thread Bram Mertens
Ben Finney wrote: geremy condra writes: On Mon, Nov 30, 2009 at 5:14 PM, Necronymouse wrote: Hello, I am learning python for about 2 years and I am bored. Not with python but I have a little problem, when i want to write something I realise that somebody had alredy written it! That's great

Re: peppy

2009-11-30 Thread Nobody
On Tue, 01 Dec 2009 08:51:20 +0200, Johann Spies wrote: > After reading about peppy on Freshmeat I decided to try it out after > installing it using easy_install. But: > > $ peppy > File > "/usr/lib/python2.5/site-packages/peppy-0.13.2-py2.5.egg/peppy/lib/multikey.py", > line 120, in >

Re: a 100-line indentation-based preprocessor for HTML

2009-11-30 Thread Steve Howell
On Nov 28, 4:46 am, "Colin W." wrote: > On 27-Nov-09 22:04 PM, Steve Howell wrote: > > > > > Python has this really neat idea called indentation-based syntax, and > > there are folks that have caught on to this idea in the HTML > > community. > > > AFAIK the most popular indentation-based solution

Re: python and vc numbers

2009-11-30 Thread Nobody
On Mon, 30 Nov 2009 21:02:00 +1100, Daniel Dalton wrote: >> That did the trick, thanks, after I append >> [-2] > > Further testing under screen says otherwise -- it seems to give me the > tty number, not the virtual console number. Is there any way to figure > out what virtual console I'm am in

peppy

2009-11-30 Thread Johann Spies
After reading about peppy on Freshmeat I decided to try it out after installing it using easy_install. But: $ peppy Traceback (most recent call last): File "/usr/bin/peppy", line 5, in pkg_resources.run_script('peppy==0.13.2', 'peppy') File "/usr/lib/python2.5/site-packages/pkg_resources

how to debug extended module?

2009-11-30 Thread junyoung
Hi, I am a newbie who want to implement a extend module to use native python language with my own shared library. to test wrapper library(extend module, name is 'test.so'), I created some test-cases. There are some errors what I couldn't figure our reasons. ex) SystemError: error return without

Re: python and vc numbers

2009-11-30 Thread Gregory Ewing
Daniel Dalton wrote: I can't find a reliable way to determine the current console number with python or any bash tool. When I say console number, I mean the actual console number, not screen window or device it is sending to or whatever. You may be able to tell by looking at the DISPLAY environ

Re: ANN: GMPY 1.11rc1 is available

2009-11-30 Thread Mensanator
On Nov 29, 9:04 pm, casevh wrote: > Everyone, > > I'm pleased to annouce that a new version of GMPY is available. > GMPY is a wrapper for the MPIR or GMP multiple-precision > arithmetic library. GMPY 1.11rc1 is available for download from: > > http://code.google.com/p/gmpy/ > > In addition to supp

Re: python logging filters

2009-11-30 Thread Grimsqueaker
My logging behaves as I expect now and I have a better understanding of how the module functions. Thank you for taking the time to explain those points to me. :) On Nov 30, 4:10 pm, Vinay Sajip wrote: > On Nov 30, 6:52 am, Grimsqueaker wrote: > > > > > So would I be correct in saying that Filter

Re: python logging filters

2009-11-30 Thread Grimsqueaker
My logging behaves as I expect now and I have a better understanding of how the module functions. Thank you for taking the time to explain those points to me. :) On Nov 30, 4:10 pm, Vinay Sajip wrote: > On Nov 30, 6:52 am, Grimsqueaker wrote: > > > > > So would I be correct in saying that Filter

Re: python logging filters

2009-11-30 Thread Grimsqueaker
My logging behaves as I expect now and I have a better understanding of how the module functions. Thank you for taking the time to explain those points to me. :) On Nov 30, 4:10 pm, Vinay Sajip wrote: > On Nov 30, 6:52 am, Grimsqueaker wrote: > > > > > So would I be correct in saying that Filter

Re: Variables with cross-module usage

2009-11-30 Thread Lie Ryan
On 12/1/2009 7:51 AM, Terry Reedy wrote: In everyday life and natural languages, a single name can be used to refer to multiple objects just by context without referring any namespace. Namespace are contexts. They were (re)invented in programming just to make it easier to have single name could

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread casevh
On Nov 30, 2:18 pm, Joachim Dahl wrote: > I think that "C" encoding is what I need, however I run into an odd > problem. > If I use the following C code > > static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) > { >   char a, b; >   char *kwlist[] = {"a", "b", NULL}; >   if (!PyAr

Re: Creating a local variable scope.

2009-11-30 Thread r0g
markolopa wrote: > On Nov 30, 4:46 am, Dave Angel wrote: >> markolopa wrote: >> or >> whether you accidentally reused the same name without giving it a new >> value in the new loop. > > That is what I do regularly...8-> > Well really dude, you need to stop doing that. It's not a language p

Re: Can't print Chinese to HTTP

2009-11-30 Thread Gnarlodious
> you probably need to change the encoding of sys.stdout >>> sys.stdout.encoding 'UTF-8' >> #!/usr/bin/python > do you know what python version, exactly, that gets called by this hashbang? Verified in HTTP: >>> print(sys.version) 3.1.1 Is is possible modules are getting loaded from my old Python?

Re: Feature request: String-inferred names

2009-11-30 Thread The Music Guy
> Brad Harms FearsomeDragonfly at gmail.com > Mon Nov 30 05:04:37 CET 2009 > > That was a relatively simple example; classes as simple as the ones > generated by the It is more likely that the class generation could would > appear in a metaclass's class constructor or decorator function, and there

Re: Bored.

2009-11-30 Thread Jorge Cardona
2009/11/30 Stef Mientki : > Necronymouse wrote: >> >> Hello, I am learning python for about 2 years and I am bored. Not with >> python but I have a little problem, when i want to write something I >> realise that somebody had alredy written it! So i don´t want to make a >> copy of something but i w

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread kirby urner
On Mon, Nov 30, 2009 at 4:31 PM, Gregor Lingl wrote: << fascinating code >> > > Hoping, you will find this a bit interesting, > best regards > > Gregor > Really enlightening, both mathematically and from a coding point of view. I hadn't used turtle.py enough yet to know about the built-in "con

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread Gregor Lingl
kirby urner schrieb: I'm glad turtle graphics intersected my thinking re extended precision decimals (Decimal type) on edu-sig just now. I've updated my tmods.py to contain a turtle rendering the plane-net of a T-mod: http://www.4dsolutions.net/ocn/python/tmod.py (runnable source) http://www.

Re: Bored.

2009-11-30 Thread Ben Finney
geremy condra writes: > On Mon, Nov 30, 2009 at 5:14 PM, Necronymouse wrote: > > Hello, I am learning python for about 2 years and I am bored. Not > > with python but I have a little problem, when i want to write > > something I realise that somebody had alredy written it! That's great news: it

Re: How to prevent re.split() from removing part of string

2009-11-30 Thread MRAB
Jeremy wrote: I am using re.split to... well, split a string into sections. I want to split when, following a new line, there are 4 or fewer spaces. The pattern I use is: sections = re.split('\n\s{,4}[^\s]', lineoftext) This splits appropriately but I lose the character matched by [^s

Re: Bored.

2009-11-30 Thread Stef Mientki
John Bokma wrote: Stef Mientki wrote: There's also a Python site, were projects are submitted that needs something ( some even pay a little), but I can't remember where it is :-( OP: A Python program to find it :D that was the mind mapper I mentioned :-) Stef John -- htt

Re: Bored.

2009-11-30 Thread Tomasz Rola
Necronymouse wrote: > Hello, I am learning python for about 2 years and I am bored. Not > with python but I have a little problem, when i want to write > something I realise that somebody had alredy written it! So i don´t > want to make a copy of something but i wanna get better in python > skills.

Re: Bored.

2009-11-30 Thread John Bokma
Stef Mientki wrote: > There's also a Python site, were projects are submitted that needs > something ( some even pay a little), > but I can't remember where it is :-( OP: A Python program to find it :D John -- http://mail.python.org/mailman/listinfo/python-list

Re: emacs, pdb, python3, ubuntu

2009-11-30 Thread John Bokma
"K. Richard Pixley" wrote: > Does anyone have this combination working? > > And if so, which version of ubuntu and what did you have to do to get it > to work? I run Ubuntu 8.10 and use Emacs to code Python (mostly 2.5.x but I've done some small Python 3). What has Emacs to do with it? John

Re: Language and collaboration

2009-11-30 Thread Terry Reedy
Ben Finney wrote: "Emanuele D'Arrigo" writes: Ultimately I certainly appreciate the ubiquity of English even though in the interest of fairness and efficiency I'd prefer the role of common language to be given to a constructed language, such as Ido. I prefer Lojban http://www.lojban.org/> as

Re: Bored.

2009-11-30 Thread Stef Mientki
Necronymouse wrote: Hello, I am learning python for about 2 years and I am bored. Not with python but I have a little problem, when i want to write something I realise that somebody had alredy written it! So i don´t want to make a copy of something but i wanna get better in python skills. Don´t y

Re: Bored.

2009-11-30 Thread geremy condra
On Mon, Nov 30, 2009 at 5:14 PM, Necronymouse wrote: > Hello, I am learning python for about 2 years and I am bored. Not with > python but I have a little problem, when i want to write something I > realise that somebody had alredy written it! So i don´t want to make a > copy of something but i wa

emacs, pdb, python3, ubuntu

2009-11-30 Thread K. Richard Pixley
Does anyone have this combination working? And if so, which version of ubuntu and what did you have to do to get it to work? --rich -- http://mail.python.org/mailman/listinfo/python-list

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread Terry Reedy
Esmail wrote: On Nov 30, 4:37 pm, David Bolen wrote: If that's the issue, there are various ways around it. You could patch PIL itself (same function) to quote the filename when it is constructing the command. Alternatively, the tempfile module has a tempdir global you could set to some oth

Re: Completely OT

2009-11-30 Thread geremy condra
On Mon, Nov 30, 2009 at 1:21 PM, Victor Subervi wrote: > On Mon, Nov 30, 2009 at 2:00 PM, inhahe wrote: >> >> On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: >> > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi >> > wrote: >> >> >> >> >> >> If I'm not mistaken, that won't help me actually prin

Re: Questions about list-creation

2009-11-30 Thread Terry Reedy
Manuel Graune wrote: in (most) python documentation the syntax "list()" and "[]" is treated as being more or less the same thing. Untrue. List() and [] happen to both evaluate to the same thing, an empty list. But there is no reason to expect list() and [] to always evaluate to the same thing

Re: Bored.

2009-11-30 Thread Jonathan Gardner
On Nov 30, 2:14 pm, Necronymouse wrote: > Hello, I am learning python for about 2 years and I am bored. Not with > python but I have a little problem, when i want to write something I > realise that somebody had alredy written it! So i don´t want to make a > copy of something but i wanna get bette

PIL build error on Snow Leopard

2009-11-30 Thread Xiao
Hello, I haven't fully understood the nuances in the difference between Apple's system Python and MacPython. But I have just installed Python 2.6.4 from python.org. Now I'm trying to install a fresh downloaded PIL 1.1.6 but couldn't. python setup.py install gives: lipo: can't open input file: /var

Re: top-like behavior

2009-11-30 Thread Jonathan Haddad
Awesome. Thank you! Jon On Mon, Nov 30, 2009 at 4:57 PM, Tim Chase wrote: >> Is there a specific library used for displaying up to date consoles in >> the same way top behaves? > > From the last time a similar question was asked[1]: > > You might look at the sourcecode for "iotop"[2] which would

Re: Bored.

2009-11-30 Thread MRAB
Necronymouse wrote: Hello, I am learning python for about 2 years and I am bored. Not with python but I have a little problem, when i want to write something I realise that somebody had alredy written it! So i don´t want to make a copy of something but i wanna get better in python skills. Don´t y

Re: top-like behavior

2009-11-30 Thread Tim Chase
Is there a specific library used for displaying up to date consoles in the same way top behaves? From the last time a similar question was asked[1]: You might look at the sourcecode for "iotop"[2] which would make a good example (it's a "top"-like program written in Python, used for monitorin

Re: problem with lambda / closures

2009-11-30 Thread Terry Reedy
Benjamin Kaplan wrote: I don't know if anyone considers python's incomplete implementation of closures a "feature" but it's documented so it's not really a bug either. I believe Python's implementation of closures is quite complete in 3.x. In what way do you consider it otherwise? One just ha

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread Esmail
On Nov 30, 4:37 pm, David Bolen wrote: > Esmail writes: > > I dug around in the docs and found a named parameter that I can set > > when I > > call show. > > > Definition:     im.show(self, title=None, command=None) > > > I installed irfanview and specified it/its path in the parameter, > > but t

Re: Trying to understand += better

2009-11-30 Thread Terry Reedy
Roy Smith wrote: In article <4b0a01a...@dnews.tpgi.com.au>, Lie Ryan wrote: The semantic of the in-place operator is something like: x += y becomes x = x.__iadd__(y) Except that the expression x is evaluated just once instead of twice. thus foo.bar += baz becomes foo.bar = foo.bar.__iadd_

How to prevent re.split() from removing part of string

2009-11-30 Thread Jeremy
I am using re.split to... well, split a string into sections. I want to split when, following a new line, there are 4 or fewer spaces. The pattern I use is: sections = re.split('\n\s{,4}[^\s]', lineoftext) This splits appropriately but I lose the character matched by [^s]. I know I can

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread Joachim Dahl
I think that "C" encoding is what I need, however I run into an odd problem. If I use the following C code static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) { char a, b; char *kwlist[] = {"a", "b", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwrds, "|CC", kwlist, &a, &b

Re: parsing json data

2009-11-30 Thread John Bokma
f...@mauve.rahul.net (Edward A. Falk) wrote: > There's a json parsing library in 2.6. (Sadly, 2.6 is not out for > Ubuntu yet.) Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 on Ubuntu 9.04 John -- http://mail.python.org/mailman/listinfo/python-list

Language and collaboration (was: Python Statements/Keyword Localization)

2009-11-30 Thread Ben Finney
"Emanuele D'Arrigo" writes: > Ultimately I certainly appreciate the ubiquity of English even though > in the interest of fairness and efficiency I'd prefer the role of > common language to be given to a constructed language, such as Ido. I prefer Lojban http://www.lojban.org/> as being logically

Re: semantics of ** (unexpected/inconsistent?)

2009-11-30 Thread inhahe
On Mon, Nov 30, 2009 at 2:05 PM, Lie Ryan wrote: > On 12/1/2009 5:58 AM, inhahe wrote: >> >> i wasn't suggesting it as a feature for python, just pointing out why >> it might seem counterintuitive. > > I'm interested, what do YOU (inhahe) think the result should be? Should both > become -9 or both

Re: Intro To Python Using Turtle Graphics

2009-11-30 Thread Terry Reedy
Lawrence D'Oliveiro wrote: Done by Northland Polytechnic, available for download under CC-BY-NC-ND here . I have two problems with the presentation, which make things harder for the students than they should be. First, t

Re: Completely OT

2009-11-30 Thread inhahe
On Mon, Nov 30, 2009 at 2:17 PM, Lie Ryan wrote: > On 12/1/2009 5:00 AM, inhahe wrote: >> >> On Mon, Nov 30, 2009 at 12:58 PM, inhahe  wrote: >>> >>> On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi >>>  wrote: If I'm not mistaken, that won't help me actually print to screen the >>

Bored.

2009-11-30 Thread Necronymouse
Hello, I am learning python for about 2 years and I am bored. Not with python but I have a little problem, when i want to write something I realise that somebody had alredy written it! So i don´t want to make a copy of something but i wanna get better in python skills. Don´t you know what I should

Characters in arithmetic expressions (was: semantics of ** (unexpected/inconsistent?))

2009-11-30 Thread Ben Finney
MRAB writes: > Most programming languages don't differentiate in text between the > number "negative 3" and the expression "negated 3". APL does. The > former is written as "¯3" (3 preceded by the overscore character) and > the latter as "-3" (3 preceded by the minus sign). Well, since we're tal

Re: top-like behavior

2009-11-30 Thread John Bokma
Jonathan Haddad wrote: > Is there a specific library used for displaying up to date consoles in > the same way top behaves? No experience but I am quite sure that curses behaves like that. http://www.amk.ca/python/howto/curses/ via http://www.google.com/search?q=python%20curses John -- http:

Re: os.remove() permission problem

2009-11-30 Thread Christian Heimes
Victor Subervi wrote: > When I go into the python interpreter and execute that statement, it > succeeds. What have I missed? You are confusing the permissions of a Unix file system. In order to create or a remove a file from a directory you need the x and w permission to enter the directory (x) an

Re: Running function from win32 dll

2009-11-30 Thread Terry Reedy
Nadav Chernin wrote: I want to run function from win32 dll. I used ctypes.windll.LoadLibrary to load the DLL. But I don’t know how to select function and run it. Which part of the Lib manual chapter did you not understand? -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Not Callable, float?

2009-11-30 Thread Terry Reedy
W. eWatson wrote: I think I understand it, but how does one prevent it from happening, or know it's the cause? That msg I got? Yes. The message 'x is not callable', where x is a name of something you expect to be callable (such as the builtin functions and classes), signals that x has been r

Re: PySerial and termios

2009-11-30 Thread Glazner
On Nov 30, 7:41 pm, Grant Edwards wrote: > On 2009-11-30, a b wrote: > > > I have a pain in the a** problem with pyserial- it works 90% > > of time but on the 10% of time it thorows and termios.error > > exception with the value (5, 'Input/output error') and i > > cannot get rid of it :( > > Soun

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread David Bolen
Esmail writes: > I dug around in the docs and found a named parameter that I can set > when I > call show. > > Definition: im.show(self, title=None, command=None) > > I installed irfanview and specified it/its path in the parameter, > but that didn't work either. It's really quite puzzling in

Re: Feature request: String-inferred names

2009-11-30 Thread Terry Reedy
Brad Harms wrote: Well, yes, the names would have to be determined at run time. That's what getattr and setattr do, except that that do it in the context of an object rather than the local scope. However, I was under the impression that python's mechanism for looking up local names was the sam

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread Alf P. Steinbach
* Edward Cherlin: On Sun, Nov 29, 2009 at 11:34, Brian Blais wrote: After a bit of playing, I realized that I couldn't think of many exaples which use turtle with conditional structures (if- and while- statements), Repeat is used much more often. but of course we can provide examples of any

top-like behavior

2009-11-30 Thread Jonathan Haddad
Is there a specific library used for displaying up to date consoles in the same way top behaves? Thanks in advance, Jon -- http://mail.python.org/mailman/listinfo/python-list

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread casevh
On Nov 30, 1:04 pm, Joachim Dahl wrote: > Obviously the name of the C function and the char variable cannot both > be foo, > so the C code should be: > > static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) > { >   char foochar; >   char *kwlist[] = {"foochar", NULL}; >   if (!PyA

Re: parsing json data

2009-11-30 Thread Edward A. Falk
There's a json parsing library in 2.6. (Sadly, 2.6 is not out for Ubuntu yet.) -- -Ed Falk, f...@despams.r.us.com http://thespamdiaries.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Challenges for beginners?

2009-11-30 Thread Edward A. Falk
In article <09ea817f-57a9-44a6-b815-299ae3ce7...@x5g2000prf.googlegroups.com>, alex23 wrote: >On Nov 27, 1:24 pm, astral orange <457r0...@gmail.com> wrote: >> I would like to test out what I know so far by solving programming >> challenges. > >Project Euler can be a lot of fun: http://projecteule

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread Joachim Dahl
Obviously the name of the C function and the char variable cannot both be foo, so the C code should be: static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) { char foochar; char *kwlist[] = {"foochar", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwrds, "c", kwlist, &foocha

PyArg_ParseTupleAndKeywords in Python3.1

2009-11-30 Thread Joachim Dahl
I am updating an extension module from Python2.6 to Python3. I used to pass character codes to the extension module, for example, I would write: >>> foo('X') with the corresponding C extension routine defined as follows: static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds) { ch

Re: Variables with cross-module usage

2009-11-30 Thread Terry Reedy
Lie Ryan wrote: On 11/30/2009 12:00 PM, Terry Reedy wrote: Dennis Lee Bieber wrote: In these languages, the names always refer to the same location. Python confuses matters by having names that don't really refer to location, but are attached to the objects. In everyday life and natural lang

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread kirby urner
I'm glad turtle graphics intersected my thinking re extended precision decimals (Decimal type) on edu-sig just now. I've updated my tmods.py to contain a turtle rendering the plane-net of a T-mod: http://www.4dsolutions.net/ocn/python/tmod.py (runnable source) http://www.flickr.com/photos/17157..

Re: os.remove() permission problem

2009-11-30 Thread Martijn Arts
On Mon, Nov 30, 2009 at 8:21 PM, Victor Subervi wrote: > Hi; > I get the following error when I try > os.remove(file) > > *OSError*: [Errno 13] Permission denied: 'particulars.py' > args = (13, 'Permission denied') > errno = 13 > filename = 'particulars.py' > strerror = 'Pe

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread Esmail
On Nov 30, 3:08 pm, Lie Ryan wrote: > > What's your default image viewer? im.show is intended to be for > debugging purpose and may always guaranteed to work if your image viewer > doesn't support receiving the file through the image to the program>. It's whatever the default windows viewer is

Re: os.remove() permission problem

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 3:21 PM, Victor Subervi wrote: > Hi; > I get the following error when I try > os.remove(file) > > *OSError*: [Errno 13] Permission denied: 'particulars.py' > args = (13, 'Permission denied') > errno = 13 > filename = 'particulars.py' > strerror = 'Pe

Re: Questions about list-creation

2009-11-30 Thread Luis Zarrabeitia
On Monday 30 November 2009 12:22:17 pm Manuel Graune wrote: > > when using local variables in list comprehensions, say > > a=[i for i in xrange(10)] > > the local variable is not destroyed afterwards: [...] > b=list(j for j in xrange(10)) > > the local variable is destroyed after use: Actually, []

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread Lie Ryan
On 12/1/2009 5:04 AM, Esmail wrote: im = Image.open('c://mypic.jpg') sorry, slip of the finger, there's only one forward slash or you can use two backward slashes. The problem isn't with opening it (I know it opens fine since I can get its size attribute via im.size) - the show() is the pr

Re: Questions about list-creation

2009-11-30 Thread Stephen Hansen
On Mon, Nov 30, 2009 at 9:22 AM, Manuel Graune wrote: > in (most) python documentation the syntax "list()" > and "[]" is treated as being more or less the same > thing. For example "help([])" and "help(list())" point > to the same documentation. Since there are at least > two cases where this simi

Re: semantics of ** (unexpected/inconsistent?)

2009-11-30 Thread Brian J Mingus
On Sun, Nov 29, 2009 at 5:58 PM, Esmail wrote: > Brian J Mingus wrote: > >> >> >> >> I think you answered your own question. 3**2 comes first in the order of >> operations, followed by the negation. >> > > No, that's not the problem, I'm ok with the operator precedence of - vs ** > > My problem i

Re: Can't print Chinese to HTTP

2009-11-30 Thread exarkun
On 05:05 pm, gnarlodi...@gmail.com wrote: Thanks for the help, but it doesn't work. All I get is an error like: UnicodeEncodeError: 'ascii' codec can't encode character '\\u0107' in position 0: ordinal not in range(128) It does work in Terminal interactively, after I import the sys module. But

os.remove() permission problem

2009-11-30 Thread Victor Subervi
Hi; I get the following error when I try os.remove(file) *OSError*: [Errno 13] Permission denied: 'particulars.py' args = (13, 'Permission denied') errno = 13 filename = 'particulars.py' strerror = 'Permission denied' Here are the permissions: -rwxr-xr-x 1 root root 45

Re: Completely OT

2009-11-30 Thread Lie Ryan
On 12/1/2009 5:00 AM, inhahe wrote: On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi wrote: If I'm not mistaken, that won't help me actually print to screen the user's choices as he selects them, which in my application, is important. Please

Re: semantics of ** (unexpected/inconsistent?)

2009-11-30 Thread Lie Ryan
On 12/1/2009 5:58 AM, inhahe wrote: i wasn't suggesting it as a feature for python, just pointing out why it might seem counterintuitive. I'm interested, what do YOU (inhahe) think the result should be? Should both become -9 or both become 9. What was your expectation when you wrote that post

Re: how to format a python source file with tools?

2009-11-30 Thread Lie Ryan
On 12/1/2009 4:30 AM, Falcolas wrote: Nonetheless, it would be better to implement coding standards that everyone can stick to. Agreed. You can't solve social issues with program. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread Stephen Hansen
On Mon, Nov 30, 2009 at 9:57 AM, Esmail wrote: > Hello all. > > I am using the PIL 1.1.6 and Python 2.6.x under XP without any > problems. However, I can't display any images under Vista > or Windows 7. I could understand Windows 7 as it's relatively > new, but Vista has been around for a bit. >

Re: Can't print Chinese to HTTP

2009-11-30 Thread Ned Deily
In article , Gnarlodious wrote: > It does work in Terminal interactively, after I import the sys module. > But my script doesn't act the same. Here is my entire script: > > #!/usr/bin/python > print("Content-type:text/plain;charset=utf-8\n\n") > import sys > sys.stdout.buffer.write('ùÁÄn'.enco

Re: semantics of ** (unexpected/inconsistent?)

2009-11-30 Thread inhahe
On Mon, Nov 30, 2009 at 1:53 PM, Chris Rebert wrote: >> On Mon, Nov 30, 2009 at 3:46 AM, Gregory Ewing >> wrote: >>> Esmail wrote: >>> Wow .. never heard of Concatenative_languages languages before or the distinction you make. Your distinction explains the behavior, but I find it s

Re: High-performance Python websites

2009-11-30 Thread inhahe
On Wed, Nov 25, 2009 at 7:33 PM, ShoqulKutlu wrote: > Hi, > > Managing load of high volume of visitors is a common issue for all > kind of web technologies. I mean this is not the python issue. This > issue is mostly about server level designs. You need to supply load > balancing for both web serv

Re: semantics of ** (unexpected/inconsistent?)

2009-11-30 Thread Chris Rebert
> On Mon, Nov 30, 2009 at 3:46 AM, Gregory Ewing > wrote: >> Esmail wrote: >> >>> Wow .. never heard of Concatenative_languages languages before or the >>> distinction you make. Your distinction explains the behavior, but I >>> find it somewhat counter-intuitive. >> >> You shouldn't find it any mo

Re: multiprocessing.connection with ssl

2009-11-30 Thread Ned Deily
In article <8ff1698c-8205-4171-9e41-2e382bd52...@g23g2000vbr.googlegroups.com>, Xavier wrote: > I've hacked multiprocessing.connection (in a basic way) to allow ssl > encryption using ssl.wrap_socket. > > Anybody knows how i can contribute this to main developers? If you haven't already, open

Re: Completely OT

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 2:37 PM, inhahe wrote: > On Mon, Nov 30, 2009 at 1:21 PM, Victor Subervi > wrote: > > On Mon, Nov 30, 2009 at 2:00 PM, inhahe wrote: > >> > >> On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: > >> > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi > >> > wrote: > >> >>

Re: Completely OT

2009-11-30 Thread inhahe
On Mon, Nov 30, 2009 at 1:21 PM, Victor Subervi wrote: > On Mon, Nov 30, 2009 at 2:00 PM, inhahe wrote: >> >> On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: >> > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi >> > wrote: >> >> >> >> >> >> If I'm not mistaken, that won't help me actually prin

Re: Can't print Chinese to HTTP

2009-11-30 Thread Lie Ryan
On 12/1/2009 4:05 AM, Gnarlodious wrote: Thanks for the help, but it doesn't work. All I get is an error like: UnicodeEncodeError: 'ascii' codec can't encode character '\\u0107' in position 0: ordinal not in range(128) The error says it all; you're trying to encode the chinese character using

Re: reading from a text file

2009-11-30 Thread Tim Golden
inhahe wrote: i don't understand the point of using 'with' but i don't understand what 'with' does at all i've tried to understand it a few times anyway here: import random result = random.choice(open("c:\\test.txt").readlines()) Yep. That'll do the trick. The point of "with" is that, while i

Re: Questions about list-creation

2009-11-30 Thread inhahe
i should also mention that a=[i for i in xrange(10)] and b=list(j for j in xrange(10)) isn't really just a difference of using [] vs. list() the first case is a list comprehension, the second case is a generator comprehension which is then converted to a list (the bug only applies to list compr

Re: Questions about list-creation

2009-11-30 Thread Mel
Manuel Graune wrote: > in (most) python documentation the syntax "list()" > and "[]" is treated as being more or less the same > thing. For example "help([])" and "help(list())" point > to the same documentation. Since there are at least > two cases where this similarity is not the case, (see belo

Re: Completely OT

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 1:35 PM, Dennis Lee Bieber wrote: > On Mon, 30 Nov 2009 07:26:09 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > Hi; > > I need a recommendation. I want to print out data like this: > > > > blue > > red > > >Why all the off-pag

Re: Completely OT

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 2:00 PM, inhahe wrote: > On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: > > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi > > wrote: > >> > >> > >> If I'm not mistaken, that won't help me actually print to screen the > user's > >> choices as he selects them, which in

Re: Questions about list-creation

2009-11-30 Thread Lie Ryan
On 12/1/2009 4:22 AM, Manuel Graune wrote: Hello, in (most) python documentation the syntax "list()" and "[]" is treated as being more or less the same thing. For example "help([])" and "help(list())" point to the same documentation. Since there are at least two cases where this similarity is n

Re: Can't print Chinese to HTTP

2009-11-30 Thread Aahz
In article , Gnarlodious wrote: > >Thanks for the help, but it doesn't work. All I get is an error like: > >UnicodeEncodeError: 'ascii' codec can't encode character '\\u0107' in >position 0: ordinal not in range(128) No time to give you more info, but you probably need to change the encoding of

Re: Questions about list-creation

2009-11-30 Thread inhahe
On Mon, Nov 30, 2009 at 12:22 PM, Manuel Graune wrote: > > Hello, > > in (most) python documentation the syntax "list()" > and "[]" is treated as being more or less the same > thing. For example "help([])" and "help(list())" point > to the same documentation. Since there are at least > two cases w

Re: Feature request: String-inferred names

2009-11-30 Thread Lie Ryan
On 12/1/2009 3:35 AM, Bruno Desthuilliers wrote: Lie Ryan a écrit : On 11/28/2009 3:08 PM, The Music Guy wrote: (snip the part about the proposed feature - which I don't like but that's not the point) My projects rely on a lot of metaclassing for the automatic generation of properties and me

Re: Python Statements/Keyword Localization

2009-11-30 Thread Emanuele D'Arrigo
Thank you all for the insights. I particularly like the broad spread of opinions on the subject. Indeed when I wrote the original post my thoughts were with those young students of non-English speaking countries that start learning to program before they learn English. My case is almost one of tho

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread Esmail
> >   im = Image.open('c://mypic.jpg') sorry, slip of the finger, there's only one forward slash or you can use two backward slashes. The problem isn't with opening it (I know it opens fine since I can get its size attribute via im.size) - the show() is the problem. Esmail -- http://mail.python

Re: semantics of ** (unexpected/inconsistent?)

2009-11-30 Thread MRAB
Lie Ryan wrote: On 11/30/2009 12:38 PM, Esmail wrote: Thanks all!! I get it now :-) It helped to have a number of different explanations, thanks for taking the time to post. Much appreciated. I generally do not expect operator precedence to be reliable at all except for: + - (binary ops, n

Re: Completely OT

2009-11-30 Thread inhahe
On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi > wrote: >> >> >> If I'm not mistaken, that won't help me actually print to screen the user's >> choices as he selects them, which in my application, is important. Please >> advise. >> TIA, >> V > >

Re: Noobie python shell question

2009-11-30 Thread John Posner
On Sun, 29 Nov 2009 22:03:09 -0500, tuxsun wrote: I've been working in the shell on and off all day, and need to see if a function I defined earlier is defined in the current shell I'm working in. Is there a shell command to get of list of functions I've defined? How about this: #

  1   2   3   >