Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-28 Thread Tim Roberts
is invalid. Neither one of those statement have any comments. There is a CONVENTION to embed a literal string as the first line in a function, to allow for automatic documentation. Whether the literal string is single-quoted or triple-quoted is irrelevant. That is, these two things are

Re: Python 3.4.1 on W2K?

2014-10-11 Thread Tim Roberts
into a 16-bit app is pretty >impressive. Actually, Microsoft made it pretty easy to call 32-bit DLLs in a 16-bit process and vice versa. That's why many of us were surprised when they did not provide the same capability in the 32/64 transition. -- Tim Roberts, t...@probo.com Providenza &

Re: very lightweight gui for win32 + python 3.4

2014-09-22 Thread Tim Roberts
transparent. And wxPython adds significant functionality on the top of that. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: binario - simple work with binary files

2014-09-06 Thread Tim Roberts
Rustom Mody wrote: >On Tuesday, September 2, 2014 6:05:19 AM UTC+5:30, Tim Roberts wrote: >> Rustom Mody wrote: > >> >On Tuesday, August 26, 2014 6:58:42 AM UTC+5:30, Tim Roberts wrote: > >> >> To the equivalent code with struct: >> >> import

Re: ANN: binario - simple work with binary files

2014-09-01 Thread Tim Roberts
Rustom Mody wrote: >On Tuesday, August 26, 2014 6:58:42 AM UTC+5:30, Tim Roberts wrote: >> To the equivalent code with struct: > >> import struct > >> dscrp = "H?fs5B" > >> f = open('file.dat') >> stuff = struct.unpack( dsc

Re: ANN: binario - simple work with binary files

2014-08-25 Thread Tim Roberts
struct: import struct dscrp = "H?fs5B" f = open('file.dat') stuff = struct.unpack( dscrp, f.read() ) print stuff In both cases, you have to KNOW the format of the data beforehand. If you do a read_short where you happen to have written a float, disaster ensues. I don't really see that you've added very much. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Very basic question. How do I start again?

2014-08-21 Thread Tim Roberts
Seymore4Head wrote: > >I want to give the computer 100 tries to guess a random number between >1 and 100 picked by the computer. If it takes more than 7, you're doing it wrong... -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailm

Re: Python 3 is killing Python

2014-07-16 Thread Tim Roberts
s was sent from my iPhone" == "I have an iPhone!" Please note that iPhones come configured from the factory to say that. Some users probably don't even know it is happening. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 is killing Python

2014-07-16 Thread Tim Roberts
tor that helped turn the tide in what otherwise would have been an ugly war of attrition, much like WWI. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Success with subprocess communicate on Windows?

2014-07-01 Thread Tim Roberts
b\\turtle.py") or s.check_output(r"pyflakes c:\programs\python34\lib\turtle.py") -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Need help with executing DB query in two different places in a test

2014-05-19 Thread Tim Roberts
st fetch all of the record for the session after each transaction, and make sure the contents match what you expect. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Psycopg2 : error message.

2014-05-19 Thread Tim Roberts
onnect("dbname=busard_test user=laurent host=localhost password=cactus") or do this: conn=psycopg2.connect(database='busard_test', user='laurent', host='localhost', password='cactus'") -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Two Questions about Python on Windows

2014-04-05 Thread Tim Roberts
like any other automatically executable program: xxx -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: numpy.where() and multiple comparisons

2014-01-18 Thread Tim Roberts
p; (a > 7) works because numpy.array has an override for the "&" operator. So, that expression is compiled as numpy.array.__and__( numpy.array.__lt__(2, a), numpy.array.__lt__(a, 7) ) As Peter said, there's no way to override the "and" operator. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python declarative

2014-01-18 Thread Tim Roberts
27;s a huge difference. If you want your layout to BE Python code, then you have little alternative except to use the suggestions offered. But if you simply want your scripts to be interpreted by a Python program, then you can do whatever you want. -- Tim Roberts, t...@probo.com Providenza &

Re: min max from tuples in list

2013-12-14 Thread Tim Roberts
S used in English > >conformant => something that conforms >performant => something that performs Yes, I suspect it comes from people expecting too much consistency. If something that has "conformance" is "conformant", then something that has good "perfor

Re: Is It Bug?

2013-12-07 Thread Tim Roberts
information. >>> s = 'Hello, \\\\World' >>> s 'Hello, World' >>> print s Hello, \\World >>> s = s.replace('','\\') >>> s 'Hello, \\World' >>> print s Hello, \World >>> -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-03 Thread Tim Roberts
gnificant enough savings to create new syntax. Remember the Python philosophy that there ought to be one way to do it. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: pypix

2013-11-19 Thread Tim Roberts
on is a well-established and mature programming tool. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: sendmail library ?!

2013-11-17 Thread Tim Roberts
r that import smtplib s = smtplib.SMTP("localhost") usually communicates directly with the local server, whether it be sendmail or postfix or whatever. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-07 Thread Tim Roberts
> >> I think the idea is that you could take any arbitrary input sequence, >> view it as a large number, and then find what exponential equation can >> produce that result. The equation becomes the "compression". Interesting -- I hadn't noticed that. Of co

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-07 Thread Tim Roberts
If you would like to describe your compression scheme, there really are people here who would be interested in reading it (although that number gets less and less as this thread goes on). -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Tim Roberts
x it came from. You have lost information. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: First day beginner to python, add to counter after nested loop

2013-11-02 Thread Tim Roberts
ther. It's just a choice that a language designer has to make. I happen to like Python's choice. You'll get used to it. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: First day beginner to python, add to counter after nested loop

2013-10-30 Thread Tim Roberts
ke it part of the syntax? That way, you don't accidentally have the indentation not match the syntax. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: converting letters to numbers

2013-10-19 Thread Tim Roberts
Steven D'Aprano wrote: >On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: > >> def add(c1, c2): >> % Decode >>... >Python uses # for comments, not %, as I'm sure you know. What language >were you thinking off when you wrote the above? Pss

Re: Changing the terminal title bar with Python

2013-10-19 Thread Tim Roberts
installed py32win, which virtually every Windows Python user does: import win32console win32console.SetConsoleTitle(msg) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: converting letters to numbers

2013-10-13 Thread Tim Roberts
% Process i1 = (c1 + c2) % 26 % Encode return chr(i1+65) Or, as a one-liner: A = ord('A') def add(c1, c2): return chr((ord(c1)-A + ord(c2)-A) % 26 + A) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: card dealer

2013-09-28 Thread Tim Roberts
gt;disaster. That's exactly the problem. Because the number of permutations is limited, once you know the first 28 cards, you can uniquely identify the permutation you started with, and that's enough to get the entire sequence. Now, it's going to take a hell of a lot of memory to s

Re: Newbie question related to Boolean in Python

2013-09-05 Thread Tim Roberts
sume (with no evidence) that the "dead" function calls sys.exit, which kills the program. In that case, this makes a little bit of sense. The first time you type "taunt bear", bear_moved is set True and the loop runs again. If you type "taunt bear" a second time, then th

Re: How to split with "\" character, and licence copyleft mirror of �

2013-09-05 Thread Tim Roberts
ward and backward slashes interchangably. It is only the command interpreter that requires the backslash. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to split with "\" character, and licence copyleft mirror of �

2013-09-01 Thread Tim Roberts
;>> os.path.split(a)[1] 'flute.wav' >>> >I also want to know how to mirror a character, in my case this one ©, >because I'll use the Copyleft http://en.wikipedia.org/wiki/Copyleft >to distribute my app. You can't "mirror" a charac

Re: must be dicts in tuple

2013-07-29 Thread Tim Roberts
re supposed to have dicts in a tuple. What you have is a dict in a tuple in a tuple. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the OS System Font Directory(Cross-Platform) in python?

2013-07-12 Thread Tim Roberts
onts directory. Linux doesn't even have a dedicated windowing system. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: hex dump w/ or w/out utf-8 chars

2013-07-12 Thread Tim Roberts
Joshua Landau wrote: > >Isn't a superscript "c" the symbol for radians? That's very rarely used. More common is "rad". The problem with a superscript "c" is that it looks too much like a degree symbol. -- Tim Roberts, t...@probo.com Providenza

Re: Geo Location extracted from visitors ip address

2013-07-05 Thread Tim Roberts
h a block of IP addresses. That does not necessarily bear any resemblence to the actual location of the user. It tells you the location of the Internet provider that registered the IP addresses. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to tell Script to use pythonw.exe ?

2013-07-02 Thread Tim Roberts
%1" %* You can create your own, if you want. If you want files with a .script extension to run PythonW, you can type: assoc .script=Python.NoConFile -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: A certainl part of an if() structure never gets executed.

2013-06-18 Thread Tim Roberts
Nick the Gr33k wrote: > >On 16/6/2013 4:55 ??, Tim Roberts wrote: > >> Nick the Gr33k wrote: >> Because Python lets you use arbitrary values in a Boolean context, the net >> result is exactly the same. > >What is an arbitrary value? don even knwo what arbit

Re: A certainl part of an if() structure never gets executed.

2013-06-15 Thread Tim Roberts
, or if they're all true, the last value. Why? Because it can't know whether the whole expression is true unless it looks at every value. So: 0 and 1 and 'what' ==> 0 1 and 0 and 'what' ==> 0 1 and None and 0 ==> None 1 and 1 and 'what' ==> 'what' -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get an integer from a sequence of bytes

2013-06-13 Thread Tim Roberts
Fábio Santos wrote: >On 5 Jun 2013 06:23, "Tim Roberts" wrote: >> A single machine word was 60 bits, so a single register read got you 10 >> characters. > >10 characters! Now that sounds like it's enough to actually store a word. >However long words c

Re: A certainl part of an if() structure never gets executed.

2013-06-11 Thread Tim Roberts
is not a tuple. My guess is that this will work fine: cur.execute( "SELECT * FROM works WHERE YEAR(lastvisit)=%s ORDER BY lastvisit", (year,) ) It seems silly to fire up a regular expression compiler to look for a single character. if name.find('=') < 0 and month.find('=') < 0 and year.find('=') < 0: -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get an integer from a sequence of bytes

2013-06-04 Thread Tim Roberts
#x27;s domain. When ASCII became unavoidable, most programs changed to using 5x 12-bit "bytes" per word. Ah, memories. I spent 10 years working for Control Data. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-26 Thread Tim Roberts
latin-1'? Because that's the default character set for pymysql. You could have learned this yourself -- you have the full source code for pymysql on your machine. You can override the default character set: con = pymysql.connect( db = 'metrites', host = 'lo

Re: Scope of a class..help???

2013-05-23 Thread Tim Roberts
ill automatically refer to the global class. It won't. The only way to solve this dilemma is to change the name you use in the "while" loop. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to write fast into a file in python?

2013-05-19 Thread Tim Roberts
Carlos Nepomuceno wrote: >Python really writes '\n\r' on Windows. Just check the files. It actually writes \r\n, but it's not Python that's doing it. It's the C runtime library. And, of course, you can eliminate all of that by opening the file in binary mode open

Re: Collision of Two Rect

2013-05-04 Thread Tim Roberts
an angle other than head on, only ONE of the velocities is reversed. When you hit a horizontal paddle, only the Y velocity is negated. The ball continues in the same X direction: \O \ / \/ See? The X velocity continues unchanged until it hits a vertical

Re: File Read issue by using module binascii

2013-04-27 Thread Tim Roberts
ord(b)) ) bsstr = ''.join(bsstr) or even: f = open('example.bmp','rb') bsstr = ''.join( bin(ord(b))[2:] for b in f.read() ) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird python behavior

2013-04-25 Thread Tim Roberts
Forafo San wrote: > >OK, lesson learned: Take care not to have module names that conflict with >python's built ins. Sorry for being so obtuse. You don't have to apologize. We've all been bitten by this at least once. -- Tim Roberts, t...@probo.com Providenza &

Re: How to get JSON values and how to trace sessions??

2013-04-23 Thread Tim Roberts
okie: header with your first response. You just need to return that in a Cookie: header with every request you make after that. >Are their other ways to keep control over which players sends the gamedata? Not sure what you mean. If the web site requires cookies, this is what you have to do. --

Re: Confusing Algorithm

2013-04-23 Thread Tim Roberts
you see the picture, you can see that you'd thread from B to D without involving C. I think you'll go A to B to D to F to G -- 4 threads. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-18 Thread Tim Roberts
ng* 'N/A' for every NaN. You understand that this will result in a chunk of text that is not JSON? Other JSON readers won't be able to read it. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-16 Thread Tim Roberts
s no way to represent NaN in JSON. It's simply not part of the specification. From RFC 4627 section 2.4: Numeric values that cannot be represented as sequences of digits (such as Infinity and NaN) are not permitted. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling python script in dos and passing arguments

2013-04-16 Thread Tim Roberts
own glob expansion. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting USB volume serial number from inserted device on OSX

2013-04-04 Thread Tim Roberts
ble solution. Every operating system handles this kind of this very differently. Remember, the operating system abstractions are all designed to hide this from you. When you open a serial port or an audio device or use a file system, you aren't supposed to KNOW that there is a USB device behi

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Tim Roberts
ming language in which to implement an open source version of the ill-fated Microsoft Bob project. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simple stand alone python app I can use on my Kindle fire?

2013-04-01 Thread Tim Roberts
Kindle doesn't run Windows. >I've tried downloading ubuntu to my kindle and couldn't, Did you download the x86 version? That will not work. There are Ubuntu distributions available for the Kindle Fire, but it's going to require getting your hands dirty. Google is your frien

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-04-01 Thread Tim Roberts
morphex wrote: > >While we're on the subject, wouldn't it be nice to have some cap there so >that it isn't possible to more or less block the system with large >exponentiation? There IS a cap. It's called the "MemoryError" exception. But, seriously,

Re: Separate Rows in reader

2013-03-28 Thread Tim Roberts
7; , '421', '27-Oct'), >('Stacy Kisha', 'Ministry of Man Power', '1234567,17-Jan')][/CODE] > >i need ' ' in all the row and the , to be remove after the date Do you have any intention of doing ANY of this work on your o

