Right tool for the job (was: Exact integer-valued floats)

2012-09-23 Thread Ben Finney
Tim Roberts t...@probo.com writes: Apologize in advance for top-posting. My Xoom makes bottom-posting awkward. Surely the better solution, then, is to use a tool which does allow you to compose a message properly – and abstain from posting until you get to such a tool. -- \

Re: One of my joomla webpages has been hacked. Please help.

2012-09-23 Thread Νίκος Γκρεεκ
Τη Κυριακή, 23 Σεπτεμβρίου 2012 8:38:38 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: On Sun, Sep 23, 2012 at 3:18 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Sun, Sep 23, 2012 at 12:56 AM, Chris Angelico ros...@gmail.com wrote: Steven's point is not that we, human beings (or

Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-23 Thread Ned Deily
In article 505d9cc5$0$6846$e4fe5...@news2.news.xs4all.nl, Hans Mulder han...@xs4all.nl wrote: On 22/09/12 09:30:57, Franck Ditter wrote: In article 505ccdc5$0$6919$e4fe5...@news2.news.xs4all.nl, Hans Mulder han...@xs4all.nl wrote: On 21/09/12 16:29:55, Franck Ditter wrote: I create a

Re: Redirecting STDOUT to a Python Variable

2012-09-23 Thread Hans Mulder
On 22/09/12 23:57:52, ross.mars...@gmail.com wrote: To capture the traceback, so to put it in a log, I use this import traceback def get_traceback(): # obtain and return the traceback exc_type, exc_value, exc_traceback = sys.exc_info() return

Re: Exact integer-valued floats

2012-09-23 Thread Hans Mulder
On 23/09/12 01:06:08, Dave Angel wrote: On 09/22/2012 05:05 PM, Tim Roberts wrote: Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On 22 Sep 2012 01:36:59 GMT, Steven D'Aprano wrote: For non IEEE 754 floating point systems, there is no telling how bad the implementation could be :( Let's

msmtp in python

2012-09-23 Thread 7segment
Hi. I have written a program to send email using python. However, I want to use msmtp for delegating the sending to my gmail account. So this part should be changed but I have no idea how! In theory the sendmail function should automatically call msmtp, but i don't know how to define s then.

[ANN] PyPyODBC 0.8.6 released!

2012-09-23 Thread 江文
PyPyODBC - A Pure Python ctypes ODBC module Features -Pure Python, compatible with IronPython and PyPy (tested on Win32) -Almost totally same usage as pyodbc -Simple and small - the whole module is implemented in a less than 2000 lines python script You can simply try

wheezy.web presentation - build modern, efficient web

2012-09-23 Thread Andriy Kornatskyy
Here are links to presentation held in Kyiv.Py (Ukraine) on September 22, 2012: wheezy.web introduction a lightweight, high performance, high concurrency WSGI web framework with the key features to build modern, efficient web Download from: https://bitbucket.org/akorn/wheezy.web/downloads/

A dateutil error has appeared, due to updates? How to fix?

2012-09-23 Thread tinnews
I have a python script which uses the dateutil module with the following:- import sys import datetime import icalendar from dateutil.relativedelta import relativedelta The section of code which uses relativedelta is as follows:- # # # If the event is a

Re: Blue Screen Python

2012-09-23 Thread 88888 Dihedral
Chris Angelico於 2012年9月22日星期六UTC+8下午10時10分12秒寫道: On Sat, Sep 22, 2012 at 11:07 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: As per their partnership agreement, IBM took over development of OS/2 version 2 while Microsoft worked on developing version 3. OS/2 2.0 was

Re: A dateutil error has appeared, due to updates? How to fix?

2012-09-23 Thread Peter Otten
tinn...@isbd.co.uk wrote: I have a python script which uses the dateutil module with the following:- import sys import datetime import icalendar from dateutil.relativedelta import relativedelta The section of code which uses relativedelta is as follows:- #

cant install livewires

2012-09-23 Thread james . kennedy
i cant install livewires and their help about making a directory is useless to me as i dont know how btw im using windows 7 REALLY DESPERATE :) -- Disclaimerhttp://study.abingdon.org.uk/moodle/mod/resource/view.php?id=8393 -- http://mail.python.org/mailman/listinfo/python-list

Re: cant install livewires

