Re: [OT] Comparing VCS tools

2011-04-27 Thread Ben Finney
Ben Finney writes: > Tim Chase writes: > > Mercurial (hg) > > == […] > > Cons: > > - no biggies that I've found > > - (Anecdotal) Merge algorithm sometimes fails catastrophically. I'm going to retract this one point. Merging is not as clear as in Bazaar, but not enough to count agai

Re: Life

2011-04-27 Thread Kelly James
Only an experienced person can tell about life in this great way. http://www.insurancesos.co.uk/articles/life-insurance/index.html"; rel="dofollow">Life Insurance UK -- http://mail.python.org/mailman/listinfo/python-list

Re: recommended Emacs mode (was Re: Development tools and practices for Pythonistas)

2011-04-27 Thread rusi
On Apr 27, 11:39 am, Gour-Gadadhara Dasa wrote: > On Tue, 26 Apr 2011 07:39:41 -0700 (PDT) > > snorble wrote: > > I'm not a Pythonista, but I aspire to be. > > > My current tools: > > > Python, gvim, OS file system > > I'm also starting with Python after abandoning idea to use D for our > desktop

Re: recommended Emacs mode

2011-04-27 Thread Gour-Gadadhara Dasa
On Wed, 27 Apr 2011 00:51:01 -0700 (PDT) rusi wrote: > > b) python-mode.el or > > Thats what I use. Upon hearing there is some bug in 23.2 branches with this mode, I've switched to 'emacs-devel' port and will start with this mode as well. Thanks. Sincerely, Gour -- “In the material world,

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Jean-Michel Pichavant
Ben Finney wrote: Mercurial – are the ones to choose from. Anoyone recommending a VCS tool that has poor merging support (such as Subversion or, heaven help us, CVS) is doing the newcomer a disservice. True enough. But the modern crop of first-tier VCSen – Bazaar, Git, For a single user, there

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Chris Angelico
On Wed, Apr 27, 2011 at 7:24 PM, Jean-Michel Pichavant wrote: > For a single user, there would be no merge issue. And svn is very simple to > use. > That would not be a such bad advice for a beginner with VCS systems. As someone who for years had "nightly backups and renamed files" as his only VC

Re: client-server parallellised number crunching

2011-04-27 Thread Thomas Rachel
Am 26.04.2011 21:55, schrieb Hans Georg Schaathun: Now, I would like to use remote hosts as well, more precisely, student lab boxen which are rather unreliable. By experience I'd expect to lose roughly 4-5 jobs in 100 CPU hours on average. Thus I need some way of detecting lost connections and

Re: Py_INCREF() incomprehension