Re: how does the % work?

2013-03-24 Thread Tim Roberts
leonardo wrote: > >thank you all! So, what was the problem? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how does the % work?

2013-03-22 Thread Tim Roberts
Python 3. In Python 3, "print" is a function that returns None. So, the error is exactly correct. To fix it, you need to have the % operator operate on the string, not on the result of the "print" function: print('''Ah, so your name is %s, your quest is %s, and your favorite color is %s.''' % (name, quest, color)) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: changes on windows registry doesn�t take effect immediately

2013-03-14 Thread Tim Roberts
effect immediately, so >is there some way to change the windows registry and let the changes >take effect immediately without restarting IE ? No. This is an IE issue, not a registry issue. Other browsers might behave differently. -- Tim Roberts, t...@probo.com Providenza &am

Re: First attempt at a Python prog (Chess)

2013-02-18 Thread Tim Roberts
Chris Hinsley wrote: > >Is a Python list as fast as a bytearray ? Python does not actually have a native array type. Everything in your program that looked like an array was actually a list. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.o

Re: First attempt at a Python prog (Chess)

2013-02-13 Thread Tim Roberts
for col in range(8): with the more Pythonic: for row in board: for cell in row: I would probably replace the piece_type function with a map that maps the piece number directly to the piece -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to call shell?