2012-09-23 Thread Chris Angelico
On Sun, Sep 23, 2012 at 10:05 PM, james.kenn...@abingdon.org.uk wrote: i cant install livewires and their help about making a directory is useless to me as i dont know how btw im using windows 7 REALLY DESPERATE :) May I recommend searching the web for 'make directory windows 7'? That might

Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-23 Thread Kevin Walzer
On 9/23/12 3:33 AM, Ned Deily wrote: This appears to a difference in behavior between Carbon Tk 8.4 and Cocoa Tk 8.5 on OS X. The python.org 32-bit-only installers are built to link with the former and, with 8.4, the Open file dialog box does have the file-type filter menu as Hans describes.

Re: cant install livewires

2012-09-23 Thread Mark Lawrence
On 23/09/2012 13:05, james.kenn...@abingdon.org.uk wrote: i cant install livewires and their help about making a directory is useless to me as i dont know how btw im using windows 7 REALLY DESPERATE :) Please don't shout. And if my experience of the UK education system is anything to go

Re: Fastest web framework

2012-09-23 Thread Roy Smith
In article mailman.1110.1348392023.27098.python-l...@python.org, Andriy Kornatskyy andriy.kornats...@live.com wrote: I have run recently a benchmark of a trivial 'hello world' application for various python web frameworks (bottle, django, flask, pyramid, web.py, wheezy.web) hosted in

Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-23 Thread Kevin Walzer
On 9/23/12 8:45 AM, Kevin Walzer wrote: There's nothing to do here; it's an aspect of the native dialog. To clarify: there's nothing to do at the C level, which is where the native dialog is invoked. IDLE can probably be patched to accept other file types, such as dat. -- Kevin Walzer Code

Re: A dateutil error has appeared, due to updates? How to fix?

2012-09-23 Thread tinnews
Peter Otten __pete...@web.de wrote: tinn...@isbd.co.uk wrote: [snip description of problem] Have I lost a module somewhere in the updates or has something in python changed such that my code no longer works as it used to? Can anyone help diagnose this please. You probably have a

Re: Seome kind of unblocking input

2012-09-23 Thread Ramchandra Apte
On Saturday, 22 September 2012 01:24:46 UTC+5:30, Dennis Lee Bieber wrote: On Fri, 21 Sep 2012 02:13:28 -0700 (PDT), janis.judvai...@gmail.com declaimed the following in gmane.comp.python.general: Since I'm using threads and pipes everything works ok, except that when i call

Re: Fastest web framework

2012-09-23 Thread Stefan Behnel
Roy Smith, 23.09.2012 16:02: Andriy Kornatskyy wrote: I have run recently a benchmark of a trivial 'hello world' application for various python web frameworks (bottle,�django, flask, pyramid, web.py, wheezy.web) hosted in uWSGI/cpython2.7 and gunicorn/pypy1.9... you might find it

Re: Client Needs---QA Manual Tester at Sacramento, CA

2012-09-23 Thread Ramchandra Apte
On Saturday, 22 September 2012 04:09:55 UTC+5:30, ram dev wrote: Good Day, We have an urgent Contract Openings in Folsom, CA Looking forward to submit your resume for below mentioned Requirement… If you are interested, Please forward your latest resume along with location and pay

QThread.terminate in Python 3

2012-09-23 Thread Lee Harr
Hi; I have asked this on the PyQt list, but have not seen any response yet. Hoping someone will be able to test this on their system to see if they see the same problem. The problem I am seeing is that terminating a QThread running certain code will freeze the program, requiring it to be