2011-04-27 Thread Thomas Rachel
Am 26.04.2011 20:44, schrieb Hegedüs Ervin: and (maybe) final question: :) I defined many exceptions: static PyObject *cibcrypt_error_nokey; static PyObject *cibcrypt_error_nofile; static PyObject *cibcrypt_error_badpad; ... void handle_err(int errcode) { switch(errcode) { case

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Tue, 26 Apr 2011 23:54:24 -0700, geremy condra wrote: : This sounds like a hadoop job, with the caveat that you still have to : get your objects across the network somehow. Have you tried xdrlib or : the struct module? I suspect either would save you some time. Packing the objects up does

minimal python27.dll?

2011-04-27 Thread est
Hi guys, I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX it), which parts of python27.dll do you think can be removed? >From what I think, these parts are not neede

Re: De-tupleizing a list

2011-04-27 Thread John Pinner
On Apr 26, 4:28 am, Gnarlodious wrote: > I have an SQLite query that returns a list of tuples: > > [('0A',), ('1B',), ('2C',), ('3D',),... > > What is the most Pythonic way to loop through the list returning a > list like this?: > > ['0A', '1B', '2C', '3D',... > > -- Gnarlie If you want to handle

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Jean-Michel Pichavant
Chris Angelico wrote: On Wed, Apr 27, 2011 at 7:24 PM, Jean-Michel Pichavant wrote: For a single user, there would be no merge issue. And svn is very simple to use. That would not be a such bad advice for a beginner with VCS systems. As someone who for years had "nightly backups and r

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Anssi Saari
Jean-Michel Pichavant writes: > For a single user, there would be no merge issue. Really? What about a single user with many computers and environments? I find myself merging files on occasion because I edited them separately and forgot to check in changes before doing more edits on a different

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Ben Finney
Jean-Michel Pichavant writes: > Ben Finney wrote: > > Mercurial – are the ones to choose from. Anoyone recommending a VCS tool > > that has poor merging support (such as Subversion or, heaven help us, > > CVS) is doing the newcomer a disservice. > > True enough. But the modern crop of first-tie

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Jean-Michel Pichavant
Anssi Saari wrote: Jean-Michel Pichavant writes: For a single user, there would be no merge issue. Really? What about a single user with many computers and environments? I find myself merging files on occasion because I edited them separately and forgot to check in changes before doi

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Wed, 27 Apr 2011 11:35:16 +0200, Thomas Rachel wrote: : As far as I understand, you acquire a job, send it to a remote host via : a socket and then wait for the answer. Is that correct? That's correct. And the client initiates the connection. At the moment, I use one thread per connecti

Re: Reading Huge UnixMailbox Files

2011-04-27 Thread Nobody
On Tue, 26 Apr 2011 14:02:23 -0700, Dan Stromberg wrote: > For the archive: This assumes traditional mbox. A SysV-ish sendmail, > for example, may not like it. sendmail itself doesn't deal with mailboxes or spool files; that task is left to the local delivery agent (e.g. mail.local or procmail).

Re: Terrible FPU performance

2011-04-27 Thread Mihai Badoiu
I'm using intel xeon harpertown (E5450) and Python 2.6.4. In the cython code, when I use fpclassify, in the slow case I get 3 (FP_SUBNORMAL) In the pure-C code, when I use fpclassify, in the case that's supposed to be slow but it's not, I get a 2 (FP_ZERO) Somehow, the FPU's have different result

Re: client-server parallellised number crunching

2011-04-27 Thread Chris Angelico
On Wed, Apr 27, 2011 at 10:21 PM, Hans Georg Schaathun wrote: > On Wed, 27 Apr 2011 11:35:16 +0200, Thomas Rachel >   wrote: > :  As far as I understand, you acquire a job, send it to a remote host via > :  a socket and then wait for the answer. Is that correct? > > That's correct.  And the clien

unpickling derived LogRecord in python 2.7 from python2.6

2011-04-27 Thread ivdn...@gmail.com
Hello all, I have a service that runs in python 2.6.4. This service sends LogRecords to a log monitoring app on my workstation running python 2.7. The LogRecord class is derived: class LogRecord(logging.LogRecord): def __init__(self, name, level, fn, lno, user, hostname, msg, args, exc_info,

How to upload a file

2011-04-27 Thread Torsten Bronger
Hallöchen! I'm skimming through the various recipies for uploading a file via HTTP. Unfortunately, all of them are awkward but also rather old. (See for example http://stackoverflow.com/questions/68477/send-file-using-post-from-a-python-script) In my module, I do my HTTP request like this: open

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Wed, 27 Apr 2011 23:35:06 +1000, Chris Angelico wrote: : On Wed, Apr 27, 2011 at 10:21 PM, Hans Georg Schaathun : wrote: : > That's correct.  And the client initiates the connection.  At the : > moment, I use one thread per connection, and don't really want to : > spend the time t

Re: Case study: debugging failed assertRaises bug

2011-04-27 Thread R David Murray
Ben Finney benfinney.id.au> writes: > > (1) assertRaises REALLY needs a better error message. If not a custom > > message, at least it should show the result it got instead of an > > exception. > > +1 > > Is this one of the many improvements in Python 3.2's ‘unittest’ that > Michael Foord presid

Re: client-server parallellised number crunching

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 12:15 AM, Hans Georg Schaathun wrote: > Quite.  I was referring to some tutorials and documentation recommending > to use non-blocking sockets and select() within a single thread.  I > cannot say that I understand why, but I can imagine the benefit with > heavy traffic. O

Re: minimal python27.dll?

2011-04-27 Thread Tim Golden
On 27/04/2011 11:43, est wrote: I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX it), which parts of python27.dll do you think can be removed? Perhaps have a look

Deditor

2011-04-27 Thread Kruptein
Hey, I released a new version (0.2.5) of my pythonic text-editor called Deditor. It is a text-editor aimed to fasten your python development. (it perfectly handels other languages too) Some features are: - python shell to do quick commands or checks - pyflakes error check on save - pylint error c

Re: unpickling derived LogRecord in python 2.7 from python2.6

2011-04-27 Thread Peter Otten
ivdn...@gmail.com wrote: > I have a service that runs in python 2.6.4. This service sends > LogRecords to a log monitoring app on my workstation running python > 2.7. The LogRecord class is derived: > > class LogRecord(logging.LogRecord): > > def __init__(self, name, level, fn, lno, user, ho

Re: Deditor

2011-04-27 Thread Alec Taylor
Thanks, any plans for a Windows version? On Thu, Apr 28, 2011 at 1:53 AM, Kruptein wrote: > Hey, > > I released a new version (0.2.5) of my pythonic text-editor called > Deditor. > > It is a text-editor aimed to fasten your python development. (it > perfectly handels other languages too) > Some f

Have you read the Python docs lately?

2011-04-27 Thread Raymond Hettinger
A number of developers have been working on adding examples and useful advice to the docs. To sharpen your skills, here are some pieces of recommended reading: http://docs.python.org/dev/library/heapq.html#priority-queue-implementation-notes http://docs.python.org/dev/library/bisect.html#searchi

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Thomas Rachel
Am 27.04.2011 13:17, schrieb Jean-Michel Pichavant: You're mistaking, SVN is not restricted to solo work. However it's more suitable for solo work than git. Why? I personally found hg much better than svn. That's why I migrated all my projects. Thomas -- http://mail.python.org/mailman/lis

Re: Deditor

2011-04-27 Thread Kruptein
On 27 apr, 19:22, Alec Taylor wrote: > Thanks, any plans for a Windows version? > > > > On Thu, Apr 28, 2011 at 1:53 AM, Kruptein wrote: > > Hey, > > > I released a new version (0.2.5) of my pythonic text-editor called > > Deditor. > > > It is a text-editor aimed to fasten your python development

Re: Have you read the Python docs lately?

2011-04-27 Thread Irmen de Jong
On 27-4-2011 19:56, Raymond Hettinger wrote: > A number of developers have been working on adding examples and useful > advice to the docs. To sharpen your skills, here are some pieces of > recommended reading: > > http://docs.python.org/dev/library/heapq.html#priority-queue-implementation-notes

ElementTree XML parsing problem

2011-04-27 Thread Mike
I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: The complaint offered up by the parser is Unexpected error opening simple_fail.xml: not well-formed (invalid token): line 5, col

Re: Python IDE/text-editor

2011-04-27 Thread Stefaan Himpe
Thanks for all the suggestions, glad I found the right one! You're welcome :D -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree XML parsing problem

2011-04-27 Thread Benjamin Kaplan
On Wed, Apr 27, 2011 at 2:26 PM, Mike wrote: > I'm using ElementTree to parse an XML file, but it stops at the second > record (id = 002), which contains a non-standard ascii character, ä. Here's > the XML: > > > > > > > > > > > The complaint offered up by the parser is > > Unexpected erro

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Thu, 28 Apr 2011 00:58:22 +1000, Chris Angelico wrote: : thousand threads? a couple of million? In Python, it'll probably end : up pretty similar; chances are you won't be taking much advantage of : multiple CPUs/cores (because the threads will all be waiting for : socket read, or the sin

Re: Terrible FPU performance

2011-04-27 Thread David Cournapeau
On Wed, Apr 27, 2011 at 10:04 PM, Mihai Badoiu wrote: > I'm using intel xeon harpertown (E5450) and Python 2.6.4. > In the cython code, when I use fpclassify, in the slow case I get 3 > (FP_SUBNORMAL) > In the pure-C code, when I use fpclassify, in the case that's supposed to be > slow but it's no

Re: [OT] VCS tools (was "Development tools and practices for Pythonistas")

2011-04-27 Thread Tim Chase
On 04/27/2011 04:24 AM, Jean-Michel Pichavant wrote: Ben Finney wrote: Mercurial – are the ones to choose from. Anoyone recommending a VCS tool that has poor merging support (such as Subversion or, heaven help us, CVS) is doing the newcomer a disservice. True enough. But the modern crop of fir

Re: [OT] Comparing VCS tools

2011-04-27 Thread Tim Chase
On 04/26/2011 09:45 PM, Ben Finney wrote: Tim Chase writes: Bazaar (bzr) Cons: - was slow, though I understand they've worked on improving this Right, that's not a count against Bazaar for at least the last several versions (since 2009 at least). Bazaar is easily fast enough for

Re: ElementTree XML parsing problem

2011-04-27 Thread Neil Cerutti
On 2011-04-27, Mike wrote: > I'm using ElementTree to parse an XML file, but it stops at the > second record (id = 002), which contains a non-standard ascii > character, ?. Here's the XML: > > > > > > > > > > > The complaint offered up by the parser is > > Unexpected error opening simple_fail.xml:

Re: De-tupleizing a list

2011-04-27 Thread Algis Kabaila
On Wednesday 27 April 2011 20:56:20 John Pinner wrote: > On Apr 26, 4:28 am, Gnarlodious wrote: > > I have an SQLite query that returns a list of tuples: > > > > [('0A',), ('1B',), ('2C',), ('3D',),... > > > > What is the most Pythonic way to loop through the list > > returning a list like this?

Re: ElementTree XML parsing problem

2011-04-27 Thread Philip Semanchuk
On Apr 27, 2011, at 2:26 PM, Mike wrote: > I'm using ElementTree to parse an XML file, but it stops at the second record > (id = 002), which contains a non-standard ascii character, ä. Here's the XML: > > > > > > > > > > > The complaint offered up by the parser is > > Unexpected error

Re: ElementTree XML parsing problem

2011-04-27 Thread Hegedüs Ervin
hello, > I'm using ElementTree to parse an XML file, but it stops at the > second record (id = 002), which contains a non-standard ascii > character, ä. Here's the XML: > > > > > > > > > > > The complaint offered up by the parser is I've checked this xml with your script, I think your l

Re: Deditor

2011-04-27 Thread Algis Kabaila
On Thursday 28 April 2011 01:53:18 Kruptein wrote: > Hey, > > I released a new version (0.2.5) of my pythonic text-editor > called Deditor. >snip... > ( only a .deb is available for download now, if you would > like another format (.tar.gz) please comment ) Congratulations! Though I am happy wi

Re: Deditor

2011-04-27 Thread Kruptein
On 27 apr, 21:46, Algis Kabaila wrote: > On Thursday 28 April 2011 01:53:18 Kruptein wrote: > > > Hey, > > > I released a new version (0.2.5) of my pythonic text-editor > > called Deditor. > >snip... > > ( only a .deb is available for download now, if you would > > like another format (.tar.gz) pl

I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread Igor Soares
Reading the section "6.11. The import statement" http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement I found: """ Import statements are executed in two steps: (1) find a module, and initialize it if necessary; (2) define a name or names in the local namespace (of the scope

Re: minimal python27.dll?

2011-04-27 Thread Martin v. Loewis
Am 27.04.2011 12:43, schrieb est: > Hi guys, > > I need to ship python runtime environment package on Windows, if I > want to stripping unnessasery functions from python27.dll to make it > as small as possible(and perhaps finally UPX it), which parts of > python27.dll do you think can be removed?

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
On 4/27/2011 12:33 PM, Hegedüs Ervin wrote: hello, I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: The complaint offered up by the parser is I've checked this xml with your sc

Re: unpickling derived LogRecord in python 2.7 from python2.6

2011-04-27 Thread Vinay Sajip
On Apr 27, 5:41 pm, Peter Otten <__pete...@web.de> wrote: > The Problem is that as of Python 2.7logging.LogRecord has become a newstyle > class which is pickled/unpickled differently. I don't know if there is an > official way to do the conversion, but here's what I've hacked up. > The script can

Re: Deditor

2011-04-27 Thread Yico Gaga
why not linux? 2011/4/28 Alec Taylor > Thanks, any plans for a Windows version? > > On Thu, Apr 28, 2011 at 1:53 AM, Kruptein wrote: > > Hey, > > > > I released a new version (0.2.5) of my pythonic text-editor called > > Deditor. > > > > It is a text-editor aimed to fasten your python developm

Re: Deditor

2011-04-27 Thread geremy condra
On Wed, Apr 27, 2011 at 1:47 PM, Yico Gaga wrote: >  why not linux? The download is a .deb, ie, for Debian and Ubuntu. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
On 4/27/2011 12:24 PM, Neil Cerutti wrote: On 2011-04-27, Mike wrote: I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ?. Here's the XML: The complaint offered up by the parser is Unexpected error

Re: Deditor

2011-04-27 Thread Yico Gaga
yeah ,I know ,Ubuntu is based on Debian , i said why not linux , because someone ask for windows version of this Deditor , so, I type :why not linux.. i mean he may like to try a linux-desktop OS; THX~ 2011/4/28 geremy condra > On Wed, Apr 27, 2011 at 1:47 PM, Yico Gaga wrote: > > why not linu

Re: I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread Ken Watford
On Wed, Apr 27, 2011 at 4:02 PM, Igor Soares wrote: > Reading the section "6.11. The import statement" > http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement > > I found: > """ > Import statements are executed in two steps: (1) find a module, and > initialize it if necessar

Reliably call code after object no longer exists or is "unreachable"?

2011-04-27 Thread Jack Bates
In Python, how can you reliably call code - but wait until an object no longer exists or is "unreachable"? I want to ensure that some code is called (excluding some exotic situations like when the program is killed by a signal not handled by Python) but can't call it immediately. I want to wait un

Re: minimal python27.dll?

2011-04-27 Thread Ryan Kelly
On Wed, 2011-04-27 at 22:06 +0200, Martin v. Loewis wrote: > Am 27.04.2011 12:43, schrieb est: > > Hi guys, > > > > I need to ship python runtime environment package on Windows, if I > > want to stripping unnessasery functions from python27.dll to make it > > as small as possible(and perhaps final

Re: Have you read the Python docs lately?

2011-04-27 Thread Dan Stromberg
On Wed, Apr 27, 2011 at 10:56 AM, Raymond Hettinger wrote: > A number of developers have been working on adding examples and useful > advice to the docs.  To sharpen your skills, here are some pieces of > recommended reading: > > http://docs.python.org/dev/library/heapq.html#priority-queue-impleme

Re: I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread Igor Soares
On Apr 27, 6:21 pm, Ken Watford wrote: > On Wed, Apr 27, 2011 at 4:02 PM, Igor Soares wrote: > > Reading the section "6.11. The import statement" > >http://docs.python.org/py3k/reference/simple_stmts.html#the-import-st... > > > I found: > > """ > > Import statements are executed in two steps: (1)

Re: Have you read the Python docs lately?

2011-04-27 Thread Ben Finney
Raymond Hettinger writes: > A number of developers have been working on adding examples and useful > advice to the docs. To sharpen your skills, here are some pieces of > recommended reading: Great stuff, and thank you for directing us to some gems. > http://docs.python.org/dev/howto/logging.ht

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Ben Finney
Thomas Rachel writes: > Am 27.04.2011 13:17, schrieb Jean-Michel Pichavant: > > > You're mistaking, SVN is not restricted to solo work. However it's > > more suitable for solo work than git. > > Why? > > I personally found hg much better than svn. That's why I migrated all > my projects. Indeed.

Re: I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread MRAB
On 27/04/2011 21:02, Igor Soares wrote: Reading the section "6.11. The import statement" http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement I found: """ Import statements are executed in two steps: (1) find a module, and initialize it if necessary; (2) define a name or

Re: minimal python27.dll?

2011-04-27 Thread est
On Apr 27, 11:15 pm, Tim Golden wrote: > Perhaps have a look at tinypy? > >    http://www.tinypy.org/ > > Even if it's not exactly what you want, I expect that the > author will have useful ideas / experience. > > TJG Thanks, but I still need the completeness of CPython. AFAIK TinyPy is a python

use of index (beginner's question)

2011-04-27 Thread Rusty Scalf
Greetings, I am just now learning python and am trying to use the index function with variables. list1 = ['pig', 'horse', 'moose'] list2 = ['62327', '49123', '79115'] a = list2[list1.index('horse')] print a >49123 -works fine. But list1 = ['pig', 'horse', 'moose'] list2 = ['62327', '4912

Re: use of index (beginner's question)

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 10:42 AM, Rusty Scalf wrote: > list1 = ['pig', 'horse', 'moose'] > list2 =  ['62327', '49123', '79115'] > n = 2 > s2 = "list" + `n` > a = s2[list1.index('horse')] > print a s2 is a string with the value "list2"; this is not the same as the variable list2. You could use eva

Re: Reliably call code after object no longer exists or is "unreachable"?

2011-04-27 Thread Thomas 'PointedEars' Lahn
Jack Bates wrote: > Python's __del__ or destructor method works (above) - but only in the > absence of reference cycles (below). An object, with a __del__ method, > in a reference cycle, causes all objects in the cycle to be > "uncollectable". This can cause memory leaks and because the object is

Re: Reliably call code after object no longer exists or is "unreachable"?

2011-04-27 Thread Dan Stromberg
On Wed, Apr 27, 2011 at 5:54 PM, Thomas 'PointedEars' Lahn < pointede...@web.de> wrote: > Jack Bates wrote: > > Faced with the real potential for reference cycles, how can you reliably > > call code - but wait until an object no longer exists or is > > "unreachable"? > > For normal program termina

Re: use of index (beginner's question)

2011-04-27 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > Rusty Scalf wrote: >> list1 = ['pig', 'horse', 'moose'] >> list2 = ['62327', '49123', '79115'] >> n = 2 >> s2 = "list" + `n` I would prefer the clearer s2 = "list" + str(n) or s2 = "list%s" % n >> a = s2[list1.index('horse')] >> print a > > s2 is a string with th

Re: use of index (beginner's question)

2011-04-27 Thread Chris Rebert
On Wed, Apr 27, 2011 at 6:23 PM, Thomas 'PointedEars' Lahn wrote: > Chris Angelico wrote: >> Rusty Scalf wrote: >>> list1 = ['pig', 'horse', 'moose'] >>> list2 =  ['62327', '49123', '79115'] >>> n = 2 >>> s2 = "list" + `n` > > I would prefer the clearer > >  s2 = "list" + str(n) > > or > >  s2 = "

Re: use of index (beginner's question)

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 11:23 AM, Thomas 'PointedEars' Lahn wrote: > You forgot a comma after the first `]', to separate the list elements. Whoops! Apologies. It's very confusing when example code has silly bugs in it! And yes, need to either back down the indices or insert a shim. Memo, to self:

Re: use of index (beginner's question)

2011-04-27 Thread Steven D'Aprano
On Wed, 27 Apr 2011 17:42:30 -0700, Rusty Scalf wrote: > Greetings, > I am just now learning python and am trying to use the index function > with variables. > > list1 = ['pig', 'horse', 'moose'] > list2 = ['62327', '49123', '79115'] > a = list2[list1.index('horse')] > print a > >49123 > >

Access violation reading 0x00000010

2011-04-27 Thread yuan zheng
Hi, everyone. I have a question when I invoke an api which is included a library open by CDLL. And then it will prompt the follow error: libcommon.SIM_init() WindowsError: exception: access violatio

Re: Access violation reading 0x00000010

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 1:00 PM, yuan zheng wrote: > Hi, >     everyone. I have a question when I invoke an api which is included a > library > open by CDLL. And then it will prompt the follow error: How are you invoking it? Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: use of index (beginner's question)

2011-04-27 Thread Algis Kabaila
On Thursday 28 April 2011 11:23:51 Thomas 'PointedEars' Lahn wrote: > Chris Angelico wrote: > > Rusty Scalf wrote: > >> list1 = ['pig', 'horse', 'moose'] > >> list2 = ['62327', '49123', '79115'] > >> n = 2 > >> s2 = "list" + `n` >>> "list" + 'n' 'listn' >>> And IMHO you did not want that, did yo

Re: Deditor

2011-04-27 Thread Alec Taylor
By all means I use Linux... when it's available, but I'm often on non-Linux machines (at Uni), so it'd be great if something like Deditor was available. On Thu, Apr 28, 2011 at 7:07 AM, Yico Gaga wrote: > yeah ,I know ,Ubuntu is based on Debian , i said why not linux , > because someone ask for w

Re: Deditor

2011-04-27 Thread jmfauth
On 27 avr, 19:22, Alec Taylor wrote: > Thanks, any plans for a Windows version? > - Download the deb - Unpack it with a utility like 7zip - Throw away the unnecessary stuff, (keep the "deditor part") - Depending on your libs, adatpt the "import" - Launch deditor.py - Then ... [5 minutes] In fac

Re: ElementTree XML parsing problem

2011-04-27 Thread Stefan Behnel
Hegedüs Ervin, 27.04.2011 21:33: hello, I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: The complaint offered up by the parser is I've checked this xml with your script, I thi

Re: Access violation reading 0x00000010

2011-04-27 Thread yuan zheng
libcommon = CDLL("c:\libcommon-0.dll", RTLD_GLOBAL) libcommon.SIM_init() -> This is the invoking. thanks, yuanzheng. 2011/4/28 Chris Angelico > On Thu, Apr 28, 2011 at 1:00 PM, yuan zheng > wrote: > > Hi, > > everyone. I have a question when I invoke an api which is included a > >

Re: Access violation reading 0x00000010

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 4:01 PM, yuan zheng wrote: > > libcommon = CDLL("c:\libcommon-0.dll", RTLD_GLOBAL) > > libcommon.SIM_init() -> This is the invoking. When you have a backslash in a literal string, you need to double it: libcommon = CDLL("c:\\libcommon-0.dll", RTLD_GLOBAL) I don't know

Re: ElementTree XML parsing problem

2011-04-27 Thread Ervin Hegedüs
hello, On Thu, Apr 28, 2011 at 07:57:28AM +0200, Stefan Behnel wrote: > >So, I started change the codepage mark of xml: > > > > - same result > > - same result > > - same result > > You probably changed this in an editor that supports XML and thus > saves the file in the declared encoding. no

Re: Have you read the Python docs lately?

2011-04-27 Thread Paul Rubin
Raymond Hettinger writes: > A number of developers have been working on adding examples and useful > advice to the docs. To sharpen your skills, here are some pieces of > recommended reading: Thanks, those are nice. The logging one looks especially useful. The module always looked very confusi

Re: Access violation reading 0x00000010

2011-04-27 Thread yuan zheng
Sorry , the path is just an example. This is not the question I think. Because there is lots of api in libcommon-0.dll, and there is no fault when invoking other api, such as libcommon.SIM_start().. It's just fault when invoking this api -> SIM_init(). So I wanna which situation would lead to this