2013-02-11 Thread Tim Roberts
uns, and terminates. Your first command adds a variable "i" to the environment for that shell, but the variable is deleted when the shell procsess terminates. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python programming language?

2013-02-09 Thread Tim Roberts
en a proof of that. I would assert that scripting languages are a proper subset of programming languages, not a separate category. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal 0**0

2013-02-06 Thread Tim Roberts
> >I suspect this is a bug in Decimal's interpretation of the standard. Can >anyone comment? I don't think Decimal ever promised to adhere to IEEE 754, did it? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Uniquely identifying each & every html template

2013-01-21 Thread Tim Roberts
e same page as page1.html? What if I subsequently delete page1.html? What if I don't? How long will you wait before deciding they are the same? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Uniquely identifying each & every html template

2013-01-21 Thread Tim Roberts
tered files, then there is absolutely no way to teach a computer how to do it. It IS impossible. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with importing in Python

2013-01-11 Thread Tim Roberts
Dave Angel wrote: > >As Adnan has pointed out, Python is case insensitive. That's not really what you meant to say... -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to download internet files by python ?

2013-01-09 Thread Tim Roberts
iMath wrote: > >There is also a httplib2 module >https://code.google.com/p/httplib2/ > >which one is more pythonic and powerful ? Both are Pythonic, and power is irrelevant for this. Your code is going to spend 90% of its time waiting for the network. Just solve the problem.