Re: Capitalization for variable that holds a class

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 1:48 AM, Joshua Landau joshua.landau...@gmail.com wrote: Simple question: [myClass() for myClass in myClasses] vs [MyClass() for MyClass in myClasses] Fight. (When considering, substitute in a more real-world example like [Token() for Token in allTokens] or

For Counter Variable

2012-09-23 Thread jimbo1qaz
Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. -- http://mail.python.org/mailman/listinfo/python-list

Re: For Counter Variable

2012-09-23 Thread Rodrick Brown
On Sep 23, 2012, at 12:42 PM, jimbo1qaz jimmyli1...@gmail.com wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. for idx in list of elm: print (idx) i.e.. for idx

For Counter Variable

2012-09-23 Thread Oscar Benjamin
On Sep 23, 2012 5:42 PM, jimbo1qaz jimmyli1...@gmail.com wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. Have you seen the enumerate function? Oscar --

Re: For Counter Variable

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 2:36 AM, jimbo1qaz jimmyli1...@gmail.com wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. You mean, if you want the indices as well as the

Re: Client Needs---QA Manual Tester at Sacramento, CA

2012-09-23 Thread Mark Lawrence
On 23/09/2012 16:47, Ramchandra Apte wrote: I've snipped all the crap that came from gmail. Could you please get yourself a decent email client. This is not related to Python; I have reported this in Google Groups. Thanks for policing this, but how about reporting it on gmane and

Re: Seome kind of unblocking input

2012-09-23 Thread Mark Lawrence
On 23/09/2012 16:49, Ramchandra Apte wrote: On Saturday, 22 September 2012 01:24:46 UTC+5:30, Dennis Lee Bieber wrote: On Fri, 21 Sep 2012 02:13:28 -0700 (PDT), janis.judvai...@gmail.com declaimed the following in gmane.comp.python.general: Since I'm using threads and pipes everything

Re: Fastest web framework

2012-09-23 Thread Mark Lawrence
On 23/09/2012 16:50, Stefan Behnel wrote: Roy Smith, 23.09.2012 16:02: Andriy Kornatskyy wrote: I have run recently a benchmark of a trivial 'hello world' application for various python web frameworks (bottle,�django, flask, pyramid, web.py, wheezy.web) hosted in uWSGI/cpython2.7 and

RE: Fastest web framework

2012-09-23 Thread Andriy Kornatskyy
If we take a look at web application we can split it into at least two parts, one that renders things out and the other one that does data extraction, e.g. from database (this is what you are pointing at). If you made a first call to database you get your list and can easily cache it. The

write to a file two dict()

2012-09-23 Thread giuseppe . amatulli
Hi Have two dict() of the same length and i want print them to a common file. a={1: 1, 2: 2, 3: 3} b={1: 11, 2: 22, 3: 33} in order to obtain 1 1 1 11 2 2 2 22 3 3 3 33 I tried output = open(dst_file, w) for (a), b , (c) , d in a.items() , b.items() : output.write(%i %i %i %i\n %

Re: Fastest web framework

2012-09-23 Thread Stefan Behnel
Andriy Kornatskyy, 23.09.2012 19:42: If we take a look at web application we can split it into at least two parts, one that renders things out and the other one that does data extraction, e.g. from database (this is what you are pointing at). If you made a first call to database you get your

Re: For Counter Variable

2012-09-23 Thread jimbo1qaz
On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation. Ya, they should really give a better way, but for now,

Anyone able to help on installing packages?

2012-09-23 Thread John Mordecai Dildy
Hello everyone out there. Ive been trying to install packages like distribute, nose, and virturalenv and believe me it is a hard process to do. I tried everything I could think of to install. I have done the following: pip install package name easy_install package name Would anyone help me

RE: Fastest web framework

2012-09-23 Thread Andriy Kornatskyy
Few facts that doesn't make it less interesting: (1) the test source code available (2) the test itself is pretty famous (3) you can re-run it (4) or even better supply own that in your believe is 100% relevant Not every project has problem with database performance. Some use caching... and

Re: write to a file two dict()

2012-09-23 Thread MRAB
On 2012-09-23 18:44, giuseppe.amatu...@gmail.com wrote: Hi Have two dict() of the same length and i want print them to a common file. a={1: 1, 2: 2, 3: 3} b={1: 11, 2: 22, 3: 33} in order to obtain 1 1 1 11 2 2 2 22 3 3 3 33 I tried output = open(dst_file, w) for (a), b , (c) , d in

Re: For Counter Variable

2012-09-23 Thread Oscar Benjamin
On Sep 23, 2012 6:52 PM, jimbo1qaz jimmyli1...@gmail.com wrote: On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the

RE: Fastest web framework

2012-09-23 Thread Andriy Kornatskyy
Good to know you are in a good humor today. You will be surprised... far not all share your point of view. ;-) Few links for you to stop laughing that loud: http://packages.python.org/wheezy.http/userguide.html#content-cache

RE: Fastest web framework

2012-09-23 Thread Andriy Kornatskyy
Good to know you are in a good humor today. You will be surprised... far not all share your point of view. ;-) Few links for you to stop laughing that loud: http://packages.python.org/wheezy.http/userguide.html#content-cache

