On 8 October 2015 at 01:47, Steven D'Aprano wrote:
> In 3.3, you will have a problem that FrozenDict is not a proper
> iterator. You can't set self.__next__ = self.next, that won't work.
> Dunder methods have to be on the class, not on the instance, so instead
> of making the assignment in the __i
On Mon, 12 Oct 2015 17:15 Albert-Jan Roskam wrote:
Hi,
In Python 2 one can do silly apple-pear comparisons such as 0> "0".*)
"CPython implementation detail: Objects of different types except numbers
are ordered by their type names; objects of the same types that don’t
support proper comparison a
On 31 October 2015 at 00:00, Terry Carroll wrote:
> If you were going to get started doing some simple plotting with Python 2.7
> (in my case, I'm simply plotting temperature against time-of-day) what would
> you use?
>
> - matplotlib [1]
> - gnuplot [2]
> - something else entirely?
I'd use ma
On 19 November 2015 at 13:25, Mike wrote:
> I'm trying to unit test a self-built regular expression processor for an
> assignment. I'm trying to set up unit tests for the package, but it's not
> executing them. This is my first time trying to use the unittest module, so
> I'm sure I'm missing som
On 23 November 2015 at 01:42, CMG Thrissur wrote:
> Is the below text in plain text? I am using thunderbird.
No it isn't. I've kept the first part of it so you can see how it looks:
> import datetime import time import mysql.connector import threading import
> pythonwhois cnx =
> mysql.connector
On 24 November 2015 at 15:36, Albert-Jan Roskam wrote:
> Hi,
>
> I have two classes with a number of methods that are the same, so I want to
> define a super class that holds these methods. But the super class (below
> called _Generic) should not be instantiated, because it serves no purpose
>
On 28 Nov 2015 12:06, "James Oren" wrote:
>
> Hi all, this is my first time using the mailing list.
>
> I'm trying to learn how to use C to extend my code, and have already
worked
> out how to use ctypes. I'm now trying to learn the full C extension module
> approach with Python.h and have worked
On 10 December 2015 at 12:38, Spyros Charonis wrote:
> Dear All,
>
> I am learning about analysis of algorithms (python 2.7.6). I am reading a
> book (Problem solving with Algorithms and Data Structures) where Python is
> the language used for implementations. The author introduces algorithm
> ana
On 24 Dec 2015 14:55, "boB Stepp" wrote:
>
> My Google-fu is weak on this question. I keep getting lots of hits on
> web scraping, but my interest is actually as follows:
>
> I find myself doing the same boring, repetitive tasks by hand, which
> amounts to copying certain information from one pro
On 11 January 2016 at 12:15, Alan Gauld wrote:
>
> But I think that it definitely is heavily OS dependent.
> It should work in most *nix environments the first time
> you call the function. But on second call I'd expect
> all bets to be off. And in most real-time OS's memory
> goes right back to t
On 11 January 2016 at 15:40, Peter Otten <__pete...@web.de> wrote:
>> I can't even work out how you trigger a MemoryError on Linux (apart
>> from just raising one). I've tried a few ways to make the system run
>> out of memory and it just borks the system rather than raise any error
>> - I can only
On 13 January 2016 at 20:47, Laura Creighton wrote:
>
> Seems like surgery is needed to fix this.
>
> So I wanted you all to know, no, I haven't forgotten you and no haven't
> stopped caring. I have just stopped being as __capable__ if you know
> what I mean.
>
> Please take care of yourselves an
On 18 January 2016 at 04:27, Ben Finney wrote:
>
> The module import system will only recognise a directory as a “package”
> (Python's technical term for “a point in the import hierarchy which
> contains other things to import”) if that directory contains a file
> named ‘__init__.py’. If you do no
On 17 January 2016 at 23:37, boB Stepp wrote:
> 1) Is using pkgutil.get_data() the way I should be reading my data files?
Generally yes, although it may be unnecessary. The main purpose of
pkgutil.get_data is to transparently handle the case where your
packages are imported from a zip file. The
On 21 January 2016 at 04:22, Ek Esawi wrote:
> I have a 2D array (2000, 4);
Do you mean a numpy array? I'm going to assume that you do.
> an example is given abelow. On the 1st column
> I have 15 variables, on the 2nd 4 variables. Ignore column 3 for now. I
> want a code that generate 4 arrays
On 21 January 2016 at 09:19, Ben Finney wrote:
> Albert-Jan Roskam writes:
>
>> Why is an OrderedDict not sliceable?
>
> Because slicing implies index access. The built-in ‘dict’ and
> ‘collections.OrderedDict’ both do not support indexed access::
According to a narrow definition of indexed acce
On 24 January 2016 at 19:47, Albert-Jan Roskam wrote:
>>
>> You appear to be confusing ordered and sorted.
> You are correct. Is there a difference in the way those terms are used
> colloquially vs. in the field of Computer Science (Note: English is not my
> mother tongue)? Anyway, this page
On 24 January 2016 at 20:29, Albert-Jan Roskam wrote:
>> I guess that the authors of OrderedDict just didn't really consider
>> this to be very useful. Apart from having ordered iteration
>> OrderedDict is not really that deeply thought out. There's a thread on
>> python-ideas about the inconsiste
On 24 January 2016 at 17:24, Peter Otten <__pete...@web.de> wrote:
>
> I'm an amateur with numpy, and unfortunately my favourite search engine
> didn't come up with a numpy-specific way to group rows in a 2D array.
What do you mean by "group rows"?
I thought the OP's problem is really to filter r
On 25 January 2016 at 13:14, Peter Otten <__pete...@web.de> wrote:
>> What do you mean by "group rows"?
>
> Given a table you can specify columns as keys and in the simplest case one
> column where you apply an aggregate function over the sets of rows with the
> same key.
>
> If I understand you co
On 26 January 2016 at 03:07, Ek Esawi wrote:
>
> Here is a copy of my code and the csv file.
> ++ csv file++
>
> AA
>
> BB
>
> CC
This doesn't look like a csv file. Is that what the actual contents of
the csv file looks like if you open it in a *text editor*?
If this was a csv file I'd expect
On 26 Jan 2016 19:32, "Ek Esawi" wrote:
>
> Sorry! but it's a csv file. I just copied it directly from an opened csv
> file in excel. And you're correct it looks like what you wrote. EKE
Can you show exactly how it looks? I.e. open it in a text editor and paste
the first say 20 lines here.
--
Os
On 27 January 2016 at 02:00, Ek Esawi wrote:
> Here is the file.
>
> AA,BB,CC,DD,EE
>
> 1,A1,B1,11.2,11/20/2011
>
> 2,A2,B2,2.5,10/21/2011
>
> 3,A3,B3,13.67,9/21/2011
>
> 4,A4,B4,14.2,8/22/2011
>
> 5,A5,B5,20,7/23/2011
That still doesn't look right to me. Is there really a blank line
between each
On 27 January 2016 at 23:00, Ek Esawi wrote:
> Ops..here is the text file.; previously i copied and pasted from either
> Word or Excel.
>
>
> AA,BB,CC,DD,EE
> 1,A1,B1,11.2,11/20/2011
> 2,A2,B2,2.5,10/21/2011
> 3,A3,B3,13.67,9/21/2011
> 4,A4,B4,14.2,8/22/2011
> 5,A5,B5,20,7/23/2011
Finally! That's
On 28 January 2016 at 20:23, Albert-Jan Roskam wrote:
>
> Out of curiosity, I wrote the throw-away script below to find a character
> that is classified (--> LC_CTYPE) as digit in one locale, but not in another.
> I ran it with 5000 locale combinations in Python 2 but did not find any
> (somebod
On 31 January 2016 at 21:41, Albert-Jan Roskam wrote:
>> >
>> >
>> > You're looping over all pairs of locales:
>> >
>> > Suppose there are N locales and M is sys.maxunicode. The number of
>> > pairs of locales is N*(N-1)/2 which grows like N**2. For each pair you
>> > loop over M characters so the
On 31 January 2016 at 05:50, srinivas devaki wrote:
> On Sun, Jan 31, 2016 at 3:54 AM, Danny Yoo wrote:
>> ---
>> I want to take the max value in the dictionary 'coinvalues' that is the
>> same as or lower than the variable 'change'. I have no idea how to search
>> through the 'coinvalues' dict
On 1 February 2016 at 13:29, Steven D'Aprano wrote:
>> > although OP's problem doesn't need this, is there a better way achieve
>> > this other than
>> > using a balanced binary search tree.
>>
>> You would need to state all of the requirements for your data
>> structure. If coinvalues is constant
On 4 February 2016 at 06:45, Matt Williams wrote:
>
> Just as a note - you are not the only person caught out by this - it is a
> very common slip.
>
> I wonder whether it would be worth adding a more explicit line about this
> in the Python Docs?
Where in the docs would you put it and what would
On 4 February 2016 at 03:21, Ben Finney wrote:
> Alex Kleider writes:
>
>> How does a dict fit into this scheme?
>> Is it a sequence?
>
> No, a dict is not a sequence. But it is a container: all its items
> remain available and can be retrieved again and again, and you can
> interrogate whether a
On 16 February 2016 at 02:24, Danny Yoo wrote:
>
> where we pass function objects around to the function that will take a
> long time to finish its work. We expect our callback functions to be
> "called back" later by some party after some point. In many
> asynchronous I/O systems, the responsib
On 26 February 2016 at 16:46, Ek Esawi wrote:
>
> I used genfromtxt to read a file with multiple data types. The result was a
> 1D array of tuples; for example
>
> [(1, 2, 3), (‘a’, b’, ’c’), (‘12/12/2009’, ’2/4/2014’, ‘3/4/200)’]
>
>
>
> I am trying to convert this structured array to a 2D array.
On 13 Mar 2016 23:25, "boB Stepp" wrote:
>
> On Sun, Mar 13, 2016 at 6:06 PM, boB Stepp wrote:
> > On Sun, Mar 13, 2016 at 11:01 AM, Albert-Jan Roskam
> > wrote:
> >>
> >
> >> Thanks! However, if you replace 'broccoli' with a much longer option,
you will
On 16 March 2016 at 13:21, Steven D'Aprano wrote:
> On Wed, Mar 16, 2016 at 08:36:59AM +, Matt Williams wrote:
>> Dear Tutors,
>>
>> I am looking for some advice. I have some data that has three dimensions to
>> it. I would like to store it such that one could manipulate (query/ update/
>> etc
On 29 Mar 2016 21:19, "Bob Gailer" wrote:
>
> On Mar 29, 2016 2:03 PM, "Lisa Hasler Waters"
wrote:
> >
> > I continually get this error:
> >
> >
> > Traceback (most recent call last):
> > File "/Users/lwaters/Desktop/pygameTest.py", line 1, in
> > import pygame, sys
> > File
> >
>
"/Libr
On 29 Mar 2016 22:20, "Alan Gauld" wrote:
>
> PyGin and Albow are other games based frameworks you could
> investigate. And of course there is OpenGL which plays very
> well with MacOSX.
OpenGL plays nicely with Windows and Linux as well. I think that pygame
actually uses pyglet which is an OpenG
On 30 March 2016 at 00:26, Alan Gauld wrote:
> On 29/03/16 22:17, Oscar Benjamin wrote:
>>
>> On 29 Mar 2016 22:20, "Alan Gauld" > <mailto:alan.ga...@btinternet.com>> wrote:
>>
>> > investigate. And of course there is OpenGL which plays very
&
On 14 April 2016 at 20:38, Albert-Jan Roskam wrote:
> Hi,
>
> Lately I have been using the "mutable namedtuple" shown below a lot. I found
> it somewhere on StackOverflow or ActiveState or something.
> In its original form, it only had an __init__ method.
I don't know about your copy/deepcopy s
On 15 April 2016 at 09:55, Albert-Jan Roskam wrote:
>
> Heh, it's my fancy __str__ method that confused me. This is what I get when I
> run my code without __copy__ and __deepcopy__
> runfile('/home/albertjan/Downloads/attrdict_tutor.py',
> wdir='/home/albertjan/Downloads')
> {'x': 1, 'y': 2, 'z
On 15 April 2016 at 10:48, Albert-Jan Roskam wrote:
> What I like about both namedtuple and AttrDict is attribute lookup: that
> makes code so, so, s much easier to read. This seems to be a nice
> generalization of your code:
>
> class Point(object):
>
> def __init__(self, **kwargs):
>
On 28 April 2016 at 02:02, Kanika Murarka wrote:
> Thanks Oliver and Alex, I didnt know about these commands :D
>
> Oliver,
> When i typed
> print filename
> print sys.executable
> print sys.prefix
> print os.path.split(sys.prefix)[-1
On 28 April 2016 at 11:11, Steven D'Aprano wrote:
> On Thu, Apr 28, 2016 at 09:57:19AM +0100, Oscar Benjamin wrote:
>
>> You can write some code to test if a particular path represents the
>> base directory of a virtual environment but I expect it would probably
>> be
On 30 Apr 2016 08:14, "Peter Otten" <__pete...@web.de> wrote:
>
> Peter Otten wrote:
>
> > Anish Kumar wrote:
> >
> >> Right shifting is well defined in Python?
> >
> > Yes. What might surprise someone used to fixed-size integers:
> >
> -1 >> 1
> > -1
> >
> > Any negative int will eventually e
On 10 May 2016 at 04:08, David Wolfe wrote:
> Good Evening;
>
> I'm collecting both video and force plate data, and I need to be able to
> synchronize the two, so I can make some calculations. The video data is at
> 60hz, and the force plate data is at 1000hz. I don't want to truncate the
> forc
On 2 June 2016 at 19:19, Olaoluwa Thomas wrote:
> Thanks, everyone, for your help.
>
> The objective was to extract all words from each line and place them in a
> list IF they didn't already exist in it.
> I sorted it out by adding little bits of everyone's suggestions.
Well done. It looks like y
On 26 Jun 2016 13:39, "Severin Langberg" wrote:
>
> Hello!
>
> I have a problem with solving the 1D diffusion equation for Gaussian
> initial using odeint. Anyone care to help?
Odeint is for ordinary differential equations (ODEs). The diffusion
equation is a partial differential equation (PDE).
On 21 Sep 2016 22:29, "Alan Gauld via Tutor" wrote:
>
> On 21/09/16 15:53, Paul Dentinger wrote:
> > Hello,
> > Sorry for such a basic question, but I am trying to get Numpy to work.
I
> > have python 3.5 and working in IDLE. I need Numpy and Scipy and may
need
> > matplotlib.
>
> To be honest wh
On 22 September 2016 at 04:47, eryk sun wrote:
> On Wed, Sep 21, 2016 at 10:35 PM, Oscar Benjamin
> wrote:
>> I would have given the same advice a year or so ago. It's worth noting
>> though that the situation with pip, wheel etc has improved significantly
>> recen
On 4 October 2016 at 19:11, Alan Gauld via Tutor wrote:
>> """Define a function sum() and a function multiply() that sums and
>> multiplies (respectively) all the numbers in a list of numbers. For
>> example, sum([1, 2, 3, 4]) should return 10, and multiply([1, 2, 3, 4])
>> should return 24."""
>
On 5 November 2012 01:45, Ashley Fowler wrote:
> I'm trying to initialize a list to several elements using the string
> method. I have some idea that you use a for loop I suppose...
>
> Could anybody help me out?
I'm afraid not. Your question is too vague for anyone receiving your
message to kno
On 30 October 2012 01:36, Frank Pontius wrote:
> Hello,
Hi,
It would be good if you could remove unnecessary debug code before
posting since it makes it harder for others to read your actual code.
Also why is there an empty line between each two lines of code? I
think this makes it much harder t
On 2 November 2012 10:40, Sacha Rook wrote:
>
> I have a problem with a csv file from a supplier, so they export data to csv
> however the last column in the record is a description which is marked up
> with html.
>
> trying to automate the processing of this csv to upload elsewhere in a
> useable
On 30 October 2012 06:56, Pete wrote:
> I’m taking this class on python at UCSC. They said this list could help. I
> don’t’ understand OOP and I’m having a hard time understanding the “scope”
> and why the def inside class are not like function –plus I can’t get my
> c-brain around the implicit ty
It's good to give your email a subject line that describes what you're doing.
On 7 November 2012 11:53, steve clarke wrote:
> Hi, I am trying to write a programme to count how many times a random point
> lies within the positive sector of a circle. So far I can display if the
> point lies inside
On 14 November 2012 03:17, David Martins wrote:
> Hi All
>
> I'm trying to use python for analysing data from building energy simulations
> and was wondering whether there is way to do this without using anything sql
> like.
There are many ways to do this.
>
> The simulations are typically run f
On 19 November 2012 11:02, Albert-Jan Roskam wrote:
> Hi,
>
> I have a function that converts a date value, expressed as the number of
> seconds sinds start of the gregorian calendar, into a human-readable format
> (typically an iso-date). So if a record contains x date values, and a data
> set co
On 18 November 2012 14:07, Unaiza Ahsan wrote:
> Hi all,
>
>
> The function histogram is supposed to come from the numpy module; at
>
> least that's the case on my computer (I have numpy 1.6.2 for Python
> 2.7):
>
from numpy import *
>
histogram
>
>
> Maybe something is wrong with Unaiz
On 22 November 2012 12:55, Peter O'Doherty wrote:
> Hi list,
> Firstly, apologies for the low-level nature of this question - it's really
> quite basic but I don't seem to be able to solve it.
>
> I need to write a program that examines 3 variables x, y, z, and prints the
> largest odd number. I'v
On 30 November 2012 09:38, Albert-Jan Roskam wrote:
> I am reading The Hitchhiker's Guide to Packaging 1.0 documentation,
> specifically http://guide.python-distribute.org/creation.html. I am
> struggling to understand the section about Entry Points. This appears to be a
> way to include extra
On 5 December 2012 18:11, C M Caine wrote:
> Dear all,
>
> I've written a class State that subclasses tuple. The class has a method
> move_state that takes a move and returns a new state object representing the
> new state of the game.
>
> I would expect S1 and S3 to be equal on the last line here
If you reply to the digest email you should to do two things:
1) Change the subject line to match the email you are replying to (or
in this case choose a new subject).
2) Delete any part of the message that you are not responding to (in
this case all of it).
In fact why are you replying to the dig
Further to previous comments, It is also preferred to send emails to
this list in plain text rather than html. This is because it protects
the formatting of Python code and works better with all possible
mail-clients/news-readers/archives etc.
On 14 December 2012 15:25, Waters, Mike [ITSCA Non-J&J
On 17 December 2012 08:55, Alan Gauld wrote:
>
> On 17/12/12 04:19, boB Stepp wrote:
>
>> It is apparent that int() does not like strings with floating-point
>> formats. None of my books (as far as my flipping can tell) or the
>> below built-in help clarify this:
>> ...
>>
>> Of course if I type i
On 18 December 2012 13:13, Albert-Jan Roskam wrote:
> I am trying to write a file with a 'foreign' unicode name (I am aware that
> this is a highly western-o-centric way of putting it). In Linux, I can encode
> it to utf-8 and the file name is displayed correctly. In windows xp, the
> character
On 19 December 2012 01:05, Gina wrote:
> I have Python version 3.
> when the program begins, it prints out the main menu and then asks you for
> your choice - just like it is supposed to
> you enter your choice, and the next menu pops up, and below the menu it says
> "None" on the line before your
On 19 December 2012 23:45, Steven D'Aprano wrote:
> On 20/12/12 04:37, rail shafigulin wrote:
>
>> I'm attempting to write a script with command-line arguments. Based on
>> some
>> reading I have done online and some advice from this mailing list I'm
>> going
>> to use docopt and schema modules. T
On 22 December 2012 01:34, Steven D'Aprano wrote:
> On 18/12/12 01:36, Oscar Benjamin wrote:
>
>> I think it's unfortunate that Python's int() function combines two
>> distinct behaviours in this way. In different situations int() is used
>> to:
>> 1)
On 24 December 2012 04:42, eryksun wrote:
> On Sat, Dec 22, 2012 at 12:57 PM, Oscar Benjamin
> wrote:
>>>>
>>>> def make_int(obj):
>>>> '''Coerce str, float and int to int without rounding error
>>>> Accepts stri
On 27 December 2012 17:49, Steven D'Aprano wrote:
> On 23/12/12 04:57, Oscar Benjamin wrote:
>>
>> On 22 December 2012 02:06, Steven D'Aprano wrote:
>>>
>>> On 18/12/12 01:36, Oscar Benjamin wrote:
>>>
>>>> I have often found myself
On 1 January 2013 05:07, Steven D'Aprano wrote:
> On 23/12/12 04:38, Oscar Benjamin wrote:
>>
>> On 22 December 2012 01:34, Steven D'Aprano wrote:
>>>
>>> On 18/12/12 01:36, Oscar Benjamin wrote:
>>>
>>>> I think it's unfortuna
On 2 January 2013 17:59, Alan Gauld wrote:
> On 01/02/2013 11:41 AM, Steven D'Aprano wrote:
>
>[SNIP]
>> But __index__ is a special method that converts to int without rounding
>> or truncating, intended only for types that emulate ints but not other
>> numeric types:
>
>
> And this was the new bi
On 6 January 2013 12:30, DoanVietTrungAtGmail wrote:
> Dear tutors
>
> After much reading and head-scratching, I think the basic idea of decorators
> has now clicked for me. I am a beginner in programming and in Python, but I
> want to eventually develop a serious system. To spend most of my time
On 7 January 2013 00:13, DoanVietTrungAtGmail wrote:
> .. Could you perhaps give a concrete example of a situation where a
> decorator would be useful for checking the inputs to a function? .. Oscar
>
> Say I write a function that expects 5 positional arguments, and up to 4 **
> arguments. Now I w
On 7 January 2013 02:07, Jack Little wrote:
> Here is the code, my error is below the code in itallics
No explanation?
>
> #This is not free source
> #Don't cheat by looking at this
> #If you do you ruin the game
I was a little concerned when I read this part. I guess it's okay for
me to read o
On 16 December 2012 23:09, Dustin Guerri wrote:
> Hi there,
>
> I'm completely new to Python and to programming. I have the Python Launcher
> (v2.7.3) app installed on my system, and I'm running Mac OS X Mountain Lion.
> Does this mean I have Python itself installed ?
OSX ships with a Python ins
On 1 January 2013 15:47, usama zohad wrote:
> my name is usama khan . . i am the student of civil engeering and we got
> assignment to make a project program on flexible pavement design using
> python.i know very litle about programing. still learning from tutorials. u
> can call me a beginner.now
On 9 January 2013 01:15, Oscar Benjamin wrote:
> On 1 January 2013 15:47, usama zohad wrote:
>> my name is usama khan . . i am the student of civil engeering and we got
>> assignment to make a project program on flexible pavement design using
>> python.i know very litle ab
On 7 January 2013 23:31, Dylan Kaufman wrote:
> Greetings,
>
> I take Computer Science in school and for a Python program, I have:
>
> from winsound import Beep
>
[SNIP]
>
> When I run it at school it works great, but at home when I try to run it, it
> says:
>
> Traceback (most recent call last):
On 9 January 2013 01:07, Alan Gauld wrote:
> On 05/01/13 01:27, Nathaniel Huston wrote:
>
>> def deal(quantity):
>>
>> hand = []
>> for cards in range(0, quantity):
>> hand.append(deck.pop())
>> return hand
>
>
>> #we find that the global deck has been modified within the d
On 9 January 2013 11:20, Timo wrote:
> I'm having trouble finding a safe way to parse and evaluate user input in my
> program.
>
> In my app, I'm using a calculation like this:
> (a / b) * 100
> The user should be able to override this and their preference is stored in a
> configuration file for
Please post in plain text on this mailing list (not html).
On 9 January 2013 09:38, somnath chakrabarti
wrote:
>
> I have mingw and python 2.7 in a Windows 7 box and trying to install
> PyGraphViz-1.1 using the following CLI utility
>
> python setup.py install build --compiler=mingw32
>
> Howeve
On 15 January 2013 23:12, Rohit Mediratta wrote:
> Hi,
>I am using Centos 6.3 and python 2.6.6.
>
> When I try to assign a variables value inside a multiple line message, it
> does not work.
>
cardName = "ActualCardName"
data = """
> """
print data
>
>
>
>
> I
On 15 January 2013 23:40, Scurvy Scott wrote:
[SNIP]
>
> Anyways, the problem I'm having is I'm not really sure how to search a list
> for multiple elements and remove just those elements. Below is my code so
> far, and information y'all could provide would be appreciated. Thanks.
Perhaps you'd l
On 15 January 2013 23:53, Scurvy Scott wrote:
>> > Anyways, the problem I'm having is I'm not really sure how to search a list
>> > for multiple elements and remove just those elements. Below is my code so
>> > far, and information y'all could provide would be appreciated. Thanks.
>>
[SNIP]
>
> Wh
On 16 January 2013 21:54, Abhishek Pratap wrote:
> Hi Guys
>
> With the help of an awesome python community I have been able to pick up the
> language and now willing to explore other cool extensions of it.
Good work!
>
> I routinely have large loops which could be ported to cython for speed.
>
On 16 January 2013 21:22, 3n2 Solutions <3n2soluti...@gmail.com> wrote:
> Say I have a text file (example below) that has multiple records with
> the same format but not always the same number of lines. Each record
> is separated by the line that starts with “Examining file” as in below
> example.
On 17 January 2013 11:52, Albert-Jan Roskam wrote:
>
> I recently used Cython for the first time and I found it surprisingly easy.
> The installation under Linux
> is easy, but seems to be not really trivial under Windows (I never tried
> installing it under windows though; I'd first try one of
On 19 January 2013 15:47, Jose Amoreira wrote:
> Thanks for the explanation, Alan
>
>> Is there a good reason to want to do such a thing?
>
> There is a reason, but maybe you won't consider it a good one...
>
> I was writing a small program to simulate the gravitational dynamics of a
> system of m
On 24 January 2013 20:14, Matthew Ngaha wrote:
>>
> thanks Dave. the file was py.exe as you said and the temporary path is
> able to open both version 2 and 3's python.exe. There seems to be a
> problem. python 2 seems to be the only version opening my files unless
> i do a few things. So with th
On 27 January 2013 18:21, Alan Gauld wrote:
> On 18/01/13 18:11, Roger wrote:
>
>> At the moment this works to search for everything beginning with A
>> sql = "SELECT * FROM plants WHERE genus LIKE 'A%'";
>> cursor.execute(sql);
>
>
> SQLlite supports a form of format string where you put in some
Please post in plain text (not html) as otherwise the code gets
screwed up. When I paste your code into a terminal this is what
happens:
>>> junk_list = 'tmsh list net interface 1.3 media-ca \rpabilities\r\nnet
>>> interface 1.3 {\r\nmedia-capabilities {\r\nnone\r\n
>>> auto\r
On 29 January 2013 03:35, DoanVietTrungAtGmail wrote:
> As a student user of this list, I prefer leaving the Reply-To field
> unchanged. I like the fact that this means a deliberate decision is
> required to send public emails.
If you don't mind my asking, do you send many off-list messages as
r
On 4 February 2013 06:24, Gayathri S wrote:
> Hi All!
> If i have data set like this means...
>
> 3626,5000,2918,5000,2353,2334,2642,1730,1687,1695,1717,1744,593,502,493,504,449,431,444,444,429,10
> 438,498,3626,3629,5000,2918,5000,2640,2334,2639,1696,1687,1695,1717,1744,592,502,49
On 5 February 2013 03:56, eryksun wrote:
> On Mon, Feb 4, 2013 at 7:04 PM, Dave Angel wrote:
>>> Nope, in both Python 2 and 3 iterating over a dict directly just
>>> provides the key. That's also how "if key in dict" works.
>
> A dict implements __contains__ for an efficient "in" test. In general
On 5 February 2013 05:08, eryksun wrote:
> On Mon, Feb 4, 2013 at 7:21 PM, Oscar Benjamin
> wrote:
>> eigenvalues, eigenvectors = np.linalg.eig(C)
>
> First sort by eigenvalue magnitude:
>
> >>> idx = np.argsort(eigenvalues)[::-1]
> >>> prin
On 10 February 2013 14:32, Walter Prins wrote:
[snip
>
> This worked mostly fine, however yesterday I ran into a slightly unexpected
> problem when I found that when the list contents is iterated over and values
> retrieved that way rather than via [], then __getitem__ is in fact *not*
> called on
On 13 February 2013 13:45, Mahadevan, Anand wrote:
> I'm playing around with list comprehension and in IDLE typed this in. I
> actually wanted it to return all tuples satisfying the condition where z is
> the sum of x and y. I kind of got mixed up with the syntax, hence I put a
> comma in ther
On 14 February 2013 12:57, Eva Bofias wrote:
> Helo,
Hi,
> I need to do a substitution in a regular expression that depends on a
> variable. To simplify I want to be able to do this substitution:
>
> text2='XX. AA YY. DD'
> re.sub(ur"\. (AA|BB|ÇÇ","(.) \g<1>",text2)
There is a missing bracket i
On 17 February 2013 15:57, Alan Gauld wrote:
> On 17/02/13 09:14, Brajesh pant wrote:
>>
>> Actually i want to build a utility such that a when a file or folder
>
>> is copied i want to automatically run my python script ..
>>
>
> And this is a far different thing because you specifically want to
On 18 February 2013 07:36, Michael O'Leary wrote:
> I wrote some code to create tasks to be run in a queue based system last
> week. It consisted of a big monolithic function that consisted of two parts:
> 1) read data from a file and create dictionaries and lists to iterate
> through
> 2) iterate
101 - 200 of 366 matches
Mail list logo