Re: got stuck in equation

2013-01-01 Thread Tim Roberts
y, it isn't practical to solve this for SN. That probably means you're going to need a iterative solution. That is, you start with a guess, see how far off you are, and refine the guess until you narrow in on a solution. That means you'll have to figure out whether raising SN gets you c

Re: the class problem

2013-01-01 Thread Tim Roberts
to derive from the "object" base class. The class is still simply called "haha", and to create an instance of the class "haha", you write "haha()". -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle module doens't work

2013-01-01 Thread Tim Roberts
ed the "train" method, there IS no MaxEntClassifier object. Once you have called "train", you should be able to pickle the new MaxEntClassifier and fetch it back with its state intact. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle module doens't work

2012-12-28 Thread Tim Roberts
train it every time >anew? Is there no way to save its trained values? When you say "train on data", what do you mean? If your training creates computed data in other members, those members and their values should also be saved in the pickle. -- Tim Roberts, t...@probo.com Provide

Re: Finding the name of a function while defining it

2012-12-28 Thread Tim Roberts
x27;t know just one name, and when a function object is invoked, it has NO IDEA what name was used to invoke it. The information is simply not available. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: I am facing an issue while decoding json string using json.loads

2012-12-26 Thread Tim Roberts
ng also contains one instance of \\] . Who is doing the JSON encoding? It appears to be doing it incorrectly. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the name of a function while defining it