RE: Fastest web framework

2012-09-23 Thread Andriy Kornatskyy
Good to know you are in a good humor today. You will be surprised... far not all share your point of view. ;-) Few links for you to stop laughing that loud: http://packages.python.org/wheezy.http/userguide.html#content-cache

'str' object does not support item assignment

2012-09-23 Thread jimbo1qaz
spots[y][x]=mark fails with a 'str' object does not support item assignment error,even though: a=[[a]] a[0][0]=b and: a=[[a]] a[0][0]=100 both work. Spots is a nested list created as a copy of another list. -- http://mail.python.org/mailman/listinfo/python-list

Re: Capitalization for variable that holds a class

2012-09-23 Thread Tim Chase
On 09/23/12 11:12, Chris Angelico wrote: On Mon, Sep 24, 2012 at 1:48 AM, Joshua Landau joshua.landau...@gmail.com wrote: Simple question: [myClass() for myClass in myClasses] vs [MyClass() for MyClass in myClasses] Since there's no difference between a class and a variable containing a

Re: 'str' object does not support item assignment

2012-09-23 Thread jimbo1qaz
On Sunday, September 23, 2012 11:31:41 AM UTC-7, jimbo1qaz wrote: spots[y][x]=mark fails with a 'str' object does not support item assignment error,even though: a=[[a]] a[0][0]=b and: a=[[a]] a[0][0]=100 both work. Spots is a nested list created as a copy of another

RE: Fastest web framework

2012-09-23 Thread Andriy Kornatskyy
The problem is that easy if you have a complete control over what you are caching. Complete control over cache may look a challenging task however with use of cache dependency you can lower it significantly. Take a look here:

Re: 'str' object does not support item assignment

2012-09-23 Thread Ian Kelly
On Sun, Sep 23, 2012 at 12:31 PM, jimbo1qaz jimmyli1...@gmail.com wrote: spots[y][x]=mark fails with a 'str' object does not support item assignment error,even though: a=[[a]] a[0][0]=b and: a=[[a]] a[0][0]=100 both work. Spots is a nested list created as a copy of another list.

Re: Anyone able to help on installing packages?

2012-09-23 Thread Oscar Benjamin
On Sep 23, 2012 6:56 PM, John Mordecai Dildy jdild...@gmail.com wrote: Hello everyone out there. Ive been trying to install packages like distribute, nose, and virturalenv and believe me it is a hard process to do. I tried everything I could think of to install. I have done the following:

Re: 'str' object does not support item assignment

2012-09-23 Thread MRAB
On 2012-09-23 19:31, jimbo1qaz wrote: spots[y][x]=mark fails with a 'str' object does not support item assignment error,even though: a=[[a]] a[0][0]=b and: a=[[a]] a[0][0]=100 both work. Spots is a nested list created as a copy of another list. The error suggests that spots[y] is

Re: 'str' object does not support item assignment

2012-09-23 Thread jimbo1qaz
On Sunday, September 23, 2012 11:48:11 AM UTC-7, MRAB wrote: On 2012-09-23 19:31, jimbo1qaz wrote: spots[y][x]=mark fails with a 'str' object does not support item assignment error,even though: a=[[a]] a[0][0]=b and: a=[[a]] a[0][0]=100 both work. Spots is a

Re: 'str' object does not support item assignment

2012-09-23 Thread Andrea Crotti
On 09/23/2012 07:31 PM, jimbo1qaz wrote: spots[y][x]=mark fails with a 'str' object does not support item assignment error,even though: a=[[a]] a[0][0]=b and: a=[[a]] a[0][0]=100 both work. Spots is a nested list created as a copy of another list. But a = a a[0] = 'c' fails for the

Re: 'str' object does not support item assignment

2012-09-23 Thread Mark Lawrence
On 23/09/2012 19:31, jimbo1qaz wrote: spots[y][x]=mark fails with a 'str' object does not support item assignment error,even though: a=[[a]] a[0][0]=b and: a=[[a]] a[0][0]=100 both work. Spots is a nested list created as a copy of another list. Looks to me as if there are three

Re: Fastest web framework

2012-09-23 Thread Dwight Hutto
On Sun, Sep 23, 2012 at 5:19 AM, Andriy Kornatskyy andriy.kornats...@live.com wrote: I have run recently a benchmark of a trivial 'hello world' application for various python web frameworks (bottle, django, flask, pyramid, web.py, wheezy.web) hosted in uWSGI/cpython2.7 and gunicorn/pypy1.9

