Re: Speeding up CGIHTTPServer

2005-03-07 Thread Tim Roberts
Server for Win98, although I think it's awfully hard to configure. thttpd and xitami are good lightweight web servers. Apache works quite well in Windows, but I don't think it is very happy on Windows 98. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie : prune os.walk

2005-03-11 Thread Tim Roberts
. The statement dir = [] does not actually change the list that was passed in. It creates a NEW empty list and binds it to "dir". If you want to empty the "dir" variable, try: del dir[:] -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: dictionary - howto get key value

2005-03-11 Thread Tim Roberts
get it in the python way ? If you need to do this a lot, just keep two dictionaries, where the keys in each are the values in the other. reversephone = dict( zip( phone.values(), phone.keys() ) ) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a problem on this simple code

2005-03-15 Thread Tim Roberts
n i make rx_command of type 'int' if i am to use 2)? Did you get an answer to this? I couldn't see any responses. The answer is either: rx_command = unpack('1B', rx_data_command)[0] or (rx_command,) = unpack('1B', rx_data_command) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: error sending path to Win OS

2005-03-15 Thread Tim Roberts
t exist from the point of view of the directory where the script is running this. You might do this: print os.getcwd() os.system('dir ' + InputDirectory) just to prove that you are where you think you are. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: will it cause any problems to open a read-only file & not close it?

2005-03-15 Thread Tim Roberts
you open a file to read >& never close it? A file is closed when the last reference to it is deleted. Since you never save a reference to this file, the last reference is deleted as soon as the readlines() call finishes. So, the file will be closed when you move to the next stateme

Re: win32 shell extension (virtual drive)

2005-03-15 Thread Tim Roberts
m Microsoft, and (C) no human being really wants to do. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-16 Thread Tim Roberts
this: a = (3 + 5) * 5 You really, really want (3 + 5) to be an integer, not a one-item tuple. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python like VB?

2005-03-17 Thread Tim Roberts
th a lot of customization using >Visual Basic. The VB in Microsoft Office is not being discontinued. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: inline comparison

2005-03-19 Thread Tim Roberts
get around wtih this? I don't want to break down this >comparison in two steps. Sorry, you have to. Assignment statements are not expressions in Python. m = self.macro_parser.match(d) if m: xxx You know the outer parentheses are not necessary, right? -- - Tim Roberts

Re: ver 23 invokation on Windows

2004-11-30 Thread Tim Roberts
script gets invoked, but command line arguments disappear. >Any idea what to do? Did you remember to pass the parameters when you created the file association? C:\TMP>assoc .py .py=Python.File C:\TMP>ftype Python.File Python.File=C:\Apps\Python23\python.exe "%1" %* C:\TMP> --

Re: Delphi/Kylix and Python

2004-12-04 Thread Tim Roberts
My problem with both Delphi and Kylix is in getting them to connect >with PostgreSQL and SQLite. Any suggestions? From what I have read, ODBC or >JDBC may do it, but I have experience with neither. There are direct Delphi components for both databases. Google is your friend. -- - Tim Ro

Re: Time for : comp.lang.python.newbies ??

2004-12-06 Thread Tim Roberts
n't, really. I don't think the percentage of true newbie questions has really gone up. However, as you grow more knowledgeable, the percentage of questions that SEEM like newbie questions goes up. comp.lang.python has always been a bastion of kindness and tolerance in the comp.lang hi

Re: Upgrading Python Article

2004-12-11 Thread Tim Roberts
sual C++ 7.1 is signficantly better at compliance than their past compilers. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compiler method

2004-12-16 Thread Tim Roberts
e compiler of the python.thanks a lot!!! Perhaps you could ask your question in a different way. Python is designed as an interpreted language, like Perl and Javascript. It isn't compiled to machine language. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. --

Re: Upgrading Python Article