2012-12-26 Thread Tim Roberts
more obscure: two = lamba : "one" one = two Which one of these is the "name" of the function? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python USB control on Windows 7?

2012-12-22 Thread Tim Roberts
asily, no. It's not really a USB device -- I'm betting it doesn't even enumerate. It's just sucking power from the USB wires. There's nothing to control. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: why does dead code costs time?

2012-12-05 Thread Tim Roberts
areful about spelling (and pronouncing) the whole word "peephole". The word as you have spelled it here (twice) is a vulgarity. Now, I'm all in favor of the occasional vulgarity, but if this is a misunderstanding, you could find yourself as the butt of some awkward jokes at s

Re: os.popen and the subprocess module

2012-11-28 Thread Tim Roberts
place almost every use case for os.system and os.popen. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: changing process name

2012-11-19 Thread Tim Roberts
andrea crotti wrote: >I have very long processes to spawn which I want to lauch as separate >processes (and communicate with ZeroMQ), but now the problem is that the >forked process appears in "ps" with the same name as the launcher >process. http://code.google.com/p/py

Re: Subprocess puzzle and two questions

2012-11-13 Thread Tim Roberts
ystem), and that command has a different output format. The csh "time" command is different yet again. >1) how can I recover that third digit from the subprocess? Do you actually believe that the third decimal place has any meaning at all? It doesn't. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: awk like usage in python

2012-11-09 Thread Tim Roberts
OS_: extract the 15 lines starting with T(est) from the file out-Dy-eos2 to a temporary file extract the 2nd field from the line with T(est) in it extract the 6th field from the first line with "s1,torque" extract the 7th field from the first line with "s1,torque&quo

