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: Wind Rose Plotting in Python

2019-09-05 Thread Ross Wilson
matplotlib at https://github.com/python-windrose/windrose . The matplotlib page of third-party libraries is at https://matplotlib.org/3.1.1/thirdpartypackages/index.html#windrose . Ross -- https://mail.python.org/mailman/listinfo/python-list

Re: How to start gnuradio

2018-07-31 Thread Ross Wilson
I had a paddle through the manual at https://www.gnuradio.org/doc/doxygen/page_python_blocks.html and apparently some DSP operations use numpy. Ross On Wed, 1 Aug 2018 at 11:56 wrote: > > > After some research I found out that "sudo apt-get install python-numpy" > solve

Re: Meaning of abbreviated terms

2018-05-12 Thread Ross Wilson
ts" [1] which were a key/value data structure, usually called an "alist" or "a-list". Ross [0] https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node108.html [1] https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node153.html On 12/5/2561 BE 13:45, Bob Martin wrote: in 793617

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

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

error in syntax description for comprehensions?

2017-03-30 Thread Boylan, Ross
ot sure what or_test would do there either with or without an additional element following "in". Ross Boylan -- https://mail.python.org/mailman/listinfo/python-list

RE: how to control formatting of a namedtuple in a list

2016-11-17 Thread Boylan, Ross
viceable for me, but it requires violating the intended semantics of repr, namely that the result could be converted back to the original object. I'm trying to get a display that has only some of the information in the object. My understanding is that str is supposed to provide that. At any rate

RE: how to control formatting of a namedtuple in a list

2016-11-17 Thread Boylan, Ross
, if in a format, the default formatting all the way down. Is there a good reason it's repr? Ross From: Python-list [python-list-bounces+ross.boylan=ucsf@python.org] on behalf of Chris Angelico [ros...@gmail.com] Sent: Thursday, November 17, 2016 3:

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

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

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

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

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
gt; On Tuesday 09 August 2016 11:52, Charles Ross wrote: > >> I’ve begun a new book called Meta Python that I’m looking for assistance >> with. > > Are you looking for people to be co-authors? Are you offering payment, or > credit? A free copy of the book? A kick to t

Call for Assistance

2016-08-09 Thread Charles Ross
I’ve begun a new book called Meta Python that I’m looking for assistance with. The book is one I wish was out there, and so am writing. The book is targeted at experienced programmers who are novice Python users and want to move from that point to one where they have published to PyPI. I’m spec

What is the difference between 32 and 64 bit Python on Windows 7 64 bit?

2014-05-11 Thread Ross Gayler
have with 64 bit Python running on 64 bit linux. Is that true?I have spent a couple of hours searching for a definitive description of the difference between the 32 and 64 bit versions of Python for Windows and haven't found anything. Thanks Ross -- https://mail.python.org/mailman/listinfo/python-list

Try-except-finally paradox

2014-01-29 Thread Jessica Ross
I found something like this in a StackOverflow discussion. >>> def paradox(): ... try: ... raise Exception("Exception raised during try") ... except: ... print "Except after try" ... return True ... finally: ... print "Finally" ...

Re: Excel column 256 limit

2013-03-19 Thread Michael Ross
On Tue, 19 Mar 2013 15:07:54 +0100, Neil Cerutti wrote: On 2013-03-18, Ana Dion?sio wrote: But I still get the error and I use Excel 2010. I'm trying to export data in a list to Excel xlrd: Library for developers to extract data from Microsoft Excel (tm). It is for *reading* Excel files,

Re: Excel column 256 limit

2013-03-18 Thread Michael Ross
On Mon, 18 Mar 2013 16:50:21 +0100, Steven D'Aprano wrote: On Mon, 18 Mar 2013 08:28:46 -0700, Ana Dionísio wrote: Is there some way to go around this limit? I need to import data from python to excel and I need 1440 columns for that. That's an Excel question, it has nothing to do with Py

Re: An error when i switched from python v2.6.6 => v3.2.3

2013-03-07 Thread Michael Ross
On Thu, 07 Mar 2013 13:25:58 +0100, Νίκος Γκρ33κ wrote: Τη Πέμπτη, 7 Μαρτίου 2013 1:51:42 μ.μ. UTC+2, ο χρήστης Michael Ross έγραψε: On Thu, 07 Mar 2013 12:27:03 +0100, Νίκος Γκρ33κ wrote: > Τη Πέμπτη, 7 Μαρτίου 2013 11:06:27 π.μ. UTC+2, ο χρήστης Νίκος Γκρ33κ > έγραψε: >&g