2004-12-18 Thread Tim Roberts
JanC <[EMAIL PROTECTED]> wrote: >Tim Roberts schreef: > >> I don't think that's fair. Visual C++ 7.1 is signficantly better at >> compliance than their past compilers. > >AFAIK that's only for C++, not for C...? Yes. Microsoft has largely chosen t

Re: Python on Linux

2004-12-28 Thread Tim Roberts
27;t want to uninstall the old version. Red Hat installs packages that are needed for its configuration scripts. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: possible bug?

2005-03-23 Thread Tim Roberts
C:\\Program Files\\WinRK\\WinRK.exe -create ' + or Command_String = r'C:\Program Files\WinRK\WinRK.exe -create ' + -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Tim Roberts
; is just a normal function that creates the list [0,1,2,3,4]. The "for" statement keeps running the loop until it runs out of values in that list or tuple. So, you CAN change the value of i, but it won't change the operation of the loop. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: DBAPI Paramstyle

2005-03-26 Thread Tim Roberts
that the database provider inserts whatever quoting is required; you don't have to remember to put single quotes around the arguments, and protect single quotes within the arguments by doubling them, and so on. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Twisted version 2.0

2005-03-26 Thread Tim Roberts
be answered with a 4-line application using Twisted, but now it's grown even more? Remember the Master Control Program from Tron? I think of Twisted as Python's MCP. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: float default formatting

2005-03-26 Thread Tim Roberts
ef="+FLT) % (3.0,4.5) Are you trying to do currency? There are better ways, using the locale methods. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Tim Roberts
st of 1,000+ evils." Or, paraphrasing Mark Twain, "Python is the worst possible programming language, except for all the others." -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: html tags and python

2005-03-26 Thread Tim Roberts
t; much quicker. To do that with your code, I have to type "m tab 2 2 2 2 2 2 tab 2005". As an alternative, there are Javascript-based mini-calendars you can download that popup a little window with the current month, and let you click on the date. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Grouping code by indentation - feature or ******?

2005-03-29 Thread Tim Roberts
ion did not really say "^L". It gave me the symbol for female, which is code point 12 in the default character set. I translated it to the VIM equivalent to make the point.) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: File Uploads

2005-03-30 Thread Tim Roberts
ur problem solved, but you should know there is a problem with this line. The print statement automatically adds an end-of-line, so this will actually end up producing TWO blank lines after the header. You should use this: print "Content-type: text/html\n" -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Shell Editor Question

2005-03-30 Thread Tim Roberts
I don't know IDLE, but it's probably something like File->Run. >>>> exit >'Use File/Exit or your end-of-file key to quit IDLE' >>>> print "Hello" >Hello THAT'S the way you use IDLE. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: hex string into binary format?

2005-04-01 Thread Tim Roberts
;i1 = binascii.unhexlify(s1) >i2 = binascii.unhexlify(s2) >x = i1 ^i2 > > TypeError: unsupported operand type(s) for ^: 'str' and 'str' No imports at all: s1 = '1C46BE3D9F6AA820' s2 = '8667B5236D89CD46' i1 = int(s1,16) i2 = int(s2,16) x =

Re: urllib problem (maybe bugs?)

2005-04-01 Thread Tim Roberts
't do that. It always sends plain old application/x-www-form-urlencoded data. I think you're going to have to roll your own sender. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: change extensions

2005-04-07 Thread Tim Roberts
"Bob Then" <[EMAIL PROTECTED]> wrote: >how can i change all files from one extension to another within a direcory? In Windows, the quickest way is: os.system( "rename *.old *.new" ) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -

Re: Https Form Page

2005-04-09 Thread Tim Roberts
>http=httplib.HTTP("https://www.abc.com/",443) If you want https, you should use the HTTPS class. http = httplib.HTTPS("https://www.abc.com/",443) Or, even better, the HTTPSConnection class. http://www.noah.org/python/https/ -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Global Variables

2005-04-13 Thread Tim Roberts
It means that your function has "side effects" beyond just returning a value or set of values. This kind of thing is a better solution: def change_filename(): return raw_input() def change_path() return raw_input() filename = change_filename() path = change_path() -- -

Re: Compute pi to base 12 using Python?

2005-04-16 Thread Tim Roberts
t, even not a >># pi-sonnet, but it surely produces Pi! > >It sure does. When I ran it my jaw dropped. I had 7,947 CORRECT digits in >2 minutes 0 seconds (by my stopwatch)! How do you know? I think the 7,912th digit is wrong. ;) -- - Tim Roberts, [EMAIL PROTECTED] Providenza &

Re: Compute pi to base 12 using Python?

2005-04-16 Thread Tim Roberts
I'm >planning to put the contents of UnxUtils.zip in a directory and then move >the contents of UnxUpdates.zip, which has many of the same filenames, to >the same directory. Should I just let Windows replace the old files with >the updated ones? Yes. -- - Tim Roberts, [EMA

Re: Getting into Python, comming from Perl.

2005-04-26 Thread Tim Roberts
me to >jump ship (to mix my metaphors). That is truly wonderous. Are you famliar with the phrase "jumping the shark"? This chart might prove that, with Perl 6, Perl has now "jumped the shark". -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

ADODB Currency type broken in Python win32?

2005-04-26 Thread Tim Roberts
myMoney 6 (0, 25L) Instead, we get: myMoney 6 (0, -1794967296) The value has wrapped at 2**31. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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: 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: 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: 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: 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-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: 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: 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: 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: 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: 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: 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: 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-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: 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: 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: Processing a file using multithreads

2011-09-09 Thread Tim Roberts
ithreading is not a win. The threads will all compete with each other for the disk. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: using python in web applications

2011-09-11 Thread Tim Roberts
s >becoming more popular to. Well, that's a religious argument. Personally, I've always been confused by the draw of MySql. From the very beginning, Postgres has always been more powerful, more reliable, more standard-compliant, and more professional. -- Tim Roberts, t...@probo.com

Re: Multiplication error in python

2011-09-27 Thread Tim Roberts
Is there any different multiplication pattern in python? My guess is that you actually typed p=3*a instead of p=2*a That produces 45. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib and parsing

2011-10-06 Thread Tim Roberts
ttp://lalal.hhdik/' values = {'password' : 'password', 'Entra' : 'Entra' } data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) the_page = response.read() -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: httplib2 download forbidden

2011-10-06 Thread Tim Roberts
king for me. Do you have some kind of proxy in the way? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to create C-style "main" function in Python? (for teaching purposes)

2011-10-08 Thread Tim Roberts
n in COBOL was conceptually ahead of its time. It makes you THINK about your data structures more than, say "struct" in C. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Usefulness of the "not in" operator

2011-10-08 Thread Tim Roberts
hesis: If you need to look up whether they're >necessary or not, they are :-) Amen. +1 -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Usefulness of the "not in" operator

2011-10-10 Thread Tim Roberts
es, we do, because I'm always reading code from other people that didn't follow that rule. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: defining class and subclass in C

2012-01-14 Thread Tim Roberts
= { PyObject_HEAD_INIT(NULL) }; You are creating a "type" object. It shouldn't be a surprise that it is displayed as a , just like int and dict. In a sweeping overgenerality, C modules define types and Python modules define classes. You could redefine the __repr__ method to display "" if you want. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the very simplest way to run some Python from a button on a web page?

2012-01-21 Thread Tim Roberts
g page alone. If you aren't, then I think the easiest method is to use an invisible . From Javascript, you can set the "src" property of the to fire off a request while leaving the rest of the page alone. You could spend the rest of your career reading all of the good web material on A

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: how to put form and display its result(data from database) on the same window?

2005-12-11 Thread Tim Roberts
the previous one a lot. You may be quite right in your *guess* >that he doesn't need that, but there isn't enough information present in >his request for either of us to know. You are correct. Once you pointed it out, I now see what you were suggesting. -- - Tim Roberts, [EMAIL

<    1   2   3   4   5   6   7   8   9   10   >