RE: Fastest web framework

2012-09-23 Thread Andriy Kornatskyy
On Sun, Sep 23, 2012 at 5:19 AM, Andriy Kornatskyy andriy.kornats...@live.com wrote: I have run recently a benchmark of a trivial 'hello world' application for various python web frameworks (bottle, django, flask, pyramid, web.py, wheezy.web) hosted in uWSGI/cpython2.7 and

Re: Fastest web framework

2012-09-23 Thread Dwight Hutto
Hope I understood you correctly. Well, lets break down timing something in a more scientific method approach through questioning. What's your processor speed? What is the constant temperature of the internals of your system? What OS, and version? What other processes are running? There's

Re: write to a file two dict()

2012-09-23 Thread 88888 Dihedral
giuseppe...@gmail.com於 2012年9月24日星期一UTC+8上午1時44分30秒寫道: Hi Have two dict() of the same length and i want print them to a common file. a={1: 1, 2: 2, 3: 3} b={1: 11, 2: 22, 3: 33} in order to obtain 1 1 1 11 2 2 2 22 3 3 3 33 I tried output =

Re: Anyone able to help on installing packages?

2012-09-23 Thread Oscar Benjamin
Please send your reply to the mailing list (python-list@python.org) rather than privately to me. On 23 September 2012 20:57, John Dildy jdild...@gmail.com wrote: When I give input at the start of terminal using the command pip install virtualenv: Downloading/unpacking virtualenv Running

Re: Anyone able to help on installing packages?

2012-09-23 Thread John Mordecai Dildy
On Sunday, September 23, 2012 1:48:52 PM UTC-4, John Mordecai Dildy wrote: Hello everyone out there. Ive been trying to install packages like distribute, nose, and virturalenv and believe me it is a hard process to do. I tried everything I could think of to install. I have done the

Re: Fastest web framework

2012-09-23 Thread Alex Clark
On 2012-09-23 09:19:16 +, Andriy Kornatskyy said: I have run recently a benchmark of a trivial 'hello world' application for various python web frameworks (bottle, django, flask, pyramid, web.py, wheezy.web) hosted in uWSGI/cpython2.7 and gunicorn/pypy1.9... you might find it

List Problem

2012-09-23 Thread jimbo1qaz
I have a nested list. Whenever I make a copy of the list, changes in one affect the other, even when I use list(orig) or even copy the sublists one by one. I have to manually copy each cell over for it to work. Link to broken code: http://jimbopy.pastebay.net/1090401 --

Re: Capitalization for variable that holds a class

