ANN: SfePy 2013.1

2013-02-28 Thread Robert Cimrman
I am pleased to announce release 2013.1 of SfePy. Description --- SfePy (simple finite elements in Python) is a software for solving systems of coupled partial differential equations by the finite element method. The code is based on NumPy and SciPy packages. It is distributed under the

Wing IDE 4.1.11 released

2013-02-28 Thread Wingware
Hi, Wingware has released version 4.1.11 of Wing IDE, our integrated development environment designed specifically for the Python programming language. Wing IDE provides a professional quality code editor with vi, emacs, and other key bindings, auto-completion, call tips, refactoring,

Re: Python Speed

2013-02-28 Thread Stefan Behnel
Steven D'Aprano, 28.02.2013 08:05: On Wed, 27 Feb 2013 21:11:25 -0500, Terry Reedy wrote: There is a problem with timer overhead for sub-microsecond operations. In interactive use, the code is compiled within a function that gets called. The string 'abc需' should be stored as a constant in

Re: Python Speed

2013-02-28 Thread Steven D'Aprano
On Wed, 27 Feb 2013 23:40:22 -0800, jmfauth wrote: As long as you are attempting to work with a composite scheme not working with a unique set of characters, not only it will not work (properly/with efficiency), it can not work. What's a composite scheme? This not even a unicode problem.

Re: Python newbie trying to embed in C++

2013-02-28 Thread Marwan Badawi
On 27/02/2013 10:26, Ian Kelly wrote: On Wed, Feb 27, 2013 at 1:51 AM, Marwan lar...@free.fr wrote: When I run the generated exe, I get errors about the functions not existing... TestPython.exe test Hello AttributeError: 'module' object has no attribute 'Hello' Cannot find function Hello

Re: Python newbie trying to embed in C++

2013-02-28 Thread Marwan Badawi
On 27/02/2013 16:17, Christian Gollwitzer wrote: Am 27.02.13 09:51, schrieb Marwan: And I'd appreciate it if you could give me pointers to how to easily call Python from C++. Maybe you can use boost::python? http://www.boost.org/doc/libs/1_53_0/libs/python/doc/ Cave: I haven't used it and

Re: Project Based python tutorials

2013-02-28 Thread Jean-Michel Pichavant
- Original Message - On Wednesday, February 27, 2013 2:31:11 AM UTC-6, Alvin Ghouas wrote: So, I desided to start learning programming a few months ago and by now i feel pretty confident about the basics of the python language, and programming in general. Variables, loops,

Re: Python newbie trying to embed in C++

2013-02-28 Thread Gisle Vanem
Marwan Badawi marwan.bad...@inria.fr wrote: I just noticed that my reply went to the message sender and not to the newsgroup, so I'm posting again: thanks, I'll look into that. Yes, I often do that too; i.e. I'm subscribed to python-list@python.org and get all messages from comp.lang.python

Re: mp3

2013-02-28 Thread fabriceS
Le 28/02/2013 01:07, alex23 a écrit : On Feb 28, 7:58 am, fabriceS fabrice.sinc...@wanadoo.fr wrote: Is anybody know how to get the lenght (in seconds) of a mp3 file ? Try eyeD3: https://pypi.python.org/pypi/eyeD3 import eyed3 mp3 =

Re: Nuitka now supports Python 3.2

2013-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2013 08:07:55 +0100, Stefan Behnel wrote: Steven D'Aprano, 26.02.2013 13:18: Nuitka is an implementation of Python written in C++. At the moment it is claimed to be about 2.5 times as fast as CPython running the pystone benchmark. Could we please get to the habit of not

raw format string in string format method?

2013-02-28 Thread Helmut Jarausch
Hi, I'd like to print a string with the string format method which uses {0}, ... Unfortunately, the string contains TeX commands which use lots of braces. Therefore I would have to double all these braces just for the format method which makes the string hardly readable. Is there anything like

Re: raw format string in string format method?

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 1:11 AM, Helmut Jarausch jarau...@skynet.be wrote: Hi, I'd like to print a string with the string format method which uses {0}, ... Unfortunately, the string contains TeX commands which use lots of braces. Therefore I would have to double all these braces just for the

Re: raw format string in string format method?