Re: An error when i switched from python v2.6.6 => v3.2.3

2013-03-07 Thread Michael Ross
On Thu, 07 Mar 2013 12:27:03 +0100, Νίκος Γκρ33κ wrote: Τη Πέμπτη, 7 Μαρτίου 2013 11:06:27 π.μ. UTC+2, ο χρήστης Νίκος Γκρ33κ έγραψε: Any ideas about the error please? I can assure you all the statemnt are correct ebcause they work in python v2.6.6 can someone help this issue so my w

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

2013-03-06 Thread Michael Ross
On Thu, 07 Mar 2013 02:28:10 +0100, Chris Kaynor wrote: I actually just tried that, and the results weren't very good. Using the doc's search feature, the "Reporting Bugs" (and the "About these documents") page >was significantly down the page (about 2/3 of the way) - not the most obviou

Re: Inserting-embedding some html data at the end of a .py file

2013-03-06 Thread Michael Ross
On Thu, 07 Mar 2013 00:18:44 +0100, Νίκος Γκρ33κ wrote: Τη Τετάρτη, 6 Μαρτίου 2013 2:06:33 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε: check_output is available as of Python 2.7 I guess you are still on version 2.6 ? I can access each of these from my jailed shell user account without

Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread Michael Ross
On Wed, 06 Mar 2013 12:52:00 +0100, Mark Lawrence wrote: On 06/03/2013 07:45, Νίκος Γκρ33κ wrote: I'am using this snipper to read a current directory and insert all filenames into a databse and then display them. But what happens when files are get removed form the directory? The inserted

Re: Inserting-embedding some html data at the end of a .py file

2013-03-05 Thread Michael Ross
On Wed, 06 Mar 2013 00:39:31 +0100, Νίκος Γκρ33κ wrote: htmldata = subprocess.check_output( '/home/nikos/public_html/cgi-bin/' + htmlpage ) htmldata = subprocess.check_output( ['/usr/bin/python', '/home/nikos/public_html/cgi-bin/' + htmlpage] ) Both of the above statemnts fail i'am afr

Re: Inserting-embedding some html data at the end of a .py file

2013-03-05 Thread Michael Ross
On Tue, 05 Mar 2013 23:47:18 +0100, Νίκος Γκρ33κ wrote: Thank you very much! This is what i was looking for and here is my code after receiving your help. So, with the command you provided to me i can actually run the .py script ans save its output and then append from there!! Great! Her

Re: Inserting-embedding some html data at the end of a .py file

2013-03-05 Thread Michael Ross
On Tue, 05 Mar 2013 21:04:59 +0100, Νίκος Γκρ33κ wrote: #open html template if htmlpage.endswith('.html'): f = open( "/home/nikos/public_html/" + htmlpage ) htmldata = f.read() counter = ''' mailto:supp...@superhost.gr";> src="/data/images/ma

Re: How to prevent tests from running against production?

2013-03-03 Thread Ross Ridge
on environment would seem to be the obvious solution. 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: Speeding up Python's exit

2013-03-03 Thread Ross Ridge
ython normally doesn't change this. Only the Python process's own internal buffers are flushed, the OS doesn't change its handling of its buffers. If you want written data to be fully committed before exiting you need to use other OS services that guarantee this.

Re: Python Newbie

2013-02-24 Thread Michael Ross
On Sun, 24 Feb 2013 20:40:05 +0100, wrote: > if (some statement): # short form > > rather than > > if (some statement == true): # long form What all those ugly brackets are for? Mark, Back in the day when C was king, or take many newer long established languages (C#,

Re: Checking for valid date input and convert appropriately

2013-02-21 Thread Michael Ross
On Fri, 22 Feb 2013 01:12:40 +0100, Ferrous Cranus wrote: Please i have been trying hours for this: Don't do that: Spending hours on being stuck. Take a break. Call it a night. Brain needs time to unstick itself. Besides: from datetime import date entry='31 03 2013' day, month,

Re: Checking for valid date input and convert appropriately