Re: Listen for changes in variable (alsaaudio.Mixer(x, x).getvolume(x)

2012-10-24 Thread Tim Roberts
;re talking about real-time response makes me think you might be misunderstanding this. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: pls help me with this prog

2012-10-20 Thread Tim Roberts
>= n: yield iter[:n] iter = iter[n:] Now you can do this: def main(data): for first3 in N_at_a_time(data, 3): print CalcCenter(first3) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding http proxies

2012-10-14 Thread Tim Roberts
not "www.bigsite.com", that receipient can tell exactly who is supposed to get the message. So, a web proxy receives requests intended for other sites, and forwards them on, possibly after restricting or modifying them. That's it. -- Tim Roberts, t...@probo.com Providenza & Boeke

Re: Generating C++ code

2012-10-10 Thread Tim Roberts
e PHP code (it generates data access objects from a live database schema). -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Experimental Python-based shell

2012-10-02 Thread Tim Roberts
ility >and searching above pinpointing files in heirarchies. > >I invite you to try it. Without intending to detract from your work in any way, are you familiar with the IPython project? http://ipython.org/ You may find some interesting synergy with them. -- Tim Roberts, t...@prob

Re: Who's laughing at my responses, and who's not?

2012-09-24 Thread Tim Roberts
ds of thousands of people reading this forum. A few of those people probably don't like you. So what? Illegitemi non carborondum -- don't let the bastards wear you down. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to limit CPU usage in Python

2012-09-24 Thread Tim Roberts
Paul Rubin wrote: > >Tim Roberts: reasons to want to do this might involve a shared host >where excessive cpu usage affects other users; That's what priorities are for. >...or a computer with >limited power consumption, where prolonged high cpu activity causes >thermal or

Re: Exact integer-valued floats

2012-09-22 Thread Tim Roberts
for top-posting. My Xoom makes bottom-posting awkward. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. Dave Angel wrote: On 09/22/2012 05:05 PM, Tim Roberts wrote: > Dennis Lee Bieber wrote: >> On 22 Sep 2012 01:36:59 GMT, Steven D'Aprano wrote: >>> For

Re: Exact integer-valued floats

2012-09-22 Thread Tim Roberts
Control Data 6000/Cyber series had sign bit and 11-bit exponent, with either a 48-bit mantissa or a 96-bit mantissa, packed into one or two 60-bit words. Values were not automatically normalized, so there was no assumed 1 bit, as in IEEE-754. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to limit CPU usage in Python

2012-09-22 Thread Tim Roberts
You will not find generic mechanisms wrapping them. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing arguments to & executing, a python script on a remote machine from a python script on local machine (using ssh ?)

2012-09-19 Thread Tim Roberts
nts ( 3/4 string arguments, containing whitespaces like spaces, etc ) >to a python script, remote.py running on 'remote' (the remote machine). You haven't provided very many details, so it's possible ssh is the low-impact solution, but don't discard the possibility of usi

Re: 'indent'ing Python in windows bat

2012-09-17 Thread Tim Roberts
sys.exit( {'Cope':1,'Perform':2}.get(sR,3) ) The best way to convert a batch file to Python is to convert the whole file to a Python script. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending USB commands with Python

2012-08-30 Thread Tim Roberts
sb_setup_async] invalid >endpoint 0x02\n' USB endponts only go in one direction. There will be one endpoint for outoging data, and one endpoint for incoming data. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending USB commands with Python

2012-08-28 Thread Tim Roberts
aries can be used to talk to USB devices. There is a Python binding. On Windows, you still need to have a driver, but the libusbx instructions can help you find an install one. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: calling loaded DLL function expecting POINT * argument

2012-08-26 Thread Tim Roberts
fined as __cdecl. Try cdll.LoadLibrary instead of oledll.LoadLibrary. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-04 Thread Tim Roberts
ramework. IronPython is written in C#. It generates code that runs in the .NET Framework. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: when an iterable object is exhausted or not

2012-08-04 Thread Tim Roberts
esting that it DOESN'T happen in Python 2. The first "i" is of type list, the second "i" is of type string, and both are restartable. What's the type of "i" in the second case in Python 3? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >