Hooking Mechanism when Entering and Leaving a Try Block

2015-08-11 Thread Sven R. Kunze
Hi everybody, is there something like a hook that a Python module could register to in order to 'trace' the entering and leaving of arbitrary try blocks? What is this good for? I am the maintainer of https://pypi.python.org/pypi/xfork . A package for converting a classic sequential program

Real-time recoding of video from asx to non-Windows formats

2015-08-11 Thread Montana Burr
Hi, I'm interested in using Python to create a server for streaming my state's traffic cameras - which are only available as Windows Media streams - to devices that do not natively support streaming Windows Media content (think Linux computers & iPads). I know Python makes various problems eas

Re: Data integrity problem with sqlite3 - solved

2015-08-11 Thread Frank Millman
"Frank Millman" wrote in message news:mqcslv$tee$1...@ger.gmane.org... "Frank Millman" wrote in message news:mqcmie$po9$1...@ger.gmane.org... > Hi all > > I have a 'data integrity' problem with sqlite3 that I have been battling > with for a while. I have not got to the bottom of it yet but I

Re: AttributeError

2015-08-11 Thread Ltc Hotspot
Message heard loud and clear: There are no error messages, the output is the issue. Question: What sorted function should I write to produce the desired output, below: Desired output: 04 3 06 1 07 1 09 2 10 3 11 6 14 1 15 2 16 4 17 2 18 1 19 1 Latest revised code: count = dict() fname = raw_i

Re: AttributeError

2015-08-11 Thread Chris Angelico
On Wed, Aug 12, 2015 at 1:05 PM, Ltc Hotspot wrote: > > Check the code and the visualize execution of the code, available at > http://tinyurl.com/p8tgd5h > > message reads: NameError: name 'collections' is not defined I've no idea why you made this Frankenstein monster out of your original code a

Re: AttributeError

2015-08-11 Thread Mark Lawrence
On 12/08/2015 04:05, Ltc Hotspot wrote: Chris, Check the code and the visualize execution of the code, available at http://tinyurl.com/p8tgd5h message reads: NameError: name 'collections' is not defined Which is why we kept telling you over on the tutor mailing list to show us your complete

Re: AttributeError

2015-08-11 Thread Ltc Hotspot
Chris, Check the code and the visualize execution of the code, available at http://tinyurl.com/p8tgd5h message reads: NameError: name 'collections' is not defined Regards, Hal On Tue, Aug 11, 2015 at 5:49 PM, Chris Angelico wrote: > On Wed, Aug 12, 2015 at 10:43 AM, Ltc Hotspot > wrote: > >

Re: AttributeError

2015-08-11 Thread Mark Lawrence
On 12/08/2015 01:49, Chris Angelico wrote: On Wed, Aug 12, 2015 at 10:43 AM, Ltc Hotspot wrote: Python can pull the hour from the 'From ' line by finding the time and then splitting the string a second time using a colon, i.e., From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 Finally,

Re: AttributeError

2015-08-11 Thread MRAB
On 2015-08-12 01:43, Ltc Hotspot wrote: The Assignment: I'm trying to write Python code to read through a data file and figure out the distribution by hour of the dat for each message in the data file. Python can pull the hour from the 'From ' line by finding the time and then splitting th

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Chris Angelico
On Wed, Aug 12, 2015 at 5:08 AM, Fabio Zadrozny wrote: > > As it's just a way to convert from a Python-like syntax to JavaScript syntax > you can even switch to plain JavaScript later on if you want -- in fact, when > you debug the code you'll be debugging JavaScript and not Python (it's like >

Re: AttributeError

2015-08-11 Thread Chris Angelico
On Wed, Aug 12, 2015 at 10:43 AM, Ltc Hotspot wrote: > Python can pull the hour from the 'From ' line by finding the time and then > splitting the string a second time using a colon, i.e., From > stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 > > Finally, accumulated the counts for each hour,

Re: AttributeError

2015-08-11 Thread Ltc Hotspot
The Assignment: I'm trying to write Python code to read through a data file and figure out the distribution by hour of the dat for each message in the data file. Python can pull the hour from the 'From ' line by finding the time and then splitting the string a second time using a colon, i.e., F

Re: AttributeError

2015-08-11 Thread MRAB
On 2015-08-12 01:01, Ltc Hotspot wrote: Hi Everyone, What is the list equivalent to line 12: ncount.sort(reverse=True) count = dict() fname = raw_input("Enter file name: ")# handle = open (fname, 'r')# for line in handle: if line.startswith("From "): address = line.split()[5]

Re: AttributeError

2015-08-11 Thread leo kirotawa
assign using () creates tuple not a list. Tuples have not .sort() method. correct would be: ncount = [key,val] On Tue, Aug 11, 2015 at 9:01 PM, Ltc Hotspot wrote: > Hi Everyone, > > > What is the list equivalent to line 12: ncount.sort(reverse=True) > > > count = dict() > fname = raw_input("Enter

AttributeError

2015-08-11 Thread Ltc Hotspot
Hi Everyone, What is the list equivalent to line 12: ncount.sort(reverse=True) count = dict() fname = raw_input("Enter file name: ")# handle = open (fname, 'r')# for line in handle: if line.startswith("From "): address = line.split()[5] line = line.rstrip() count[a

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks Fabio, we'll check RapydScript and we might use it for Speedy Mail Software as well! I will check with the other developers (which are on the speedy-mail-software list). In the past I had Speedy Mail online from 2000 to 2005 and it was based on a Perl script (Perl was popular in 2000). But s

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Fabio Zadrozny
Hi Uri, No, I'm not related to it. -- I'm the PyDev/Eclipse maintainer... that already takes a lot of my time ;) It's license is BSD (so, no need to pay). As it's just a way to convert from a Python-like syntax to JavaScript syntax you can even switch to plain JavaScript later on if you want -- i

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks Fabio, it's very interesting. Are you related to Pyjeon Software? Do we have to pay to use RapydScript? Is it ready for production? *Uri Even-Chen* [image: photo] Phone: +972-54-3995700 Email: u...@speedy.net Website: http://www.speedysoftware.com/uri/en/

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Fabio Zadrozny
On Tue, Aug 11, 2015 at 8:55 AM, Uri Even-Chen wrote: > Thanks for the feedback. Actually I asked this question also in the > django-users mailing list and Russell Keith-Magee told me about > Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing > lists) but I also asked if

testfixtures 4.2.0 Released!

2015-08-11 Thread Chris Withers
Hi All, I'm pleased to announce the release of testfixtures 4.2.0. This is a feature release that fixes the following: - A new MockPopen mock for use when testing code that uses subprocess.Popen. - ShouldRaiss now subclasses object, so that subclasses of it may use super(). - Support for

EuroPython 2015: Videos are online

2015-08-11 Thread M.-A. Lemburg
Thanks to our Media Work Group (WG) and especially Anthon and Luis, the conference videos are now cut, edited and uploaded to our YouTube channel as well as our archive.org collection: http://europython.tv http://archive.europython.tv A total of 173 talk videos were processed, so there’s

Re: Data integrity problem with sqlite3 - solved

2015-08-11 Thread Frank Millman
"Frank Millman" wrote in message news:mqcmie$po9$1...@ger.gmane.org... Hi all I have a 'data integrity' problem with sqlite3 that I have been battling with for a while. I have not got to the bottom of it yet but I do have some useful info, so I thought I would post it here in the hope that

Re: Data integrity problem with sqlite3

2015-08-11 Thread Chris Angelico
On Tue, Aug 11, 2015 at 10:37 PM, Frank Millman wrote: > My PostgreSQL is inaccessible at the moment as I am moving machines around, > but I have tested it with MS SQL Server, and it behaves as expected – the > transaction is fully rolled back and nothing is committed to the database. Does MS SQL

Re: Data integrity problem with sqlite3

2015-08-11 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmrHmj2bsdSm4CQ=orgxutmyctk3w3e3n-qxolg2tvq...@mail.gmail.com... On Tue, Aug 11, 2015 at 9:33 PM, Frank Millman wrote: > I have added 'set_trace_callback' to see exactly what is going on, and > in > the middle of my series of commands I find the fo

Re: looking for standard/builtin dict-like data object

2015-08-11 Thread Chris Angelico
On Tue, Aug 11, 2015 at 10:06 PM, Vladimir Ignatov wrote: I also thought the stdlib had some kind of "namespace" class with this kind of API, but I can't find it now:-( >>> >>> >>> It does - types.SimpleNamespace(). It accepts keyword arguments, and >>> will let you create more attr

Re: looking for standard/builtin dict-like data object

2015-08-11 Thread Vladimir Ignatov
>>> I also thought the stdlib had some kind of "namespace" class with this >>> kind >>> of API, but I can't find it now:-( >> >> >> It does - types.SimpleNamespace(). It accepts keyword arguments, and >> will let you create more attributes on the fly (unlike a namedtuple). > > > Yes, that's it. Tha

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks for the feedback. Actually I asked this question also in the django-users mailing list and Russell Keith-Magee told me about Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing lists) but I also asked if I can use JavaScript scripts such as jQuery, jQuery UI and other

Re: Data integrity problem with sqlite3

2015-08-11 Thread Chris Angelico
On Tue, Aug 11, 2015 at 9:33 PM, Frank Millman wrote: > I have added 'set_trace_callback' to see exactly what is going on, and in > the middle of my series of commands I find the following - > >COMMIT >BEGIN IMMEDIATE > > According to the docs, the sqlite3 module commits transactions impli

Data integrity problem with sqlite3

2015-08-11 Thread Frank Millman
Hi all I have a 'data integrity' problem with sqlite3 that I have been battling with for a while. I have not got to the bottom of it yet but I do have some useful info, so I thought I would post it here in the hope that someone with some knowledge of the internals of the python sqlite3 module

Re: Flan definition collision

2015-08-11 Thread Luca Menegotto
Il 11/08/2015 08:28, smahab...@google.com ha scritto: I am importing two modules, each of which is defining flags > (command line arguments) with the same name. This makes > it impossible to import both the modules at once, because of flag > name definition conflict. If you use 'import', and

Re: Flan definition collision

2015-08-11 Thread Joel Goldstick
On Tue, Aug 11, 2015 at 2:28 AM, smahabole--- via Python-list wrote: > I am importing two modules, each of which is defining flags (command line > arguments) with the same name. This makes it impossible to import both the > modules at once, because of flag name definition conflict. Is there any

Re: Pipes

2015-08-11 Thread Tim Golden
On 11/08/2015 10:58, Laura Creighton wrote: The O'Reilly book Effective Computation in Physics that Larry Hudson recommended looks really good. It also occurs to me that another way to get familiar with the scientific python world is to attend a Scientific Python conference. EuroSciPy is the en

Re: Pipes

2015-08-11 Thread Laura Creighton
The O'Reilly book Effective Computation in Physics that Larry Hudson recommended looks really good. It also occurs to me that another way to get familiar with the scientific python world is to attend a Scientific Python conference. EuroSciPy is the end of this month in Cambridge. https://www.euro

Re: Is Django the way to go for a newbie?

2015-08-11 Thread Laura Creighton
In a message of Tue, 11 Aug 2015 09:49:01 +0800, Dwight GoldWinde writes: >Thank you, Gary, for this new information. > >I will be looking into virtualenv and vertualenvwrapper. > >I thought that Django was an IDE. But, it seems that an IDE is one more >thing that I need that I didn¹t know I needed

Re: Pipes

2015-08-11 Thread Laura Creighton
In a message of Mon, 10 Aug 2015 15:43:26 -0500, "E.D.G." writes: > I needed a program that could generate data regarding the locations >of the sun and the moon in the sky in response to specific times entered. >Roger developed the basic equations with some help from another researcher. >A