2013-02-28 Thread Helmut Jarausch
On Fri, 01 Mar 2013 01:22:48 +1100, Chris Angelico wrote: On Fri, Mar 1, 2013 at 1:11 AM, Helmut Jarausch jarau...@skynet.be wrote: Hi, I'd like to print a string with the string format method which uses {0}, ... Unfortunately, the string contains TeX commands which use lots of braces.

Re: raw format string in string format method?

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 1:42 AM, Helmut Jarausch jarau...@skynet.be wrote: On Fri, 01 Mar 2013 01:22:48 +1100, Chris Angelico wrote: On Fri, Mar 1, 2013 at 1:11 AM, Helmut Jarausch jarau...@skynet.be wrote: Hi, I'd like to print a string with the string format method which uses {0}, ...

Re: raw format string in string format method?

2013-02-28 Thread Peter Otten
Helmut Jarausch wrote: I'd like to print a string with the string format method which uses {0}, ... Unfortunately, the string contains TeX commands which use lots of braces. Therefore I would have to double all these braces just for the format method which makes the string hardly readable.

سعر بلاك بيرى blackberry z10- z10

2013-02-28 Thread 23alagmy
سعر بلاك بيرى blackberry z10- z10 http://natigtas7ab.blogspot.com/2013/02/z10-blackberry-z10_23.html -- http://mail.python.org/mailman/listinfo/python-list

Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Morten Engvoldsen
Hi team, I need to run a batch of sales records and the batch has serial_number filed to store the serial number of the sales record. The serial number should be set to 1 everyday when the batch runs first time in a day and the maximum serial number could be 1000. So when the batch runs first

Speeding up Python's exit

2013-02-28 Thread Steven D'Aprano
I just quit an interactive session using Python 2.7 on Linux. It took in excess of twelve minutes to exit, with the load average going well past 9 for much of that time. I think the reason it took so long was that Python was garbage-collecting a giant dict with 10 million entries, each one

Re: Speeding up Python's exit

2013-02-28 Thread Neil Cerutti
On 2013-02-28, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Can anyone explain why this was so painfully slow, and what (if anything) I can do to avoid it in the future? I think your explanation makes sense. Maybe the nested nature of the strings was causing it to churn looking

Largest possible size for executemany() in PEP-249 (Database API)

2013-02-28 Thread Roy Smith
I'm trying to batch up inserts to a database using MySQLdb. When I get to something over 10,000 records per call, I get an exception: _mysql_exceptions.OperationalError: (1153, Got a packet bigger than 'max_allowed_packet' bytes) Is there any way (other than trial and error) to know how many

Import web content to csv only if values are different from those of an excel sheet