2013-02-21 Thread Michael Ross
On Fri, 22 Feb 2013 00:08:01 +0100, Ferrous Cranus wrote: Τη Παρασκευή, 22 Φεβρουαρίου 2013 12:03:59 π.μ. UTC+2, ο χρήστης Michael Ross έγραψε: On Thu, 21 Feb 2013 22:22:15 +0100, Ferrous Cranus wrote: > Τη Πέμπτη, 21 Φεβρουαρίου 2013 10:14:13 μ.μ. UTC+2, ο χρήστης MRAB >

Re: Checking for valid date input and convert appropriately

2013-02-21 Thread Michael Ross
On Thu, 21 Feb 2013 22:22:15 +0100, Ferrous Cranus wrote: Τη Πέμπτη, 21 Φεβρουαρίου 2013 10:14:13 μ.μ. UTC+2, ο χρήστης MRAB έγραψε: On 2013-02-21 19:38, Ferrous Cranus wrote: > import datetime from datetime Should be: from datetime import datetime > > try: > datetime.strpt

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

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: 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: 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: 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: 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: 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
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: 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: 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: 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: 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: 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: 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: 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: 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: "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: "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: 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: 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: "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: "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: "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
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
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: #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

#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: 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

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.

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: 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

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: inserting \ in regular expressions [solved]

2011-11-05 Thread Ross Boylan
On Wed, 2011-10-26 at 12:48 -0700, Ross Boylan wrote: > I want to replace every \ and " (the two characters for backslash and > double quotes) with a \ and the same character, i.e., > \ -> \\ > " -> \" I'd like to thank Ian, Dave, MRAB, and John for their he

inserting \ in regular expressions

2011-10-26 Thread Ross Boylan
sub(r"([\\\"])", "\1", 'Silly " quote') 'Silly \\\x01 quote' >>> re.sub(r"([\\\"])", "\\1", 'Silly " quote') 'Silly \\" quote' Or perhaps I'm confused about what the displayed results mean. If a string has a literal \, does it get shown as \\? I'd appreciate it if you cc me on the reply. Thanks. Ross Boylan -- 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: logging module -- better timestamp accuracy on Windows

2011-02-15 Thread Ross Ridge
debug("processing time %.0fms", (timer() - start) * 1000) Saves you from having to do the math in your head when you look at the logs. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http:

Socket connection between python and C

2011-02-08 Thread Williamson, Ross X. (Guest)
C. Is there a better way to package data on the server in python to send down a socket to a C client? XML? Pickle? Cheers, Ross -- http://mail.python.org/mailman/listinfo/python-list

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

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]

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

Overload print

2010-08-25 Thread Ross Williamson
_(self): >> print "hello" >> cc = foo_class() >> print cc Gives: hello I'm looking at finding nice way to print variables in a class just by asking to print it Cheers Ross -- Ross Williamson University of Chicago Department of Astronomy & Astrophysi

assign class variable in __init__

2010-06-08 Thread Ross Williamson
Hi Everyone, Just a quick question - Is it possible to assign class variables in the __init__() - i.e. somthing like: def __init__(self,self.source = "test", self.length = 1) rather than def __init__(self,source = "test", length = 1): -- Ross Williamson University of C

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

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

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: Does pickled objects work fine between different OS?

2010-05-26 Thread Ross Ridge
a.pkl" just fine on Windows XP? That will work just fine. The only thing that may be a problem is that if you choose to use the newer pickle format, it won't work with versions of Python before 2.3. Ross Ridge -- l/ // Ross Ridge -- The

Re: MemoryError, can I use more?

2010-02-14 Thread Ross Ridge
use more than 4GB of RAM through indirect means like multiple processes, the disk cache or video card RAM. 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: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Ross Ridge
lities in a lot of third party applications that couldn't be easily fixed by deploying a patched DLL with Windows Update. 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: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-21 Thread Ross Ridge
exe. Microsoft's documentation describes several possible ways you can redistribute the Visual C++ runtime: http://msdn.microsoft.com/en-us/library/ms235299.aspx >From the sounds of things, if you only have Visual C++ 2008 Express your only option may be to use Visual C++ Redis

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-17 Thread Ross Ridge
elf doesn't need it, and py2exe shouldn't either, but wxPython, or more precisely wxWidgets, almost certainly does. So in your case you'll probably need to redistribute both DLLs. 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: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-17 Thread Ross Ridge
oft Visual C++ or Python 2.6.4. Otherwise, you don't have the legal right to redistribute Microsoft's code. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~r

