On 04Jan2014 16:54, Sean Murphy wrote:
> Thanks everyone.
>
> Mark thanks for the correction on the ':'. Since I didn't cut and copy,
> rather typed it out. Errors crept in. :-)
>
> another question in relation to slicing strings. If you want to get a single
> character, just using the index p
On Sat, Jan 4, 2014 at 5:32 PM, Sean Murphy wrote:
> So I suspect the offset number still starts at the beginning of the string
> and counts forward or another way to look at it you are slicing from element
> x to element y. If element y is less then element x, return nothing. Does
> this make
Hi everyone.
Worked out what I was doing wrong with the string splicing. The offset number
was lower then the index number, so it was failing. E.G:
On 04/01/2014, at 4:54 PM, Sean Murphy wrote:
> Thanks everyone.
>
> Mark thanks for the correction on the ':'. Since I didn't cut and copy,
Thanks everyone.
Mark thanks for the correction on the ':'. Since I didn't cut and copy, rather
typed it out. Errors crept in. :-)
another question in relation to slicing strings. If you want to get a single
character, just using the index position will get it. If I use the following,
shouldn'
On 02/01/2014 17:36, Robin Becker wrote:
On 31/12/2013 15:41, Roy Smith wrote:
I'm using 2.7 in production. I realize that at some point we'll need to
upgrade to 3.x. We'll keep putting that off as long as the "effort +
dependencies + risk" metric exceeds the "perceived added value" metric.
"Larry Martell" wrote in message
news:CACwCsY5P47-dB1NLQTUTQ=0aF6B+-M3y4hCxcUGmcVmHM8=-x...@mail.gmail.com...
>I think I know the answer is no, but is there any package that allows
> creating a list with holes in it? E.g. I'd want to do something like:
>
> x[10] = 12
> x[20] = 30
>
> I'm thinkin
On Thu, 02 Jan 2014 16:40:19 +1100, Alec Taylor wrote:
> I use the Python logger class; with the example syntax of:
> Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
>
> Can of course easily use e.g.: a JSON syntax here instead.
>
> Are there any open-source log viewers (e.
On Fri, Jan 3, 2014 at 9:44 PM, Beinan Li wrote:
> But some console programs have their own shell or ncurse-like CUI, such as
> cscope.
> So I figured that I need to first subprocess.popen a bidirectional pipe and
> send command through stdin and get results from stdout and stderr.
>
> But in such
On 04/01/2014 04:03, Sean Murphy wrote:
Hello all.
This is a newly question. But I wish to understand why the below code is
providing different results.
import os, sys
if len(sys.argv) > 2:
filenames = sys.argv[1:]
else
print ("no parameters provided\n")
sys.edit()
for filename in
On Sat, Jan 4, 2014 at 3:26 PM, Alec Taylor wrote:
> What is the highest performance REST microframework?
>
> Happy if it's mostly written in C or C++; as long as it provides a
> simple routes interface in Python.
>
> Currently using bottle and utilising its application, @route and
> app.merge(app
On Sat, Jan 4, 2014 at 3:03 PM, Sean Murphy wrote:
> filenames = sys.argv[1:]
>
> for filename in filenames:
> print ("filename is: %s\n" %filename)
versus
> filenames = sys.argv[1]
>
> for filename in filenames:
> print ("filename is: %s\n" % filename)
The first one is slicing sys.arg
On Fri, Jan 3, 2014 at 11:03 PM, Sean Murphy wrote:
> Hello all.
>
> This is a newly question. But I wish to understand why the below code is
> providing different results.
>
> import os, sys
>
>
> if len(sys.argv) > 2:
> filenames = sys.argv[1:]
> else
> print ("no parameters provided\n")
>
Hello all.
This is a newly question. But I wish to understand why the below code is
providing different results.
import os, sys
if len(sys.argv) > 2:
filenames = sys.argv[1:]
else
print ("no parameters provided\n")
sys.edit()
for filename in filenames:
print ("filename is: %s\n" %file
What is the highest performance REST microframework?
Happy if it's mostly written in C or C++; as long as it provides a
simple routes interface in Python.
Currently using bottle and utilising its application, @route and
app.merge(app2) extra features.
--
https://mail.python.org/mailman/listinfo/
Web interface (and/or SQL-like query interface); is useful for
drilling down and rolling up multiparametric analyses.
Currently looking at logstash, kibana, graylog2 and a few others.
Might end up writing my own to escape the Java dependency.
Would welcome further suggestions.
On Fri, Jan 3, 201
On 03/01/2014 22:00, Terry Reedy wrote:
On 1/3/2014 7:28 AM, Robin Becker wrote:
On 03/01/2014 09:01, Terry Reedy wrote:
There was more speedup in 3.3.2 and possibly even more in 3.3.3, so OP
should run the latter.
python 3.3.3 is what I use on windows. As for astral / non-bmp etc etc
that's
On Sat, Jan 4, 2014 at 2:32 PM, Dan Stromberg wrote:
> That is fine, sorting once at then end of a script is a good use of
> sorted(some_dict.keys()). However, it probably should be pointed out
> that this, while similar, is not so good:
>
> for thing in range(n):
>for key in sorted(some_dict
On Fri, Jan 3, 2014 at 7:00 PM, Chris Angelico wrote:
> On Sat, Jan 4, 2014 at 1:58 PM, Dan Stromberg wrote:
>> On Fri, Jan 3, 2014 at 7:37 AM, Chris Angelico wrote:
>>> Depending on what exactly you need, it's probably worth just using a
>>> dict. In what ways do you need it to function as a li
On Sat, Jan 4, 2014 at 1:58 PM, Dan Stromberg wrote:
> On Fri, Jan 3, 2014 at 7:37 AM, Chris Angelico wrote:
>> Depending on what exactly you need, it's probably worth just using a
>> dict. In what ways do you need it to function as a list? You can
>> always iterate over sorted(some_dict.keys())
On Fri, Jan 3, 2014 at 7:37 AM, Chris Angelico wrote:
> Depending on what exactly you need, it's probably worth just using a
> dict. In what ways do you need it to function as a list? You can
> always iterate over sorted(some_dict.keys()) if you need to run
> through them in order.
FWIW, sorting
On Sat, Jan 4, 2014 at 1:44 PM, Beinan Li wrote:
> But some console programs have their own shell or ncurse-like CUI, such as
> cscope.
> So I figured that I need to first subprocess.popen a bidirectional pipe and
> send command through stdin and get results from stdout and stderr.
>
> But in such
I know how to make a GUI program work on top of a console program like
"ls", which exits immediately.
But some console programs have their own shell or ncurse-like CUI, such as
cscope.
So I figured that I need to first subprocess.popen a bidirectional pipe and
send command through stdin and get re
On Fri, 03 Jan 2014 20:18:06 -0500, Roy Smith wrote:
> In article ,
> Larry Martell wrote:
>
>
>> Thanks, but I know all that about dicts. I need to use a list for
>> compatibility with existing code.
>
> Generalizing what I think the situation is, "A dict is the best data
> structure for the
On Sat, Jan 4, 2014 at 11:13 AM, Wiktor wrote:
> Hi,
> it's my first post on this newsgroup so welcome everyone. :)
Hi! Welcome!
> I'm still learning Python (v3.3), and today I had idea to design (my first)
> recursive function, that generates board to 'Towers' Puzzle:
> http://www.chiark.greene
On 1/3/2014 7:16 PM, Wiktor wrote:
Hi,
it's my first post on this newsgroup so welcome everyone. :)
I'm still learning Python (v3.3), and today I had idea to design (my first)
recursive function, that generates (filled out) board to 'Towers' Puzzle:
http://www.chiark.greenend.org.uk/~sgtatham/p
On Sat, Jan 4, 2014 at 11:18 AM, Larry Martell wrote:
> Your last suggestion is what I ended up doing, but I had to key off
> the unit - I couldn't use because that
> isn't present for ones that have no - that messed me up for
> hours. But it's working now. Thanks all!
Sure, you know your dat
In article ,
Larry Martell wrote:
>
> Thanks, but I know all that about dicts. I need to use a list for
> compatibility with existing code.
Generalizing what I think the situation is, "A dict is the best data
structure for the parsing phase, but I need a list later to hand off to
legacy inte
Hi,
it's my first post on this newsgroup so welcome everyone. :)
I'm still learning Python (v3.3), and today I had idea to design (my first)
recursive function, that generates (filled out) board to 'Towers' Puzzle:
http://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/towers.html
(so I could in
On Fri, Jan 3, 2014 at 11:07 AM, Chris Angelico wrote:
> On Sat, Jan 4, 2014 at 2:55 AM, Larry Martell wrote:
>> The use case is that I'm parsing a XML file like this:
>>
>>
>>
>>
>> True
>>
>>
>>
>>
On Fri, Jan 3, 2014 at 1:07 PM, Denis McMahon wrote:
> On Fri, 03 Jan 2014 10:41:21 -0500, Larry Martell wrote:
>
>> The holes would be between the items I put in. In my example above, if I
>> assigned to [10] and [20], then the other items ([0..9] and [11..19])
>> would have None.
>
dic = {
Hi,
it's my first post on this newsgroup so welcome everyone. :)
I'm still learning Python (v3.3), and today I had idea to design (my first)
recursive function, that generates board to 'Towers' Puzzle:
http://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/towers.html
(so I could in future write a
On 1/3/2014 7:28 AM, Robin Becker wrote:
On 03/01/2014 09:01, Terry Reedy wrote:
There was more speedup in 3.3.2 and possibly even more in 3.3.3, so OP
should run the latter.
python 3.3.3 is what I use on windows. As for astral / non-bmp etc etc
that's almost irrelevant for the sort of tests w
On 01/03/2014 12:55 PM, Steven D'Aprano wrote:
André Malo wrote:
* Steven D'Aprano wrote:
Mark Lawrence wrote:
raise "Not Valid DB Type"
is perfectly valid in Python 2.
Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5,
string exceptions display a warning but continu
PETER,
thanks Peter, I have already found the PDB module and have had a play with it.
It will do for now.
On 03/01/2014, at 8:08 PM, Paul Rudin wrote:
> Sean Murphy writes:
>
>
>> I am a Vision Impaired programmer on the Mac and Window platforms. I have
>> started to learn Python. The bigges
André Malo wrote:
> * Steven D'Aprano wrote:
>
>> Mark Lawrence wrote:
>>
>>> raise "Not Valid DB Type"
>>>
>>> is perfectly valid in Python 2.
>>
>> Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5,
>> string exceptions display a warning but continue to work, and in Pyth
The results of the survey are at:
https://wiki.python.org/moin/2.x-vs-3.x-survey
--
https://mail.python.org/mailman/listinfo/python-list
Chris Seberino wrote:
> The basics of Scheme or Lisp are amazingly easy to implement. Would
> implementing a subset of Python in a Scheme subset be a clever way to
> easily implement a lot of Python?
I don't know how easy it was, but it was done:
http://common-lisp.net/project/clpython/
--
* Steven D'Aprano wrote:
> Mark Lawrence wrote:
>
>> raise "Not Valid DB Type"
>>
>> is perfectly valid in Python 2.
>
> Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5,
> string exceptions display a warning but continue to work, and in Python
> 2.6 they generate a compil
The Economic System of Islam
1-An introduction to the principles Islam has legislated to guide the economic
system of society. Part 1: The sources from which the laws that guide
economical activity are derived.
2-The Ideological Basis of Economic Activity and the general principles by
which the
On Fri, Jan 3, 2014 at 9:26 AM, Chris Seberino wrote:
> On Friday, January 3, 2014 11:10:07 AM UTC-6, Devin Jeanpierre wrote:
>> A lecturer of mine back in university did this (implemented a subset
>> of Python in Racket). My understanding is that this is primarily
>> interesting to show that Rack
On Fri, 03 Jan 2014 10:41:21 -0500, Larry Martell wrote:
> The holes would be between the items I put in. In my example above, if I
> assigned to [10] and [20], then the other items ([0..9] and [11..19])
> would have None.
>>> dic = { 10:6, 20:11}
>>> dic.get(10)
6
>>> dic.get(14)
>>> dic.get(27,
On Fri, Jan 3, 2014 at 10:20 PM, Chris Seberino wrote:
>
> Exceptions, modules, OOP, etc. would be tricky to implement in Scheme but at
> least the basics like for loops, while loops, assignment etc. would seem
> doable and very instructive for students.they would thereafter, for all
> time
On 01/02/2014 08:55 AM, Grant Edwards wrote:
On 2013-12-31, Steven D'Aprano wrote:
You laugh, but there was at least one attendee at the last PyCon who was
still using 1.5 professionally. Software never quite dies so long as there
is hardware capable of running it.
ITYM: ... so long as ther
In article ,
Devin Jeanpierre wrote:
> // C++
> Foo x = y;
> x.bar = 3;
>
> // Java
> Foo x = y;
> x.bar = 3;
>
> // Scheme
> (define x y)
> (foo-bar x 3)
>
> The syntax of the first two is identical, so the uneducated would
> assume they do the same thing.
This is one of the things that tr
On Friday, January 3, 2014 11:10:07 AM UTC-6, Devin Jeanpierre wrote:
> A lecturer of mine back in university did this (implemented a subset
>
> of Python in Racket). My understanding is that this is primarily
>
> interesting to show that Racket is not as crazily different as it
>
> looks from
On 01/03/2014 02:24 AM, Chris Angelico wrote:
I worked that out with a sheet of paper and a pencil. The pencil was a
little help, but the paper was three sheets in the wind.
Beautiful!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Jan 2, 2014 at 10:46 PM, Chris Seberino wrote:
> I've heard it said, by no less a guru than Peter Norvig, that Python is a lot
> like Lisp without the parentheses at least for the basics of Python.
There are plenty of non-superficial differences. Python has lexical
scope, lisps usual
Exceptions, modules, OOP, etc. would be tricky to implement in Scheme but at
least the basics like for loops, while loops, assignment etc. would seem doable
and very instructive for students.they would thereafter, for all time, have
a mental image of what the Python interpreter is doing.
On Sat, Jan 4, 2014 at 2:55 AM, Larry Martell wrote:
> The use case is that I'm parsing a XML file like this:
>
>
>
>
> True
>
>
>
>
> False
>
>
In article ,
Chris Angelico wrote:
> Alternatively, if you expect to fill in most of the elements, it's
> possible you'd be happier working with a subclass of list that
> auto-expands by filling in the spare space with a singleton meaning
> "no element here".
And, if you know ahead of time the
On Sat, Jan 4, 2014 at 2:51 AM, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> Alternatively, if you expect to fill in most of the elements, it's
>> possible you'd be happier working with a subclass of list that
>> auto-expands by filling in the spare space with a singleton meaning
Chris Angelico wrote:
> Maybe a for loop isn't the best other example, but I
> frequently work with places where I want to call some function and
> keep iterating with the result of that until it returns false:
>
> while (var = func())
> {
>
> }
>
> In Python, that gets a lot clunkier.
On Fri, Jan 3, 2014 at 10:37 AM, Chris Angelico wrote:
> On Sat, Jan 4, 2014 at 2:19 AM, Larry Martell wrote:
>> I think I know the answer is no, but is there any package that allows
>> creating a list with holes in it? E.g. I'd want to do something like:
>>
>> x[10] = 12
>> x[20] = 30
>>
>> I'm
On Sat, Jan 4, 2014 at 1:57 AM, Roy Smith wrote:
> I was doing a project a while ago importing 20-something million records
> into a MySQL database. Little did I know that FOUR of those records
> contained astral characters (which MySQL, at least the version I was
> using, couldn't handle).
>
> M
On Sat, Jan 4, 2014 at 2:38 AM, Roy Smith wrote:
> Why do you want holes? Is the issue that you're storing sparse data and
> don't want to waste memory on unused keys? If so, a dictionary should
> do you fine.
>
> Do you need to be able to read the values back out in a specific order?
> You can
On 2014-01-03, Dave Angel wrote:
> On Thu, 2 Jan 2014 16:23:22 + (UTC), Grant Edwards
> wrote:
>> AFAIK, that's irrelevent. time.time() returns a float. On all the
>> CPython implementations I know of, that is a 64-bit IEEE format,
>> which provides 16 decimal digits of precision regardles
On Fri, Jan 3, 2014 at 10:30 AM, wrote:
> On Friday, January 3, 2014 4:19:09 PM UTC+1, larry@gmail.com wrote:
>> I think I know the answer is no, but is there any package that allows
>>
>> creating a list with holes in it? E.g. I'd want to do something like:
>>
>> x[10] = 12
>> x[20] = 30
>>
On Sat, Jan 4, 2014 at 2:33 AM, Grant Edwards wrote:
> time.time() returns a Python float. A Python float will have 16 digits
> of precision. Perhaps the OS always sets some of those digits to 0 (or
> even random values), but they're still there. Perhaps the accuracy or
> granularity of the value
In article ,
Larry Martell wrote:
> I think I know the answer is no, but is there any package that allows
> creating a list with holes in it? E.g. I'd want to do something like:
>
> x[10] = 12
> x[20] = 30
Whenever you ask, "What data structure do I want", you need to be able
to answer, "What
On Sat, Jan 4, 2014 at 2:19 AM, Larry Martell wrote:
> I think I know the answer is no, but is there any package that allows
> creating a list with holes in it? E.g. I'd want to do something like:
>
> x[10] = 12
> x[20] = 30
>
> I'm thinking of something like defaultdict but for lists (I know
> th
On Friday, January 3, 2014 4:19:09 PM UTC+1, larry@gmail.com wrote:
> I think I know the answer is no, but is there any package that allows
>
> creating a list with holes in it? E.g. I'd want to do something like:
>
>
>
> x[10] = 12
>
> x[20] = 30
>
>
>
> I'm thinking of something like
I think I know the answer is no, but is there any package that allows
creating a list with holes in it? E.g. I'd want to do something like:
x[10] = 12
x[20] = 30
I'm thinking of something like defaultdict but for lists (I know
that's very different, but ... )
Thanks!
-larry
--
https://mail.pyth
In article ,
Robin Becker wrote:
> On 03/01/2014 09:01, Terry Reedy wrote:
> > There was more speedup in 3.3.2 and possibly even more in 3.3.3, so OP
> > should run the latter.
>
> python 3.3.3 is what I use on windows. As for astral / non-bmp etc etc that's
> almost irrelevant for the sort of
On 2014-01-03 04:17, Sean Murphy wrote:
Team,
I am a Vision Impaired programmer on the Mac and Window platforms. I have
started to learn Python. The biggest road block I have is the ability of
debugging my simple scripts. The IDLE program does not work with the screen
readers I use on the Ma
On 03/01/2014 09:01, Terry Reedy wrote:
There was more speedup in 3.3.2 and possibly even more in 3.3.3, so OP
should run the latter.
python 3.3.3 is what I use on windows. As for astral / non-bmp etc etc that's
almost irrelevant for the sort of tests we're doing which are mostly simple
engli
I have a Jenkins server running Ubuntu which has been running perfectly fine
for as long as I've been using it, and in one of the jobs, it runs a few things
under the shiningpanda plugin (a python virtual environment wrapper).
At some point today, or over the weekend, the job that uses it starte
Hi,
Autobahn provides open-source implementations of
* The WebSocket Protocol
* The Web Application Messaging Protocol (WAMP)
https://github.com/tavendo/AutobahnPython
https://pypi.python.org/pypi/autobahn
Starting with the release 0.7.0, Autobahn now fully supports (with all
features) both
*
On 02/01/2014 23:57, Antoine Pitrou wrote:
..
Running a test suite is a completely broken benchmarking methodology.
You should isolate workloads you are interested in and write a benchmark
simulating them.
I'm certain you're right, but individual bits of code like generating our
r
On 02/01/2014 18:37, Terry Reedy wrote:
On 1/2/2014 12:36 PM, Robin Becker wrote:
I just spent a large amount of effort porting reportlab to a version
which works with both python2.7 and python3.3. I have a large number of
functions etc which handle the conversions that differ between the two
p
2014/1/3 :
> @Rick
> I found some solutions for python 2.x, but still, as I am with the future, I
> need a futuristic solution or 2, so if anyone else could help me, I'd be
> grateful!
> --
Hi,
I usually don't use tkinter myself, hence others may have more
idiomatic suggestions,
but you can of
On 02/01/2014 18:25, David Hutto wrote:
Just because it's 3.3 doesn't matter...the main interest is in
compatibility. Secondly, you used just one piece of code, which could be a
fluke, try others, and check the PEP. You need to realize that evebn the
older versions are benig worked on, and they h
On Fri, Jan 3, 2014 at 9:10 PM, wrote:
> It's time to understand the Character Encoding Models
> and the math behind it.
> Unicode does not differ from any other coding scheme.
>
> How? With a sheet of paper and a pencil.
>
One plus one is two, therefore Python is better than Haskell.
Four time
It's time to understand the Character Encoding Models
and the math behind it.
Unicode does not differ from any other coding scheme.
How? With a sheet of paper and a pencil.
jmf
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Jan 3, 2014 at 12:16 PM, Chris Seberino wrote:
> I've heard it said, by no less a guru than Peter Norvig, that Python is a lot
> like Lisp without the parentheses at least for the basics of Python.
>
> For pedagogical reasons, I'm wondering if it would be easy to implement a big
> su
I've heard it said, by no less a guru than Peter Norvig, that Python is a lot
like Lisp without the parentheses at least for the basics of Python.
For pedagogical reasons, I'm wondering if it would be easy to implement a big
subset of Python in Scheme.
The basics of Scheme or Lisp are ama
Sean Murphy writes:
> I am a Vision Impaired programmer on the Mac and Window platforms. I have
> started to learn Python. The biggest road block I have is the ability of
> debugging my simple scripts. The IDLE program does not work with the screen
> readers I use on the Mac or Windows. A screen
On 1/2/2014 11:49 PM, Steven D'Aprano wrote:
Robin Becker wrote:
For fairly sensible reasons we changed the internal default to use unicode
rather than bytes. After doing all that and making the tests compatible
etc etc I have a version which runs in both and passes all its tests.
However, for
Team,
I am a Vision Impaired programmer on the Mac and Window platforms. I have
started to learn Python. The biggest road block I have is the ability of
debugging my simple scripts. The IDLE program does not work with the screen
readers I use on the Mac or Windows. A screen reader is a program
On 1/2/2014 8:20 PM, Mark Lawrence wrote:
On 03/01/2014 00:57, Gary Herron wrote:
On 01/02/2014 01:44 PM, John Allsup wrote:
The point of my original post was that, whilst C's
if( x = 2 ) { do something }
and
if( x == 2 ) { do something }
are easy to confuse, and a source of bugs, having a
@Terry
Quite sorry but had to write that message in a hurry, didn't notice the name.
@Rick
I found some solutions for python 2.x, but still, as I am with the future, I
need a futuristic solution or 2, so if anyone else could help me, I'd be
grateful!
--
https://mail.python.org/mailman/listinfo/
80 matches
Mail list logo