Re: Filtering out non-readable characters

2005-07-19 Thread Ross
On 15 Jul 2005 17:33:39 -0700, "MKoool" <[EMAIL PROTECTED]> wrote: >I have a file with binary and ascii characters in it. I massage the >data and convert it to a more readable format, however it still comes >up with some binary characters mixed in. I'd like to write something >to just replace al

Cross-Platform Bonjour Module

2006-02-22 Thread Ross
Can anybody point me to a Python module for using the mDNSResponder stuff (http://developer.apple.com/networking/bonjour)? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

What language to manipulate text files

2005-06-11 Thread ross
s to learn the best language for this sort of text manipulation. The language should run on Windows 98, XP and Linux. Would Python be best, or would a macro-scripting thing like AutoHotKey work? I thought about Perl, but think I would learn bad habits and have hard to read code. Thanks, Ross -- http://mail.python.org/mailman/listinfo/python-list

Re: What language to manipulate text files

2005-06-12 Thread ross
> > R What usenet group is it best to ask in then? Is there one where people have good knowledge of many scripting languages? Ross -- http://mail.python.org/mailman/listinfo/python-list

Re: What language to manipulate text files

2005-06-17 Thread ross
I tried Bash on Cygwin, but did not know enough about setting up the environment to get it working. Instead I got an excellent answer from alt.msdos.batch which used the FOR IN DO command. My next job is to learn Python. Ross -- http://mail.python.org/mailman/listinfo/python-list

Managing timing in Python calls

2008-12-15 Thread Ross
t would be my first guess? Can anyone give me some feedback on whether that's a logical path forward, or if there are some nicer constructs into which I might look? Thanks for any suggests... Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: Managing timing in Python calls

2008-12-15 Thread Ross
he opinion on loading images - gives me some guts to just give it a try without threading it and see how it goes. I appreciate the quick input :) Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: Managing timing in Python calls

2008-12-17 Thread Ross
mainline (UI) thread. So I'm able to proceed. I do want to know more about the 'with' command tho' so I'll look into that. Thx again. Ross. cmdrrickhun...@yaho.com wrote: I believe WxTimerEvent is handled using the event queue, which isn't going to do w

Custom C Exception Subclasses

2008-12-24 Thread Ross
For a project that I am doing, it would be useful to have an exception class that stores some additional data along with the message. However, I want to be able to store a couple pointers to C++ classes, so I can't just use an exception created with PyExc_NewException. If I were to subclass the bu

Re: Custom C Exception Subclasses

2008-12-24 Thread Ross
On Dec 24, 9:24 am, "Gabriel Genellina" wrote: > In fact you can, you could store those pointers as attributes of the > exception object, using a PyCObject. Excellent. I was not aware of the PyCObject type. > Accessing those attributes isn't as easy as doing exc->field, but I think > it's easy

get method

2008-12-29 Thread Ross
I am teaching myself Python by going through Allen Downing's "Think Python." I have come across what should be a simple exercise, but I am not getting the correct answer. Here's the exercise: Given: def histogram(s): d = dict() for c in s: if c not in d: d[c] = 1

Re: get method

2008-12-29 Thread Ross
On Dec 29, 8:07 pm, Scott David Daniels wrote: > Ross wrote: > > ... Use get to write histogram more concisely. You should be able to > > eliminate the if statement. > > > def histogram(s): > >    d = dict() > >    for c in s: > >            d[c]=

formatted 'time' data in calculations

2009-01-07 Thread Ross
s for anything you can offer) -Ross -- http://mail.python.org/mailman/listinfo/python-list

Re: formatted 'time' data in calculations

2009-01-07 Thread Ross
Thanks Chris and Diez for the quick pointers... Very helpful Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: formatted 'time' data in calculations

2009-01-08 Thread Ross
Scott David Daniels wrote: Ross wrote: There seems to be no shortage of information around on how to use the time module, for example to use time.ctime() and push it into strftime and get something nice out the other side, but I haven't found anything helpful in going the other way. As

Re: formatted 'time' data in calculations

2009-01-08 Thread Ross
Thanks Chris and Diez for the quick pointers... Very helpful Ross. -- http://mail.python.org/mailman/listinfo/python-list