question about subprocess and shells

2009-12-04 Thread Ross Boylan
cs of the pipes for the processes standard file handles. Do they need to be closed (judging from the examples, no)? When reads/writes to them return, and what state is the stream in at the time? Thanks for any wisdom you can offer. Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to tell if you're running on windows?

2009-12-04 Thread Ross Ridge
In your case you can use the "sys.platform" variable to distinguish between Cygwin and a real Unix-type OS. You may end up needing to treat Cygwin as a special case. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rri...@csclub

New to python

2009-11-30 Thread Ronn Ross
I have recently come across something called a struct. I have googled this, but have note found a good explanation. Can someone give me a good definition or point me to a page that has one. Thanks -- http://mail.python.org/mailman/listinfo/python-list

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

converting latitude and longitude

2009-11-13 Thread Ronn Ross
I'm attempting to convert latitude and longitude coordinates from degrees minutes and second to decimal form. I would like to go from: N39 42 36.3 W77 42 51.5 to: -77.739855,39.70 Does anyone know of a library or some existing out their to help with this conversion? -- http://mail.python.o

[no subject]

2009-11-13 Thread Ronn Ross
I'm attempting to convert latitude and longitude coordinates from degrees minutes and second to decimal form. I would like to go from: N39 42 36.3 W77 42 51.5 to: -77.739855,39.70 Does anyone know of a library or some existing out their to help with this conversion? -- http://mail.python

Re: Python 2.6 Global Variables

2009-10-28 Thread Ronn Ross
Inside the method that you want to use the var prefix the first instance with global. For example: global my_var. Then you can use the var like normal in the method. Good luck On Oct 28, 2009, at 20:50, mattofak wrote: Hi All; I'm new to Python and moving from C, which is probably a big

Adding a menu to Tkinter

2009-10-26 Thread Ronn Ross
I'm attempting to add a menu bar to my Tkinter app. I can't figure out the correct syntax. Can someone help? I get this error when I run the app: Traceback (most recent call last): File "tkgrid.py", line 26, in app = App(root) File "tkgrid.py", line 10, in __init__ menubar = Menu(mas

Re: Python GUI

2009-10-25 Thread Ronn Ross
Philip, PySide looks nice and you are right it is still very young. I'm still going to give it a try. Thanks for your help. On Sun, Oct 25, 2009 at 9:41 PM, Philip Semanchuk wrote: > > On Oct 25, 2009, at 8:39 PM, Ronn Ross wrote: > > I need to create a gui for python

Python GUI

2009-10-25 Thread Ronn Ross
I need to create a gui for python. I'm looking for something that is easy to learn and cross platform. Any suggestions? If you have any good tutorials please send along. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: PySerial

2009-10-25 Thread Ronn Ross
On Sat, Oct 24, 2009 at 4:53 PM, John Nagle wrote: > Gabriel Genellina wrote: > >> En Fri, 23 Oct 2009 20:56:21 -0300, Ronn Ross >> escribió: >> >> >> I have tried setting the baud rate with no success. Also I'm using port >>> #2 >>> b

Re: PySerial

2009-10-24 Thread Ronn Ross
Oct 2009 20:56:21 -0300, Ronn Ross > escribió: > > > I have tried setting the baud rate with no success. Also I'm using port #2 >> because I"m using a usb to serial cable. >> > > Note that Serial(2) is known as COM3 in Windows, is it ok? > > > -- &

Re: PySerial

2009-10-23 Thread Ronn Ross
I have tried setting the baud rate with no success. Also I'm using port #2 because I"m using a usb to serial cable. On Fri, Oct 23, 2009 at 7:51 PM, Chris Rebert wrote: > On Thu, Oct 22, 2009 at 4:43 PM, Ronn Ross wrote: > > I'm using pySerial to connect to a serial p

Re: PySerial

2009-10-23 Thread Ronn Ross
I'm using pySerial to connect to a serial port (rs232) on a windows xp machine. I'm using python interactive interpretor to interact with the device. I type the following: import serial ser = serial.Serial(2) ser.write("command") But this does nothing to the control. I have been able to connect vi

  1   2   3   4   >