2013-02-28 Thread io
Hi, i have the following python script that reads json data from a website and writes it in a csv file that i will then import to excel. (i have just started since a week with py so i'm a noob!) : --- import json import urllib import csv

[ANN] PyLint 0.27 / logilab-astng 0.24.2

2013-02-28 Thread Sylvain Thénault
Hi there, I'm very pleased to announce the release of pylint 0.27 [1] and logilab-astng 0.24.2 [2] . There has been a lot of enhancements and bug fixes since the latest release, so you're strongly encouraged to upgrade. See ChangeLog for details. Many thanks to all the people who contributed to

Re: Speeding up Python's exit

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 4:31 AM, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Thu, Feb 28, 2013 at 12:06 PM, Chris Angelico ros...@gmail.com wrote: Is it any different if you create a deliberate reference loop and then stuff it into some module somewhere? That would force it to be kept

Re: Speeding up Python's exit

2013-02-28 Thread Devin Jeanpierre
On Thu, Feb 28, 2013 at 12:31 PM, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Thu, Feb 28, 2013 at 12:06 PM, Chris Angelico ros...@gmail.com wrote: Is it any different if you create a deliberate reference loop and then stuff it into some module somewhere? That would force it to be kept

Re: Speeding up Python's exit

2013-02-28 Thread Devin Jeanpierre
On Thu, Feb 28, 2013 at 12:06 PM, Chris Angelico ros...@gmail.com wrote: Is it any different if you create a deliberate reference loop and then stuff it into some module somewhere? That would force it to be kept until interpreter shutdown, and then a cyclic garbage collection after that, which

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Vytas D.
Hi, If you want to have one program running forever and printing sales_records, you would do (one of the possibilities) something like this: def salesrecord(serial_number): for i in salesrecord: print first_sales_record serial_number += 1 print serial_number

Re: Breaking into descriptors

2013-02-28 Thread Dave Angel
On 02/28/2013 12:24 PM, Demian Brecht wrote: class MyDescriptor(object): def __init__(self): self.foo = 'bar' def __get__(self, obj, type_): import pdb; pdb.set_trace() return self.do_something() def __set__(self, obj, val): self.foo = val

Re: Python newbie trying to embed in C++

2013-02-28 Thread Michael Torrie
On 02/28/2013 03:47 AM, Gisle Vanem wrote: I saw you uses Thunderbird on Windows. I'm not sure how it by default handles a reply-to when there is no Reply-to field in the header. To the address in From / Sender or what? Thunderbird has a handy, reply to list button that works every time no

Re: Do you feel bad because of the Python docs?

2013-02-28 Thread Rick Johnson
On Wednesday, February 27, 2013 11:57:05 PM UTC-6, alex23 wrote: On Feb 28, 2:53 pm, Rick Johnson rantingrickjohn...@gmail.com wrote: On Wednesday, February 27, 2013 10:18:46 PM UTC-6, alex23 wrote: [...] * Do you care about the evolution of Python or just give it lip service? I don't see

Re: Breaking into descriptors

2013-02-28 Thread Demian Brecht
On Thu, Feb 28, 2013 at 10:01 AM, Dave Angel da...@davea.name wrote: It halts (breaks) for me, in Python 2.7.3 on Linux Okay, now I'm just confused. I ran this in terminal on OSX with both 2.7.3 and 3.4(dev) and both were exhibiting the same behaviour. I've since closed the terminal and upon

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Morten Engvoldsen
Hi, thanks for youe suggestion. I think i will go for your second option: # Runs this loop until killed while True do some stuff: clean serial_number, if day changed, calculate salesrecord etc. serial_number = salesrecord(serial_number) But, if i save the serial_ number value in file, then how

Re: Nuitka now supports Python 3.2

2013-02-28 Thread Stefan Behnel
Steven D'Aprano, 28.02.2013 14:23: On Thu, 28 Feb 2013 08:07:55 +0100, Stefan Behnel wrote: Steven D'Aprano, 26.02.2013 13:18: Nuitka is an implementation of Python written in C++. At the moment it is claimed to be about 2.5 times as fast as CPython running the pystone benchmark. Could we

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Matt Jones
Store the day as well as the serial_number in your file. If the day is the same as today's day, use the serial_number, if not, use 1. At the end of you program write the current day and serial_number. *Matt Jones* On Thu, Feb 28, 2013 at 1:00 PM, Morten Engvoldsen mortene...@gmail.comwrote:

Re: Import web content to csv only if values are different from those of an excel sheet

2013-02-28 Thread Joel Goldstick
On Thu, Feb 28, 2013 at 12:25 PM, io mar...@libero.it wrote: Hi, i have the following python script that reads json data from a website and writes it in a csv file that i will then import to excel. (i have just started since a week with py so i'm a noob!) :

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Rick Johnson
On Thursday, February 28, 2013 10:31:58 AM UTC-6, Morten Engvoldsen wrote: [...] So if the batch has 10 records and last serial number of first batch is 10, then when the batch runs second time in the same day, how the 'serial_number' will get the value of 10 and then continue the serial

Read csv file and create a new file

2013-02-28 Thread io
Hi, i have to files. First file is a csv file Second file is a plain text file where each row has a value (text) I want to be able to create a third file using data from the first file excluding the values listed in the second file. Example: First file: --- mtgoxeur12

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread John Gordon
In mailman.2663.1362078015.2939.python-l...@python.org Morten Engvoldsen mortene...@gmail.com writes: But, if i save the serial_ number value in file, then how will it decide to reset the serial number to '1' when the batch runs on next working day. Name the file so that it contains the

Re: Read csv file and create a new file

2013-02-28 Thread Joel Goldstick
On Thu, Feb 28, 2013 at 2:14 PM, io mar...@libero.it wrote: Hi, i have to files. First file is a csv file Second file is a plain text file where each row has a value (text) Read the second file so that you have a list of each of its values Read the first file line by line. Check if the

Re: Read csv file and create a new file

2013-02-28 Thread Neil Cerutti
On 2013-02-28, io mar...@libero.it wrote: Hi, i have to files. First file is a csv file Second file is a plain text file where each row has a value (text) I want to be able to create a third file using data from the first file excluding the values listed in the second file. Example:

Re: Read csv file and create a new file

2013-02-28 Thread Dave Angel
On 02/28/2013 02:14 PM, io wrote: Hi, i have to files. First file is a csv file Second file is a plain text file where each row has a value (text) I want to be able to create a third file using data from the first file excluding the values listed in the second file. Example: First file:

suggestions for improving code fragment please

2013-02-28 Thread The Night Tripper
Hi there I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0) if arglist: self.myparm2 = arglist.pop(0) if

Re: Read csv file and create a new file

2013-02-28 Thread io
I'm a noob in python but my code looks like this : import json import urllib import csv url = http://bitcoincharts.com/t/markets.json; response = urllib.urlopen(url); data = json.loads(response.read()) f = open(/home/io/markets.csv,wb) c = csv.writer(f) #apre un file di testo e legge il

Re: suggestions for improving code fragment please

2013-02-28 Thread Ian Kelly
On Thu, Feb 28, 2013 at 12:47 PM, The Night Tripper jkn...@nicorp.co.uk wrote: Hi there I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0) if