league problem in python

2009-04-01 Thread Ross
I'm new to programming and have chosen Python as my first language. I've gone through Allen Downey's Think Python book and I think I'm ready to dive into a project. The first problem I've chosen to tackle is a problem I have seen at my tennis club. Each spring/fall, the pro puts out a sheet of pape

possible pairings in a set

2009-04-04 Thread Ross
I'm new to python and I'm trying to come up with a function that takes a given number of players in a game and returns all possible unique pairings. Here's the code I've come up with so far, but I'm not getting the output I'd like to: def all_pairings(players): cleanlist = [] for i

sharing/swapping items between lists

2009-04-10 Thread Ross
I'm trying to design an iterator that produces two lists. The first list will be a list of unique pairings and the second will be a list of items that weren't used in the first list. After each round, the items that weren't used in the round before will get put back in and the second list will be p

Re: sharing/swapping items between lists

2009-04-13 Thread Ross
On Apr 11, 1:10 pm, a...@pythoncraft.com (Aahz) wrote: > In article > <4fd78ac3-ba83-456b-b768-3a0043548...@f19g2000vbf.googlegroups.com>, > > Ross   wrote: > > >I'm trying to design an iterator that produces two lists. The first > >list will be a list of un

Re: sharing/swapping items between lists

2009-04-13 Thread Ross
On Apr 13, 9:08 am, a...@pythoncraft.com (Aahz) wrote: > In article , > > Ross   wrote: > > >I'm sorry...my example was probably a bad one. A better example of > >output I would like would be something like [[1,2],[3,4],[5,6]] and > >then for the leftovers list

Re: sharing/swapping items between lists

2009-04-14 Thread Ross
On Apr 14, 5:57 am, a...@pythoncraft.com (Aahz) wrote: > In article , > > > > Ross   wrote: > >On Apr 13, 9:08=A0am, a...@pythoncraft.com (Aahz) wrote: > >> In article >com>, > >> Ross =A0 wrote: > > >>>I'm sorry...my example was

Re: sharing/swapping items between lists

2009-04-14 Thread Ross
On Apr 14, 10:34 am, Ross wrote: > On Apr 14, 5:57 am, a...@pythoncraft.com (Aahz) wrote: > > > > > In article > > , > > > Ross   wrote: > > >On Apr 13, 9:08=A0am, a...@pythoncraft.com (Aahz) wrote: > > >> In article > > >> &

Re: sharing/swapping items between lists

2009-04-14 Thread Ross
On Apr 14, 7:18 pm, Aaron Brady wrote: > On Apr 14, 7:01 pm, Aaron Brady wrote: > > > > > On Apr 14, 12:37 pm, Ross wrote: > > > > On Apr 14, 10:34 am, Ross wrote: > > > > > On Apr 14, 5:57 am, a...@pythoncraft.com (Aahz) wrote: > > >

Removing items from a list simultaneously

2009-04-20 Thread Ross
Is there a quick way to simultaneously pop multiple items from a list? For instance if i had the list a = [1,2,3,4,5,6,7] and I wanted to return every odd index into a new list, my output would be new_list = [2,4,6] or similarly if I wanted to return each index that was one away from the midpoint i

complementary lists?

2009-04-28 Thread Ross
If I have a list x = [1,2,3,4,5,6,7,8,9] and another list that is a subset of x: y = [1,4,7] , is there a quick way that I could return the complementary subset to y z=[2,3,5,6,8,9] ? The reason I ask is because I have a generator function that generates a list of tuples and I would like to d

list comprehension question

2009-04-30 Thread Ross
If I have a list of tuples a = [(1,2), (3,4), (5,6)], and I want to return a new list of each individual element in these tuples, I can do it with a nested for loop but when I try to do it using the list comprehension b = [j for j in i for i in a], my output is b = [5,5,5,6,6,6] instead of the corr

yet another list comprehension question

2009-05-02 Thread Ross
I'm trying to set up a simple filter using a list comprehension. If I have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)] and I wanted to filter out all tuples containing None, I would like to get the new list b = [(1,2), (3,4),(6,7)]. I tried b = [i for i in a if t for t in i is