2012-09-23 Thread Steven D'Aprano
On Mon, 24 Sep 2012 02:12:25 +1000, Chris Angelico wrote: On Mon, Sep 24, 2012 at 1:48 AM, Joshua Landau joshua.landau...@gmail.com wrote: Simple question: [myClass() for myClass in myClasses] vs [MyClass() for MyClass in myClasses] Fight. (When considering, substitute in a more

Re: List Problem

2012-09-23 Thread jimbo1qaz
On Sunday, September 23, 2012 2:31:48 PM UTC-7, jimbo1qaz wrote: I have a nested list. Whenever I make a copy of the list, changes in one affect the other, even when I use list(orig) or even copy the sublists one by one. I have to manually copy each cell over for it to work. Link to broken

Re: List Problem

2012-09-23 Thread Oscar Benjamin
On 23 September 2012 22:31, jimbo1qaz jimmyli1...@gmail.com wrote: I have a nested list. Whenever I make a copy of the list, changes in one affect the other, even when I use list(orig) or even copy the sublists one by one. I have to manually copy each cell over for it to work. Link to broken

Re: List Problem

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 7:44 AM, jimbo1qaz jimmyli1...@gmail.com wrote: On Sunday, September 23, 2012 2:31:48 PM UTC-7, jimbo1qaz wrote: I have a nested list. Whenever I make a copy of the list, changes in one affect the other, even when I use list(orig) or even copy the sublists one by one.

Re: List Problem

2012-09-23 Thread Dave Angel
On 09/23/2012 05:44 PM, jimbo1qaz wrote: On Sunday, September 23, 2012 2:31:48 PM UTC-7, jimbo1qaz wrote: I have a nested list. Whenever I make a copy of the list, changes in one affect the other, even when I use list(orig) or even copy the sublists one by one. I have to manually copy each

Re: List Problem

2012-09-23 Thread Steven D'Aprano
On Sun, 23 Sep 2012 14:31:48 -0700, jimbo1qaz wrote: I have a nested list. Whenever I make a copy of the list, changes in one affect the other, Then you aren't making a copy. py first_list = [1, 2, 3] py second_list = first_list # THIS IS NOT A COPY py second_list.append() py print

Re: Obnoxious postings from Google Groups (was: datetime issue)

2012-09-23 Thread Grant Edwards
On 2012-09-22, Hank Gay hank.gay+eternal.septem...@gmail.com wrote: On 2012-09-21 15:07:09 +, Grant Edwards said: I told my news client years ago to filter out anything posted from Google Groups -- and I know I'm not alone. If one wants the best chance of getting a question answered,

Re: List Problem

2012-09-23 Thread jimbo1qaz
On Sunday, September 23, 2012 2:31:48 PM UTC-7, jimbo1qaz wrote: I have a nested list. Whenever I make a copy of the list, changes in one affect the other, even when I use list(orig) or even copy the sublists one by one. I have to manually copy each cell over for it to work. Link to broken

Editing Inkscape SVG files with Python?

2012-09-23 Thread Steven D'Aprano
I have some SVG files generated with Inkscape containing many text blocks (over 100). I wish to programmatically modify those text blocks using Python. Is there a library I should be using, or any other guidelines or advice anyone can give me? Googling for python inkscape comes up with too

Re: For Counter Variable

2012-09-23 Thread Steven D'Aprano
On Sun, 23 Sep 2012 10:45:53 -0700, jimbo1qaz wrote: On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I couldn't find anything in the documentation.

Re: Invalid identifier claimed to be valid by docs (methinks)

2012-09-23 Thread Ian Kelly
On Sun, Sep 23, 2012 at 4:24 PM, Joshua Landau joshua.landau...@gmail.com wrote: The docs describe identifiers to have this grammar: identifier ::= xid_start xid_continue* id_start ::= all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the

Re: Editing Inkscape SVG files with Python?

2012-09-23 Thread Oscar Benjamin
On 23 September 2012 23:53, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I have some SVG files generated with Inkscape containing many text blocks (over 100). I wish to programmatically modify those text blocks using Python. Is there a library I should be using, or any other

Java singletonMap in Python

2012-09-23 Thread Mark Lawrence
Purely for fun I've been porting some code to Python and came across the singletonMap[1]. I'm aware that there are loads of recipes on the web for both singletons e.g.[2] and immutable dictionaries e.g.[3]. I was wondering how to combine any of the recipes to produce the best implementation,

Re: For Counter Variable

2012-09-23 Thread Tim Chase
On 09/23/12 17:54, Steven D'Aprano wrote: On Sun, 23 Sep 2012 10:45:53 -0700, jimbo1qaz wrote: On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote: Am I missing something obvious, or do I have to manually put in a counter in the for loops? That's a very basic request, but I

Re: Invalid identifier claimed to be valid by docs (methinks)

2012-09-23 Thread Joshua Landau
On 23 September 2012 23:57, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Sep 23, 2012 at 4:24 PM, Joshua Landau joshua.landau...@gmail.com wrote: The docs describe identifiers to have this grammar: identifier ::= xid_start xid_continue* id_start ::= all characters in general

pyOpenSSL - m2crypto conversion?

2012-09-23 Thread Matej Cepl
Hi, gajim (http://gajim.org, Jabber/XMPP instatnt messenger written in PyGtk) uses for crypto mix of some functions from the standard library, pyOpenSSL for SSL communication, and python-crypto for E2E (encryption of the messages ... uses RSA and AES; see https://trac.gajim.org/ticket/5294

Re: Java singletonMap in Python

2012-09-23 Thread Oscar Benjamin
On 24 September 2012 00:14, Mark Lawrence breamore...@yahoo.co.uk wrote: Purely for fun I've been porting some code to Python and came across the singletonMap[1]. I'm aware that there are loads of recipes on the web for both singletons e.g.[2] and immutable dictionaries e.g.[3]. I was

Re: For Counter Variable

2012-09-23 Thread Alec Taylor
You can always use a counter if you don't like our fancy for-each loops; foolist = [1,24,24,234,23,423,4] for i in xrange(len(foolist)): print foolist[i] On Mon, Sep 24, 2012 at 9:29 AM, Tim Chase python.l...@tim.thechases.comwrote: On 09/23/12 17:54, Steven D'Aprano wrote: On Sun, 23

Re: For Counter Variable

2012-09-23 Thread Tim Chase
On 09/23/12 18:52, Alec Taylor wrote: You can always use a counter if you don't like our fancy for-each loops; foolist = [1,24,24,234,23,423,4] for i in xrange(len(foolist)): print foolist[i] http://www.seas.upenn.edu/~lignos/py_antipatterns.html The first one on the list of

Re: List Problem

2012-09-23 Thread Littlefield, Tyler
On 9/23/2012 3:44 PM, jimbo1qaz wrote: On Sunday, September 23, 2012 2:31:48 PM UTC-7, jimbo1qaz wrote: I have a nested list. Whenever I make a copy of the list, changes in one affect the other, even when I use list(orig) or even copy the sublists one by one. I have to manually copy each cell

Re: Editing Inkscape SVG files with Python?

2012-09-23 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: I have some SVG files generated with Inkscape containing many text blocks (over 100). I wish to programmatically modify those text blocks using Python. Is there a library I should be using, or any other guidelines or advice anyone

Re: For Counter Variable

2012-09-23 Thread Mark Lawrence
On 24/09/2012 01:05, Tim Chase wrote: On 09/23/12 18:52, Alec Taylor wrote: You can always use a counter if you don't like our fancy for-each loops; foolist = [1,24,24,234,23,423,4] for i in xrange(len(foolist)): print foolist[i] http://www.seas.upenn.edu/~lignos/py_antipatterns.html

keeping information about players around

2012-09-23 Thread Littlefield, Tyler
ytHello all: I've asked for a couple code reviews lately on a mud I've been working on, to kind of help me with ideas and a better design. I have yet another design question. In my mud, zones are basically objects that manage a collection of rooms; For example, a town would be it's own zone.

Pass numeric arrays from C extensions to Python

2012-09-23 Thread JBT
Hi, I am looking for a way to pass numeric arrays, such as *float a[100]; double b[200];*, from C extension codes to python. The use case of this problem is that you have data stored in a particular format, NASA common data format (CDF) in my case, and there exists an official C library to

Re: List Problem

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 10:56 AM, Littlefield, Tyler ty...@tysdomain.com wrote: I've not been following this thread fully, but why not just use x=list(y) to copy the list? The issue is that when you assign i=[1,2,3] and then j = i, j is just a reference to i, which is why you change either and

Re: Pass numeric arrays from C extensions to Python

2012-09-23 Thread Oscar Benjamin
On 24 September 2012 02:39, JBT jianbao@gmail.com wrote: Hi, I am looking for a way to pass numeric arrays, such as *float a[100]; double b[200];*, from C extension codes to python. The use case of this problem is that you have data stored in a particular format, NASA common data format

Re: Java singletonMap in Python

2012-09-23 Thread Steven D'Aprano
On Mon, 24 Sep 2012 00:14:23 +0100, Mark Lawrence wrote: Purely for fun I've been porting some code to Python and came across the singletonMap[1]. I'm aware that there are loads of recipes on the web for both singletons e.g.[2] and immutable dictionaries e.g.[3]. I was wondering how to

Re: Invalid identifier claimed to be valid by docs (methinks)

2012-09-23 Thread Terry Reedy
On 9/23/2012 6:57 PM, Ian Kelly wrote: On Sun, Sep 23, 2012 at 4:24 PM, Joshua Landau joshua.landau...@gmail.com wrote: The docs describe identifiers to have this grammar: identifier ::= xid_start xid_continue* id_start ::= all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl,

Re: Pass numeric arrays from C extensions to Python

2012-09-23 Thread Terry Reedy
On 9/23/2012 9:39 PM, JBT wrote: Hi, I am looking for a way to pass numeric arrays, such as *float a[100]; double b[200];*, from C extension codes to python. The use case of this problem is that you have data stored in a particular format, NASA common data format (CDF) in my case, and there

Re: cant install livewires

2012-09-23 Thread alex23
On Sep 23, 10:05 pm, james.kenn...@abingdon.org.uk wrote: i cant install livewires and their help about making a directory is useless to me as i dont know how btw im using windows 7 REALLY DESPERATE :) You're skimming and not reading the README correctly. You are *only* instructed to make a

Re: One of my joomla webpages has been hacked. Please help.

2012-09-23 Thread alex23
On Sep 22, 4:45 am, Νίκος Γκρεεκ nikos.gr...@gmail.com wrote: One webpage of mine,http://www.varsa.gr/has been *hacked* 15 mins ago. Here is your problem: joomla If you're looking for a more secure solution: http://plone.org/products/plone/security/overview --

Re: technologies synergistic with Python

2012-09-23 Thread alex23
On Sep 22, 8:16 am, Ethan Furman et...@stoneleaf.us wrote: What is the consensus... okay, okay -- what are some wide ranging opinions on technologies that I should know if my dream job is one that consists mostly of Python, and might allow telecommuting? A technology that I consider *highly*

Re: A little morning puzzle

2012-09-23 Thread alex23
On Sep 23, 1:44 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Just because you can use a function, and make it look easier, doesn't mean the function you used had less code than mine, so if you look at the whole of what you used to make it simpler, mine was on point. Word of advice: when we

Re: request for another code review

2012-09-23 Thread alex23
On Sep 23, 6:14 am, Littlefield, Tyler ty...@tysdomain.com wrote: I've gotten a bit farther into my python mud, and wanted to request another code review for style and the like. Are you familiar with codereview.stackexchange.com ? (This isn't to dissuade you from posting such requests here,

Re: Does python have built command for package skeleton creation?

2012-09-23 Thread alex23
On Sep 21, 10:14 pm, xliiv tymoteusz.jankow...@gmail.com wrote: On Friday, September 21, 2012 1:08:23 PM UTC+2, Tarek Ziadé wrote: Python Paste is probably what you are looking for - see It's a nice beast but: - it's not built in. Should it be? I think it should. There needs to be a

Re: Does python have built command for package skeleton creation?

2012-09-23 Thread Terry Reedy
On 9/23/2012 11:59 PM, alex23 wrote: On Sep 21, 10:14 pm, xliiv tymoteusz.jankow...@gmail.com wrote: On Friday, September 21, 2012 1:08:23 PM UTC+2, Tarek Ziadé wrote: Python Paste is probably what you are looking for - see It's a nice beast but: - it's not built in. Should it be? I think

Re: A little morning puzzle

2012-09-23 Thread Ian Kelly
On Sat, Sep 22, 2012 at 9:44 PM, Dwight Hutto dwightdhu...@gmail.com wrote: Why don't you all look at the code(python and C), and tell me how much code it took to write the functions the other's examples made use of to complete the task. Just because you can use a function, and make it look

Re: Does python have built command for package skeleton creation?

2012-09-23 Thread alex23
On Sep 24, 2:29 pm, Terry Reedy tjre...@udel.edu wrote: Batteries are batteries, not flashlights, phone, radios, toys, clickers, etc. I decided not to mention venv as it undermines my rant a little :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Seome kind of unblocking input

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 3:50 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sun, 23 Sep 2012 18:13:57 +0100, Mark Lawrence breamore...@yahoo.co.uk declaimed the following in gmane.comp.python.general: On 23/09/2012 16:49, Ramchandra Apte wrote: You can clear the buffer by calling

Re: Seome kind of unblocking input

2012-09-23 Thread Ramchandra Apte
On Sunday, 23 September 2012 23:20:37 UTC+5:30, Dennis Lee Bieber wrote: On Sun, 23 Sep 2012 18:13:57 +0100, Mark Lawrence breamore...@yahoo.co.uk declaimed the following in gmane.comp.python.general: On 23/09/2012 16:49, Ramchandra Apte wrote: You can clear the buffer by

Re: Does python have built command for package skeleton creation?

2012-09-23 Thread Ramchandra Apte
On Monday, 24 September 2012 09:59:12 UTC+5:30, Terry Reedy wrote: On 9/23/2012 11:59 PM, alex23 wrote: On Sep 21, 10:14 pm, xliiv tymoteusz.jankow...@gmail.com wrote: On Friday, September 21, 2012 1:08:23 PM UTC+2, Tarek Ziadé wrote: Python Paste is probably what you are looking for

  1   2   >