Re: suggestions for improving code fragment please

2013-02-28 Thread Joel Goldstick
On Thu, Feb 28, 2013 at 2:47 PM, The Night Tripper jkn...@nicorp.co.ukwrote: Hi there I'm being very dumb ... how can I simplify this fragment? i = 0 while arglist: self.myparm[i] = arglist.pop(0) i += 1 if arglist: arglist.pop(0) if arglist:

Re: suggestions for improving code fragment please

2013-02-28 Thread Rick Johnson
On Thursday, February 28, 2013 1:47:12 PM UTC-6, The Night Tripper wrote: I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0) if arglist:

Re: Read csv file and create a new file

2013-02-28 Thread Neil Cerutti
On 2013-02-28, io mar...@libero.it wrote: I'm a noob in python but my code looks like this : import json import urllib import csv I take back what I said about the csv module. It appears you need access to at least one of the data fields, so this is a good use of csv. url =

Re: Read csv file and create a new file

2013-02-28 Thread io
Iterate over the file instead of looping manually. for line in esclusioni_file: esclusioni.append(line.strip()) print(esclusioni) the print was only to see if it was reading correct data but iìm not needing to see it. Why are you checking d[symbol] instead of d[currency]? Maybe

Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread kramer65
Hello, I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode? My reasoning is as follows: When GCC compiles a program

Re: suggestions for improving code fragment please

2013-02-28 Thread Tim Chase
On 2013-02-28 19:47, The Night Tripper wrote: Hi there I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0) if arglist:

Re: Do you feel bad because of the Python docs?

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 5:28 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: Q: Do you feel that the bug tracker should be a place where users discuss grievances that distract volunteers from fixing actual bugs? So you admit that discussion of your whining about perceived grievances would

Fwd: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Morten Engvoldsen
Hi, Okey i have wrote the below program as you suggested: import time from datetime import date def salesrecord(): serial_number = 0 sales_recrod = {'record1':'product1', 'record2':'product2','record3':'product3'} for i in sales_recrod: print sales_recrod[i]

Re: Read csv file and create a new file

2013-02-28 Thread io
Neil, it works great! Just one question : what can i do for ignoring the case sensitive of the symbol? It wasn't working initially, then i wrote the values respecting case sensitive in the file esclusioni and all worked as a charm. I would just like to know if i could ignore the case senstive

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Matty Sarro
Python is an interpreted language, not a compiled language. This is actually a good thing! What it means is that there is a scripting engine (we just call it the interpreter) that actually executes everything for you. That means that any operating system that has an interpreter written for it is

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 6:23 AM, John Gordon gor...@panix.com wrote: In mailman.2663.1362078015.2939.python-l...@python.org Morten Engvoldsen mortene...@gmail.com writes: But, if i save the serial_ number value in file, then how will it decide to reset the serial number to '1' when the batch

Re: Read csv file and create a new file

2013-02-28 Thread io
The final working code is : import json import urllib import csv url = http://bitcoincharts.com/t/markets.json; response = urllib.urlopen(url); data = json.loads(response.read()) f = open(/home/io/markets.csv,wb) c = csv.writer(f) #apre un file di testo e legge il contenuto del file

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Stefan Behnel
kramer65, 28.02.2013 21:25: I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode? All projects that implement such

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Rick Johnson
On Thursday, February 28, 2013 2:41:30 PM UTC-6, Morten Engvoldsen wrote: [...] def salesrecord():     serial_number = 0     sales_recrod = {'record1':'product1', 'record2':'product2', 'record3':'product3', }     for i in

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 7:50 AM, Matty Sarro msa...@gmail.com wrote: C (your example) was intended for very low level programming, things like operating systems, device drivers, networking stacks, where the speed of a compiled executable and direct access to hardware was a necessity. That's

Re: suggestions for improving code fragment please

2013-02-28 Thread MRAB
On 2013-02-28 19:47, The Night Tripper wrote: Hi there I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0) if arglist:

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Stefan Behnel
Stefan Behnel, 28.02.2013 22:03: there are also a couple of projects that do dynamic runtime compilation, most notably PyPy and Numba. Oh, and HotPy, I keep forgetting about that. You may want to take a look at the Python implementations page, specifically the list of Python compilers:

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Dave Angel
On 02/28/2013 03:25 PM, kramer65 wrote: Hello, I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode? My reasoning is

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Modulok
I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode? Not exactly what you describe, but have you checked out PyPy?

Re: suggestions for improving code fragment please

2013-02-28 Thread Mitya Sirenef
On 02/28/2013 02:47 PM, The Night Tripper wrote: Hi there I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0) if arglist: self.myparm2 = arglist.pop(0) if arglist: self.myparm3 = arglist.pop(0) if arglist:

Re: Read csv file and create a new file

2013-02-28 Thread Dave Angel
On 02/28/2013 03:46 PM, io wrote: Neil, it works great! Just one question : what can i do for ignoring the case sensitive of the symbol? It wasn't working initially, then i wrote the values respecting case sensitive in the file esclusioni and all worked as a charm. I would just like to know if

Re: suggestions for improving code fragment please

2013-02-28 Thread Dave Angel
On 02/28/2013 03:37 PM, Tim Chase wrote: On 2013-02-28 19:47, The Night Tripper wrote: Hi there I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0)

Re: suggestions for improving code fragment please

2013-02-28 Thread Terry Reedy
On 2/28/2013 2:47 PM, The Night Tripper wrote: Hi there I'm being very dumb ... how can I simplify this fragment? if arglist: arglist.pop(0) if arglist: self.myparm1 = arglist.pop(0) if arglist:

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Jonas Geiregat
On do, feb 28, 2013 at 12:25:07pm -0800, kramer65 wrote: Hello, I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Morten Engvoldsen
Hi, Thanks all for suggestion... I am using current date as current date local time. I think datetime.datetime will provide current local date and time, so hopefullt the function take care if the local clock is changed... -- Forwarded message -- From: Chris Angelico

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 8:44 AM, Morten Engvoldsen mortene...@gmail.com wrote: Hi, Thanks all for suggestion... I am using current date as current date local time. I think datetime.datetime will provide current local date and time, so hopefullt the function take care if the local clock is

Re: Issue with continous incrementing of unbroken sequence for a entire working day

2013-02-28 Thread Morten Engvoldsen
Hi, I think i can use Europe time zone as current local time : import datetime as dt import pytz utc = pytz.timezone(UTC) norway = pytz.timezone(Europe/Norway) a = dt.datetime(2008, 7, 6, 5, 4, 3, tzinfo=utc) b = a.astimezone(norway) i think this will provide me correct current local time

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Terry Reedy
The subject line is wrong. There are multiple compilers. Someone just listed some of them today in another post. On 2/28/2013 3:50 PM, Matty Sarro wrote: Python is an interpreted language, not a compiled language. A language is just a language. Implementations are implementations*. That

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Nobody
On Thu, 28 Feb 2013 12:25:07 -0800, kramer65 wrote: I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode? It's not