Re: yet another list comprehension question

2009-05-02 Thread Ross
On May 2, 7:21 pm, Chris Rebert wrote: > On Sat, May 2, 2009 at 7:13 PM, Ross wrote: > > I'm trying to set up a simple filter using a list comprehension. If I > > have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)] > > and I wanted to filter out all

Code works fine except...

2009-05-03 Thread Ross
For the past couple weeks, I've been working on an algorithm to schedule tennis leagues given court constraints and league considerations (i.e. whether it's a singles or a doubles league). Here were my requirements when I was designing this algorithm: -Each player plays against a unique opponent e

Re: Code works fine except...

2009-05-04 Thread Ross
On May 3, 10:16 pm, John Yeung wrote: > On May 3, 11:29 pm, Chris Rebert wrote: > > > Probably not the cause of the problem, but where > > did the magic numbers 1.072 and 1.08 come from? > > It is perhaps not the most direct cause of the problem, in the sense > that the magic numbers could take v

Re: Code works fine except...

2009-05-04 Thread Ross
On May 4, 7:01 am, Ross wrote: > On May 3, 10:16 pm, John Yeung wrote: > > > > > On May 3, 11:29 pm, Chris Rebert wrote: > > > > Probably not the cause of the problem, but where > > > did the magic numbers 1.072 and 1.08 come from? > > > It is

Re: Code works fine except...

2009-05-04 Thread Ross
On May 3, 8:29 pm, John Machin wrote: > On May 4, 12:36 pm, Ross wrote: > > > > > For the past couple weeks, I've been working on an algorithm to > > schedule tennis leagues given court constraints and league > > considerations (i.e. whether it's a single

Re: Code works fine except...

2009-05-04 Thread Ross
On May 4, 12:15 pm, a...@pythoncraft.com (Aahz) wrote: > In article <8d4ec1df-dddb-469a-99a1-695152db7...@n4g2000vba.googlegroups.com>, > > Ross   wrote: > > >def test_round_robin(players, rounds, courts, doubles = False): > >    players = range(players) > >

Re: Code works fine except...

2009-05-04 Thread Ross
On May 4, 7:59 pm, John Yeung wrote: > On May 4, 10:01 am, Ross wrote: > > > The "magic numbers" that everyone is wondering about are > > indeed used for spreading out the bye selection and I got > > them by simply calculating a line of best fit when plotti

Re: Code works fine except...

2009-05-04 Thread Ross
On May 4, 7:33 pm, John Yeung wrote: > On May 4, 8:56 pm, Ross wrote: > > > Anyways, you're right that seq[0] is always evaluated. > > That's why my algorithm works fine when there are odd > > numbers of players in a league. > > It doesn't work fine

Re: Code works fine except...

2009-05-05 Thread Ross
On May 5, 12:32 am, John Yeung wrote: > On May 5, 1:12 am, John Yeung wrote: > > > [...] the problem may require bigger guns (either much better > > math or much more sophisticated programming). > > Yes, I'm responding to myself. > > Well, I went ahead with the approach I mentioned earlier, gener

Re: Code works fine except...

2009-05-05 Thread Ross
On May 5, 1:33 pm, MRAB wrote: > Ross wrote: > > On May 5, 12:32 am, John Yeung wrote: > >> On May 5, 1:12 am, John Yeung wrote: > > >>> [...] the problem may require bigger guns (either much better > >>> math or much more sophisticated pro

Re: Code works fine except...

2009-05-05 Thread Ross
On May 5, 10:33 am, MRAB wrote: > Ross wrote: > > On May 5, 12:32 am, John Yeung wrote: > >> On May 5, 1:12 am, John Yeung wrote: > > >>> [...] the problem may require bigger guns (either much better > >>> math or much more sophisticated pro

Re: Code works fine except...

2009-05-06 Thread Ross
On May 6, 3:14 pm, John Yeung wrote: > On May 6, 3:29 am, MRAB wrote: > > > I have the feeling that if the number of rounds is restricted then the > > difference between the minimum and maximum number of byes could be 2 > > because of the requirement that players shouldn't play each other more >

Re: Code works fine except...

2009-05-06 Thread Ross
On May 6, 3:14 pm, John Yeung wrote: > On May 6, 3:29 am, MRAB wrote: > > > I have the feeling that if the number of rounds is restricted then the > > difference between the minimum and maximum number of byes could be 2 > > because of the requirement that players shouldn't play each other more >

Re: Code works fine except...

2009-05-06 Thread Ross
On May 6, 3:14 pm, John Yeung wrote: > On May 6, 3:29 am, MRAB wrote: > > > I have the feeling that if the number of rounds is restricted then the > > difference between the minimum and maximum number of byes could be 2 > > because of the requirement that players shouldn't play each other more >

Re: Code works fine except...

2009-05-07 Thread Ross
On May 7, 1:11 am, John Yeung wrote: > On May 7, 12:30 am, Ross wrote: > > > > > If I were to set up a dictionary that counted players used in the bye > > list and only allowed players to be added to the bye list if they were > > within 2 of the least used player,

slice iterator?

2009-05-08 Thread Ross
I have a really long list that I would like segmented into smaller lists. Let's say I had a list a = [1,2,3,4,5,6,7,8,9,10,11,12] and I wanted to split it into groups of 2 or groups of 3 or 4, etc. Is there a way to do this without explicitly defining new lists? If the above problem were to be spli

indirectly addressing vars in Python

2008-10-01 Thread Ross
append(oats) >>> myList [1] >>> myList.append(peas) >>> myList [1, 6] >>> myList[1]= myList[1]+1 >>> myList [1, 7] >>> peas 6 >>> So I don't seem to change the value of peas as I wished. I'm passing the values of the vars into t

My Python / wxPython app crashing - suggestions?

2009-11-27 Thread Ross
down the conditions that precipitate it. Regards, Ross. -- http://mail.python.org/mailman/listinfo/python-list

unicode compare errors

2010-12-10 Thread Ross
show up okay in my post here) Since I can't control the encoding of the input file that users submit, how to I get past this? How do I make such comparisons be True? Thanks in advance for any suggestions Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode compare errors

2010-12-10 Thread Ross
On Dec 10, 2:51 pm, Ross wrote: > Initially I was simply doing: > >   currs = [u'$', u'£', u'€', u'¥'] >   aFile = open(thisFile, 'r') >   for mline in aFile:              # mline might be "£5.50" >      if item[0]

Re: unicode compare errors

2010-12-13 Thread Ross
On Dec 10, 4:09 pm, Nobody wrote: > On Fri, 10 Dec 2010 11:51:44 -0800, Ross wrote: > > Since I can't control the encoding of the input file that users > > submit, how to I get past this?  How do I make such comparisons be > > True? > On Fri, 10 Dec 2010 12:07:19 -08

Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread Ross
atetime.time() but SURELY someone else is already doing that? My googling has fallen flat. Any suggestions. Thanks in advance! -Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: Plain simple unix timestamp with an HTTP GET

2010-06-03 Thread Ross
No - it's not really a python specific need, it's just what I'm using just now, and can't think of where else to ask. It's also my fav test- bed, as it's so easy. Your curl example is using grep and date which I don't have available. I have no fancy libraries, just core parsing capability. I foun

Re: Plain simple unix timestamp with an HTTP GET

2010-06-04 Thread Ross
On Jun 3, 11:20 pm, livibetter wrote: > This? > > hwclock --utc --set --date="$(datestr="$(curlhttp://208.66.175.36:13/ > 2>/dev/null | cut -d \  -f 2-3)" ; echo ${datestr//-//})" > > Only hwclock, curl, cut, and Bash. > > PS. I didn't know I can set the time via hwclock, learned from Paul's > pos

unpacking vars from list of tuples

2009-09-15 Thread Ross
middle element out of each tuple to make a new list: myList = ["bob", "joe", "mary"] is there some compact way to do that? I can imagine the obvious one of myList = [] for a in k: myList.append(a[1]) But I'm guessing Python has something that will do that in one line... Any suggestion is appreciated... Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: unpacking vars from list of tuples

2009-09-15 Thread Ross
On Sep 15, 6:00 pm, Andre Engels wrote: > On Tue, Sep 15, 2009 at 11:51 PM, Ross wrote: > > I'm inexperienced with some of the fancy list slicing syntaxes where > > python shines. > > > If I have a list of tuples: > > >   k=[("a", "bob"

Re: unpacking vars from list of tuples

2009-09-15 Thread Ross
Thanks Tim, That's actually the stuff I was trying to remember. my_list = [name for _, name, _ in k] I recalled using some underscores for nice dense unnamed variable unpacking before, but couldn't recall the process. Thanks for that. Ross. On 15-Sep-09, at 6:33 PM, Tim C

Re: unpacking vars from list of tuples

2009-09-17 Thread Ross
Cool - Now that would be some seriously dense, efficient code! Will have to play with numpy sometime. R. On 17-Sep-09, at 12:25 PM, Chris Colbert wrote: if you have numpy installed: ln[12]: import numpy as np In [13]: k = np.array([('a', 'bob', 'c'), ('p', 'joe', 'd'), ('x', 'mary',

Not this one the other one, from a dictionary

2009-09-18 Thread Ross
alu = aDict[BigOne] temp = [ thing for thing in aDict if thing != BigOne ] LittleValu = aDict[ temp[0] ] Any thoughts? - Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: Not this one the other one, from a dictionary

2009-09-18 Thread Ross
Thanks Tim (and Ishwor) for the suggestions, those are structures that somewhat new to me - looks good! I'll play with those.At this rate I may soon almost know what I'm doing. Rgds Ross. On 18-Sep-09, at 1:19 PM, Tim Chase wrote: Learning my way around list comprehension

virtualenv doesn't see my compiled tensorflow

2017-09-01 Thread ross
With the prebuilt version of tensorflow, I did: virtualenv --system-site-packages ~/tensorflow and somehow got it working with keras. Now I've compiled tensorflow in another shell/directory, where to start with I did: virtualenv --system-site-packages . and I got it running with keras

Re: virtualenv doesn't see my compiled tensorflow

2017-09-01 Thread ross
Solution: remember to run the 'activate' script: % source ~/tf_compile/tensorflow/bin/activate On Friday, September 1, 2017 at 2:39:33 PM UTC-7, ro...@cgl.ucsf.edu wrote: > With the prebuilt version of tensorflow, I did: > >virtualenv --system-site-packages ~/tensorflow > > and someho

Re: when "normal" parallel computations in CPython will be implemented at last?

2012-07-01 Thread Ross Ridge
Thomas Jollans wrote: >There is, of course, Stackless Python. >http://stackless.com/ Stackless Python doesn't really address the original poster's problem as the GIL still effectively limits Python code running in one thread at a time. Ro

Re: 2 + 2 = 5

2012-07-04 Thread Michael Ross
Am 04.07.2012, 21:37 Uhr, schrieb Paul Rubin : I just came across this (https://gist.github.com/1208215): import sys import ctypes pyint_p = ctypes.POINTER(ctypes.c_byte*sys.getsizeof(5)) five = ctypes.cast(id(5), pyint_p) print(2 + 2 == 5) # False five.contents[five.con

Re: How to safely maintain a status file

2012-07-12 Thread Ross Ridge
antics, an assumption that Laszlo Nagy did not make. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: the meaning of rユ.......��

2012-07-23 Thread Ross Ridge
as the ASR-33. If any one actually wanted another programming language like this it would've come into existance 20 or 30 years ago not 20 or 30 years from now. Python actually choose to go the other direction and choose to use keywords as operators instead of symbols in a number of in

Re: the meaning of rユ.......ï¾

2012-07-23 Thread Ross Ridge
II characters outside of strings and comments even when the language (supposedly) allows it. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http:/

Re: from future import pass_function

2012-07-25 Thread Ross Ridge
er everything you've said about why its a good thing the that print statement is now a function? That. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db //

Re: from future import pass_function

2012-07-25 Thread Ross Ridge
Steven D'Aprano wrote: >What's the point of this? Ross Ridge wrote: > Remember everything you've said about why its a good thing the that > print statement is now a function? That. Steven D'Aprano wrote: >I can't believe I actually have to point this ou

Re: from future import pass_function

2012-07-25 Thread Ross Ridge
Ross Ridge wrote: > No, they're very much alike. That's why all your arguments for print > as function also apply just as well to pass a function. Your arguments > had very little to do what what print actually did. Chris Angelico wrote: >Except that print / print() is

Re: Redirecting STDOUT to a Python Variable

2012-09-22 Thread ross . marsden
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 ''.join(traceback.format_exception(exc_type, exc_value, exc_traceback)) Suppose I have a scrip

Re: How to investigate web script not running?

2012-09-28 Thread Michael Ross
On Fri, 28 Sep 2012 13:37:36 +0200, Gilles wrote: Hello I'm trying to run my very first FastCGI script on an Apache shared host that relies on mod_fcgid: == #!/usr/bin/python from fcgi import WSGIServer import cgitb # enable debugging cgitb.enable() def myapp(environ, start_respo

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Ross Ridge
newest versions I have handy). CPython optimized this case of string concatenation into O(n) back in Python 2.4. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Tarfile and usernames

2012-12-30 Thread Michael Ross
On Sun, 30 Dec 2012 19:57:31 +0100, Nicholas Cole wrote:Dear List,I'm hoping to use the tarfile module in the standard library to move some files between computers. I can't see documented anywhere what this library does with userids and groupids.  I can't guarantee that the computers involved wil

Re: Question on for loop

2013-01-03 Thread Don Ross
I'm interested to know why you're trying this as well. Is this something that would be helped by creating a class and then dynamically creating instances of that class? Something like... class Fruit: def __init__(self, name): self.name = name for fruit in ['banana', 'apple', 'mang

unittest and threading

2012-01-24 Thread Ross Boylan
find anything definitive. If it matters, I'm using CPython 2.7. Thanks. If you're using email, I'd appreciate a cc. Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest and threading

2012-01-25 Thread Ross Boylan
On Tue, 2012-01-24 at 13:54 -0800, Ross Boylan wrote: > Is it safe to use unittest with threads? > > In particular, if a unit test fails in some thread other than the one > that launched the test, will that information be captured properly? > > A search of the net shows a s

Condition.wait() behavior with timeout

2012-01-30 Thread Ross Boylan
rs waiting on the condition, not one with notify() and a single thread waiting (which is what I'm thinking about). The thread does say there is no return value; it seems to me it would be useful to document that if it's still true (or True :). Can anyone help me understand w

Re: XSLT to Python script conversion?

2012-02-17 Thread Ross Ridge
h puts it way beyond bad. >The terrible debugging is one thing, and even worse, I just still cannot >get over rules around spaces: whitespace just jumps at me randomly in >random places and is erased in others. I use explicit nodes exclusively to avoid this problem.

Re: XSLT to Python script conversion?

2012-02-17 Thread Ross Ridge
Ross Ridge writes: > The XSLT language is one of the worst misuses of XML, which puts it way > beyond bad. Stefan Behnel wrote: >Clearly a matter of opinion. No. There's no excuse for using XML as the syntax of a language like XLST. Ross

#line in python

2012-02-18 Thread Ross Boylan
s and methods that could do the conversion on the fly? I don't know if there's a way to go from the function (or class) object the decorator receives to the AST. Comments? Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list

Re: #line in python (dirty tricks)

2012-02-20 Thread Ross Boylan
Duncan Booth wrote > Ross Boylan wrote: > > > As an extension or alternate, could there be a decorator like > > @source_line(lineno, filename) > > for classes and methods that could do the c

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
x27;s your problem here than then that's what you should be addressing, not pretending that it's fundamentally impossible. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
Ross Ridge wr= > Of course it is. =A0Conceptually you're not supposed to think of it that > way, but a string is stored in memory as a series of bytes. Chris Angelico wrote: >Note that distinction. I said that a string "is not" a series of >bytes; you say that it

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
d like Chris Angelico that there's isn't a direct mapping from the his Python 3 implementation's internal respresentation of strings to bytes in order to label what he's asking for as being "silly". Ross Ridge --

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
at that the internal representation of strings wasn't what he expected to be. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
esn't mean I can never say anything about it. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
s another thing entirely. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Ross Ridge
bility), but in a high >level language, you cannot assume any correlation between objects and >bytes. Any code that depends on implementation details is risky. How does that in anyway justify Evan Driscoll maliciously lying about code he's never seen?

Re: "convert" string to bytes without changing data (encoding)

2012-03-29 Thread Ross Ridge
e advocated writing any style of code in thread. Just because I refuse to drink the "it's impossible to represent strings as a series of bytes" kool-aid does't mean that I'm a heretic that must oppose against everything you believe in.

Re: "convert" string to bytes without changing data (encoding)

2012-03-29 Thread Ross Ridge
Ross Ridge wrote: > Just because I refuse to drink the > "it's impossible to represent strings as a series of bytes" kool-aid Terry Reedy wrote: >I do not believe *anyone* has made that claim. Is this meant to be a >wild exaggeration? As wild as Evan's? Sorry

Re: Newbie questions on import & cmd line run

2012-05-17 Thread Ross Ridge
ell what interpreter to use to execute the program if >you run it directly. They're actually interpreted by the kernel so that they'll work when run from any program. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] r

Re: Smallest/cheapest possible Python platform?

2012-05-26 Thread Ross Ridge
erally available or increase your budget. You should also consider whether any of these devices have Python bindings to interface with their GPIO pins. If not you'll probably have to end up writing some C code anyways. Ross Ridge -- l/ // Ro

Re: English version for M�mento Python 3 (draft, readers needed)

2012-06-06 Thread Alec Ross
er side" in french - from latin). FWIW, English idiomatic usage includes "see overleaf", and "see over", for the obverse side of a page/sheet, i.e, the following page; and "see facing page", w/ the obvious meaning. Alec -- Alec Ross -- http://mail.python.org/mailman/listinfo/python-list

Re: can I distribute Microsoft.VC90.CRT files?

2011-07-19 Thread Ross Ridge
hope that helps. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db // -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents (was: Python benefits over Cobra)

2011-04-07 Thread Ross Ridge
sn't meet the legal definition of a contract, it can be revoked unilateraly (but not retroactively) by the copyright holder at any time for any reason. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http:/

Re: Mutable defaults

2021-02-10 Thread Ross Wilson
On Thu, 11 Feb 2564 BE at 12:52 Grant Edwards wrote: > On 2021-02-11, J. Pic wrote: > > > I just meant removing the whole "default value mutating" story, not > > removing mutable variables. Really, I was wondering if there was a use > case > > where this actually turns to an advantage, > > I've

Re: Call for Assistance

2016-08-09 Thread Charles Ross
> CC-BY-NC-SA is not a license for free (as in speech) content. Is that > what you want? I really appreciate all the conversation about the license. Perhaps I made a mistake with requiring noncommercial in the license, I don’t know, but I’ll look at the links provided about free documentation an

Re: Call for Assistance

2016-08-09 Thread Charles Ross
Well, I’ve been convinced. The license for the book is now Creative Commons Attribution-ShareAlike. https://github.com/chivalry/meta-python/blob/master/LICENSE.md Thanks, Chuck > On Aug 9, 2016, at 3:00 PM, Charles Ross wrote: > >> CC-BY-NC-SA is not a license for free (as in spe

Meta Python Chapter 3 Available

2016-08-12 Thread Charles Ross
I’ve completed a first draft of Chapter 3: Modules (and Packages) of the Meta Python book. Feedback from novices and experts alike would be welcome. https://github.com/chivalry/meta-python Thanks, Chuck -- https://mail.python.org/mailman/listinfo/pytho

How to get Read the Docs to generate py-modindex.html?

2016-08-29 Thread Charles Ross
Since I appear to be experiencing one of the few times that Stack Overflow hasn’t provided any quick answers to a problem (http://stackoverflow.com/questions/39197037/how-to-get-read-the-docs-to-generate-py-modindex-html

how to control formatting of a namedtuple in a list

2016-11-17 Thread Boylan, Ross
(self, spec): return self.__str__() f=Foo(4) print(f) print(str(f)) print("{}".format(f)) print("{}".format([f])) # a list with one f Output foolish(4) foolish(4) foolish(4) [Foo(x=4)] I'm running Python 3.4. Thanks. Ross -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   >