Re: Read csv file and create a new file

2013-02-28 Thread io
Just use a tolower() method on both strings when you're comparing them. Of course, that may not work well with international character sets. Some characters in some languages have no lowercase equivalent, and using toupper() has the same problem in other languages. Also, the approach to

Re: Largest possible size for executemany() in PEP-249 (Database API)

2013-02-28 Thread Neil Hodgson
Roy Smith: _mysql_exceptions.OperationalError: (1153, Got a packet bigger than 'max_allowed_packet' bytes) Is there any way (other than trial and error) to know how many records I can pass in one call before I blow up? Its unlikely to be a limit in the number of records but a limit on

Re: suggestions for improving code fragment please

2013-02-28 Thread Tim Chase
On 2013-02-28 16:28, Dave Angel wrote: On 02/28/2013 03:37 PM, Tim Chase wrote: for attr in (myparm1, myparm2, myparm3, ...): if arglist: setattr(self, attr, arglist.pop(0)) else: break Or something like (untested): for name, value in zip([myparm1,

Re: raw format string in string format method?

2013-02-28 Thread Rick Johnson
On Thursday, February 28, 2013 8:11:17 AM UTC-6, Helmut Jarausch wrote: Hi, I'd like to print a string with the string format method which uses {0}, ... /What/ uses {0} exactly? The substring you wish to inject or the format method? If the latter, we are aware of that! Unfortunately,

Re: suggestions for improving code fragment please

2013-02-28 Thread The Night Tripper
Hi All thanks very much for the various suggestions - very helpful. I think I like one of the 'just catch the exception' approaches, or using Mitya's helper function, which I was clutching towards myself. Either way, lots of food for thought. This forum really is one of the best places

Re: raw format string in string format method?

2013-02-28 Thread Rick Johnson
On Thursday, February 28, 2013 8:42:31 AM UTC-6, Helmut Jarausch wrote: Originally I had used percent-formatting But isn't it deprecated in Python 3.X ? I don't know the current state of percent formats future, however, i can tell you that it should be deprecated ASAP! Simpleminded Sam

HTC ChaCha review

2013-02-28 Thread 23alagmy
HTC ChaCha review http://natigtas7ab.blogspot.com/2012/10/htc-chacha-review.html -- http://mail.python.org/mailman/listinfo/python-list

Re: raw format string in string format method?

2013-02-28 Thread Mark Lawrence
On 28/02/2013 14:42, Helmut Jarausch wrote: On Fri, 01 Mar 2013 01:22:48 +1100, Chris Angelico wrote: On Fri, Mar 1, 2013 at 1:11 AM, Helmut Jarausch jarau...@skynet.be wrote: Hi, I'd like to print a string with the string format method which uses {0}, ... Unfortunately, the string contains

Re: Do you feel bad because of the Python docs?

2013-02-28 Thread alex23
On Mar 1, 4:28 am, Rick Johnson rantingrickjohn...@gmail.com wrote: And by the way Alex, you are free to put *your* face into the conversation anytime you like. You're such a little fascist. -- http://mail.python.org/mailman/listinfo/python-list

Re: Read csv file and create a new file

2013-02-28 Thread Dave Angel
On 02/28/2013 05:05 PM, io wrote: Just use a tolower() method on both strings when you're comparing them. Of course, that may not work well with international character sets. Some characters in some languages have no lowercase equivalent, and using toupper() has the same problem in other

Twisted or Tornado?

2013-02-28 Thread Jake Angulo
I have to say it first: I am not trolling :P Im working on a server project (with IOS client) and would like to create a custom, lean and mean server - real Quick! My requirements for this framework in descending order: 1) Easy to use API 2) Widely available documentation / Examples / Community

Re: Twisted or Tornado?

2013-02-28 Thread Michael Torrie
On 02/28/2013 05:28 PM, Jake Angulo wrote: My requirements for this framework in descending order: 1) Easy to use API 2) Widely available documentation / Examples / Community contributions 3) Feature-wise - kinda most that you commonly need is there By this I take it you mean you want to

Re: Speeding up Python's exit

2013-02-28 Thread Grant Edwards
On 2013-02-28, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I know there is a function os._exit which effectively kills the Python interpreter dead immediately, without doing any cleanup. What are the consequences of doing this? You loose any data you haven't saved to disk. I

QT Inspired web development framework for python

2013-02-28 Thread timothy crosley
Hi Everyone, I've been working on a web development framework that integrates several popular QT features (such as a graphical template builder, signal / slots, ui's built by objects) for the last few years, and I was hoping that some people here might find it useful. If you are interested

ANN: dbf (aka Python dBase)

2013-02-28 Thread Ethan Furman
The latest version, 0.95.001, is available on PyPI: http://python.org/pypi/dbf dbf v0.95.001 = dbf (also known as python dbase) is a module for reading/writing dBase III, FP, VFP, and Clipper .dbf database files. It's an ancient format that still finds lots of use (the most

Re: suggestions for improving code fragment please

2013-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2013 19:47:12 +, The Night Tripper wrote: Hi there I'm being very dumb ... how can I simplify this fragment? I suggest that the best way to simplify that fragment is to change the design of your class so it isn't so horrible. As it stands now, your class defines an

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2013 15:50:00 -0500, Matty Sarro wrote: Python is an interpreted language, not a compiled language. Actually, *languages* are neither interpreted nor compiled. A language is an abstract description of behaviour and syntax. Whether something is interpreted or compiled or a

Store a variable permanently

2013-02-28 Thread eli m
So i have a variable called funds that i want to store the value of even after the program is exited. My funds variable holds the total value of funds i have. I add a certain number of funds each time i run the program by entering how much i want to add. How would i store the funds variable to

Re: Store a variable permanently

2013-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2013 19:35:57 -0800, eli m wrote: So i have a variable called funds that i want to store the value of even after the program is exited. My funds variable holds the total value of funds i have. I add a certain number of funds each time i run the program by entering how much i

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2013 22:03:09 +0100, Stefan Behnel wrote: The most widely used static Python compiler is Cython Cython is not a Python compiler. Cython code will not run in a vanilla Python implementation. It has different keywords and syntax, e.g.: cdef inline int func(double num): ...

Re: Store a variable permanently

2013-02-28 Thread Mitya Sirenef
On 02/28/2013 10:35 PM, eli m wrote: So i have a variable called funds that i want to store the value of even after the program is exited. My funds variable holds the total value of funds i have. I add a certain number of funds each time i run the program by entering how much i want to add.

Re: raw format string in string format method?

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 10:27 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Thursday, February 28, 2013 8:42:31 AM UTC-6, Helmut Jarausch wrote: Originally I had used percent-formatting But isn't it deprecated in Python 3.X ? I don't know the current state of percent formats

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2013 12:25:07 -0800, kramer65 wrote: Hello, I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode?

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread alex23
On Mar 1, 1:47 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Cython is not a Python compiler. Cython code will not run in a vanilla Python implementation. It has different keywords and syntax, e.g.: cdef inline int func(double num):     ... which gives SyntaxError in a

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread alex23
On Mar 1, 6:25 am, kramer65 kram...@gmail.com wrote: There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode? This is a nice site list a lot of current approaches to that subject: http://compilers.pydata.org/ --

Re: QT Inspired web development framework for python

2013-02-28 Thread Michael Torrie
On 02/28/2013 06:48 PM, timothy crosley wrote: I've been working on a web development framework that integrates several popular QT features (such as a graphical template builder, signal / slots, ui's built by objects) for the last few years, and I was hoping that some people here might find

Having problems crashing IDLE

2013-02-28 Thread Quintessence
I've been learning Python over the past week or so and I keep running into an issue where opening saved files will crash IDLE (not consistently, sometimes the same files with no changes will open and sometimes not). I was originally running Python 3.2.3, but I removed it and upgraded to 3.3.0

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread 88888 Dihedral
kramer65於 2013年3月1日星期五UTC+8上午4時25分07秒寫道: Hello, I'm using Python for a while now and I love it. There is just one thing I cannot understand. There are compilers for languages like C and C++. why is it impossible to create a compiler that can compile Python code to machinecode?

  1   2   >