webbrowser failing

2005-09-20 Thread Thomas Thomas
ser.py", line 43, in open    get().open(url, new, autoraise)  File "C:\Python23\lib\webbrowser.py", line 250, in open    os.startfile(url)WindowsError: [Errno 2] The system cannot find the file specified: 'http://www.cnn.com'>>>   any help Thomas -- http://mail.python.org/mailman/listinfo/python-list

special charater in file causing trouble

2006-08-01 Thread Thomas Thomas
  line=f.next() metaHash[hashKey]=metaSubHash   print "one section over"   print filename,metaHash    return metaHash     else:   return {}   print "I cannot see a file of this name"

Zipping files/zipfile module

2006-08-01 Thread Thomas Thomas
  myZipFile.close()    return (1,zipFilename)       (success,filename)=createZipFile(planName,files,folders);     hope it helps..   cheers -Thomas Thomas[EMAIL PROTECTED]Phone.  +64 7 855 8478Fax.  +64 7 855 8871 -- http://mail.python.org/mailman/listinfo/python-list

Get age of a file/dir

2006-08-01 Thread Thomas Thomas
what abt   os.path.getmtime or may be os.stat(filename)[ST_MTIME];    cheers -Thomas Thomas[EMAIL PROTECTED]Phone.  +64 7 855 8478Fax.  +64 7 855 8871 -- http://mail.python.org/mailman/listinfo/python-list

python unicode how to

2006-08-02 Thread Thomas Thomas
o a sample file content will be string MetaDataPrompt = "Discovery No"; string MetaDataFieldName = "Discovery No"; string MetaDataType = "string"; string MetaDataValue = "£500"; } 3{ string MetaDataP

encoding of a file

2006-08-03 Thread Thomas Thomas
.open(filename, "r", encoding='latin-1') or f=codecs.open(filename, "r", encoding='utf-8')   sys.defaultencoding gives ascii and I know that's not the one to use   cheers -Thomas Thomas[EMAIL PROTECTED]

Outlook Addin and py2exe: 2 problems

2006-09-25 Thread Thomas Thomas
I recenlty had the same issue, but clearing the build directory and rebuilding again fixed the issue for me -- http://mail.python.org/mailman/listinfo/python-list

mapped drive missing when run as a service

2006-12-04 Thread Thomas Thomas
ation as a service. I tried running the service as an administrator but with similar results.. any work around for this situation.. All i want is to access network files when run the application as a service.. Cheers Thomas -- http://mail.python.org/mailman/listinfo/python-list

UnicodeDecodeError

2005-05-04 Thread Thomas Thomas
;%s"; filename="%s"' % (key, filename))    L.append(value)body = CRLF.join(L)   print "ok"   can anyone put some light.. whats going behind..   cheers Thomas     -- http://mail.python.org/mailman/listinfo/python-list

UnicodeDecodeError

2005-05-04 Thread Thomas Thomas
Hi all, Forgot to mention I am using python 2.3 on windows. I got the same error in mac panther . if I remove the line filename=unicode(filename); it works fine sometimes and if I encode the filename to ascii it works fine Thanks Thomas -- http://mail.python.org/mailman/listinfo/python-list

urllib open error

2005-05-08 Thread Thomas Thomas
4:00:56 GMT by ipcop (Squid/2.4.STABLE6)\n\n' if I copy the url to a browser it works fine. suggest any debug techiniques so I can figure out whats going wrong. Note: I have tried the same stuff and it's working fine on (windows 2000, XP and on mac)  not this particular windows 2000 machine   Thanks in advance Thomas   -- http://mail.python.org/mailman/listinfo/python-list

urllib open error

2005-05-08 Thread Thomas Thomas
Hi   It's seem to me that it works fine if I use hostname instead of ip address.   Note: Can anyone tell me how i reply to a question in thread, rather than starting a new one"   regards Thomas -- http://mail.python.org/mailman/listinfo/python-list

store data for search using python

2005-05-22 Thread Thomas Thomas
n is effective search. Another suggestion was btree.. any more tips on that regards Thomas -- http://mail.python.org/mailman/listinfo/python-list

python socket error

2005-06-01 Thread Thomas Thomas
in send    self.sock.sendall(str)  File "", line 1, in sendallsocket.error: (10055, 'No buffer space available')   Any help Thomas     --below the code sample that i am using import osimport httplib, mimetypesimport os;def httpUploadAsset(serial,filename,data):  

Reading XST file

2006-05-02 Thread Thomas Thomas
started using file objects  ..and was thinking is a better way to approach this scenario   from os.path import *filename="c:\sxtfile.xst";if exists(filename):   if isfile(filename):   f = open(filename, "rb")   for line in f.readlines():   print line   else:   print "I cannot see a file of this name"           cheers   -Thomas Thomas   phone  +64 7 855 8478fax    +64 7 855 8871 -- http://mail.python.org/mailman/listinfo/python-list

Reading Soap struct type

2006-05-09 Thread Thomas Thomas
field3', 'Field13': 'CF4Title:custom_field4', 'Fiel d14': 'Name:meta_filename', 'Field4': 'Display Name:display_name', 'Field13value ': ':CF4Value'} How can i iterarte through it bcz when do try do something like myHash.values() I am getting the error AttributeError: structType instance has no attribute 'values' any help Thomas -- http://mail.python.org/mailman/listinfo/python-list

os listdir access denied when run as a service

2006-05-24 Thread Thomas Thomas
if ((not (file.find(".tmp")>=0)) and (not (file.find("~")>=0))): filelist.append(file) for folder in folders: logger.error("got a folder :"+folder); logger.error("it was in the list :"+folders.__str__());

Request opinion on web application framework

2005-12-04 Thread Thomas
Hello, I am new to web programming but have some experience in technical programming in Python and other languages. I need to build a networked program which I would like to first deploy on an intranet and later on the web which provides access to a few technical applications, two document ma

$6 into $1000ands this actually works!

2005-07-01 Thread Thomas
PAYPAL VERIFIES THAT THIS $6 INVESTMENT SCHEME IS 100% LEGAL AND IS A BIG HIT THIS YEAR SEE THEIR NOTE BELOW OR ASK THEM DIRECTLY... THIS SCHEME MIGHT TAKE 15-30 MINUTES AND JUST $6, BUT IT IS 100% WORTH IT TO MAKE THOUSANDS SO QUICKLY. THIS IS NOT ANOTHER SCAM THAT TAKES LOTS OF YOUR HARD EARNED M

Convert all images to JPEG

2004-12-28 Thread Thomas
im.thumbnail(size, Image.ANTIALIAS) # size is 640x480 im.save(targetName, "JPEG") # targetname is test1.jpg produces an exception. Any clues? Best regards, Thomas -- http://mail.python.org/mailman/listinfo/python-list

urllib2 file upload error

2005-04-27 Thread Thomas
;C:\Python23\lib\httplib.py", line 576, in send     self.sock.sendall(str)   File "", line 1, in sendall TypeError: sendall() argument 1 must be string or read-only buffer, not list         Tried the script from http://fabien.seisen.org/python/urllib2_multipart.html  also   Getting similar error..   Cheers Thomas   -- http://mail.python.org/mailman/listinfo/python-list

uploading large file 100mb

2005-04-28 Thread Thomas
t;,[('test','valTest')],[('FILE1','TM_A5_Bulk.pdf',data)]);   File "c:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/python-1156QtG.py", line 17, in post_multipart     h.send(body)   File "C:\Python23\lib\httplib.py", line 576, in send     self.sock.

Logging data from Arduino using PySerial

2014-02-03 Thread Thomas
I've written a script to log data from my Arduino to a csv file. The script works well enough but it's very, very slow. I'm quite new to Python and I just wanted to put this out there to see if any Python experts could help optimise my code. Here it is: import serial import re impor

Re: Logging data from Arduino using PySerial

2014-02-03 Thread Thomas
Wow...Thanks Chris! I really appreciate your suggestions (including the stylistic ones). I'll definitely be revising my code as soon as I find the time. As far as profiling goes, I've used timeit in the past but it's quite a pain going through any program block by block. I wish there were a prog

webbrowser open failing

2006-07-25 Thread Thomas
e "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/ic.py", line 202, in launchurl self.ic.ICLaunchURL(hint, url, 0, len(url)) MacOS.Error: (-673, 'no URL found') cheers Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: webbrowser open failing

2006-07-26 Thread Thomas
brary/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/ic.py", line 202, in launchurl self.ic.ICLaunchURL(hint, url, 0, len(url)) MacOS.Error: (-43, 'File not found') it on shared network.. I found that its working fine on the files n the local hard drive.. chee

sorted

2006-08-18 Thread thomas
Hi NG I what to used the sorted function, and im getting this error Traceback (most recent call last): File "F:\home\thomas\src\guisample\test1.py", line 59, in ? main() File "F:\home\thomas\src\guisample\test1.py", line 31, in main sorted(cords, key=o

Re: sorted

2006-08-18 Thread thomas
Dennis Lee Bieber skrev: > On Fri, 18 Aug 2006 09:31:54 +0200, thomas <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > >> I what to used the sorted function, and im getting this error >> > >> what do I needs to import, to use this fun

socket error on windows, working fine on mac

2005-05-01 Thread Thomas
cket.error: (10055, 'No buffer space available')     cheers Thomas       import httplib, mimetypes   def post_multipart(host, selector, fields, files):     """     Post fields and files to an http host as multipart/form-data.     fields is a sequence of (name, value)

UnicodeDecodeError

2005-05-05 Thread Thomas
Thanks a lot.. Fredrik..   That’s says it all..   Cheers Thomas -- http://mail.python.org/mailman/listinfo/python-list

urllib open error

2005-05-11 Thread Thomas
Hi All,   Just an update on my urllib open error..  It’s the proxy setup on my machine which was causing the problem.   Note: soappy doesn’t use the proxy by default while the urllib do..     Cheers Thomas -- http://mail.python.org/mailman/listinfo/python-list

source file for kalab's pycron & makezip

2005-05-18 Thread Thomas
Hi All,   I am trying to get the source files for pycron &makezip.   http://www.kalab.com/freeware/pycron/pycron.htm   I tried mailing a request to [EMAIL PROTECTED] but no joy yet.   Cheers Thomas -- http://mail.python.org/mailman/listinfo/python-list

need help with win32com

2007-07-02 Thread Thomas
I want to be able to access an excel file and extract the code from the macro that is in the file. How can I do this? -- ~Thomas~ -- http://mail.python.org/mailman/listinfo/python-list

XL-RPC Recipe

2007-07-18 Thread Thomas
Or am I missing a major point here? I tried all of this on a fairly up-to-date Linux with a stock Python 2.5 (also tried with WinXP/cygwin/Python2.5.1 and with a Stackless 2.5.1, always with same outcome, so I don't believe it's an issue of a local installation). Any hints? =Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: XL-RPC Recipe

2007-07-18 Thread Thomas
2006/04/29 that the use of dotted functions is disabled by default in the server (from Python 2.4 onwards). But it can be enabled with: server.register_instance(StringFunctions(), allow_dotted_names = True) =Thomas -- http://mail.python.org/mailman/listinfo/python-list

Can't install Turbogears (with pysqlite) on Windows

2007-01-31 Thread Thomas
;? For the application I'm intending to build with TurboGears I don't even need pysqlite :( Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't install Turbogears (with pysqlite) on Windows

2007-01-31 Thread Thomas
The solution can be found here: http://groups.google.com/group/turbogears/browse_thread/thread/2dc72464a48fde94 -- http://mail.python.org/mailman/listinfo/python-list

SWIG: C++ and Python/ vector

2008-11-14 Thread Thomas
s a vector. The Python-Counterpart (the method) returns only a string like this: _15436785_p_vector (alike this) What can I do? Thanks for help. o-o Thomas -- http://mail.python.org/mailman/listinfo/python-list

Manipulating sys.path

2008-07-09 Thread Thomas
(like 'bin' in my case) which is automatically added to sys.path. Can anybody think of something that could be of help here? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Package Import

2008-07-09 Thread Thomas
package imports. See http://www.python.org/doc/essays/packages.html Thomas But i receive the error: Caught exception importing module subject: File "/usr/local/python/lib/python2.5/site-packages/pychecker/ checker.py", line 621, in setupMainCode() module = imp.l

Re: Relative Package Import

2008-07-10 Thread Thomas
Peter Otten wrote: Thomas wrote: Robert Hancock wrote: mypackage/ __init__.py push/ __init__.py dest.py feed/ __init__py subject.py In subject.py I have from ..push import dest

Re: a splitting headache

2009-10-16 Thread Thomas
On Oct 15, 9:18 pm, Mensanator wrote: > All I wanted to do is split a binary number into two lists, > a list of blocks of consecutive ones and another list of > blocks of consecutive zeroes. > > But no, you can't do that. > > >>> c = '001110' > >>> c.split('0') > > ['', '', '1', '', '', '', '1

Re: help to convert c++ fonction in python

2009-10-18 Thread Thomas
If you change your last line from: print s to: print u you'll get different results :) TC -- http://mail.python.org/mailman/listinfo/python-list

Re: How convert string '1e7' to an integer?

2009-11-08 Thread Thomas
Just a curiosity, why does Python do this? >>> l = [(base, int('1e7', base=base)) for base in range(15,37)] >>> l [(15, 442), (16, 487), (17, 534), (18, 583), (19, 634), (20, 687), (21, 742), (22, 799), (23, 858), (24, 919), (25, 982), (26, 1047), (27, 1114), (28, 1183), (29, 1254), (30, 1327), (3

Re: How to transmit a crash report ?

2010-02-23 Thread Thomas
On Feb 22, 9:27 pm, MRAB wrote: > Stef Mientki wrote: > > hello, > > > in my python desktop applications, > > I'ld like to implement a crash reporter. > > By redirecting the sys.excepthook, > > I can detect a crash and collect the necessary data. > > Now I want that my users sends this information

Updating values in a dictionary

2010-05-16 Thread Thomas
Greetings I am having a darn awful time trying to update a matrix: row = dict([(x,0) for x in range(3)]) matrix = dict([(x,row) for x in range(-3,4,1)]) matrix[2][1] += 1 matrix[-1][2] += 1 """ Got: a 1 in all col 1 and 2 {-3: {0: 0, 1: 1, 2: 1}, -2: {0: 0, 1: 1, 2: 1}, -1: {0: 0, 1: 1, 2: 1}

Re: Updating values in a dictionary

2010-05-16 Thread Thomas
Chris Wow, that was a very fast response. Thank you, it works (of course)... Cheers "Chris Rebert" wrote in message news:mailman.264.1274032106.32709.python-l...@python.org... On Sun, May 16, 2010 at 10:36 AM, Thomas wrote: Greetings I am having a darn awful time trying t

Find slope of function given empirical data.

2010-06-29 Thread Thomas
Hello all. Trying to find slope of function using numpy. Getting close, but results are a bit off. Hope someone out here can help. import numpy as np def deriv(y): x = list(range(len(y))) x.reverse() # Change from [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] x = np.array(x) #to [

Re: Find slope of function given empirical data.

2010-06-30 Thread Thomas
On Jun 30, 3:28 am, Peter Otten <__pete...@web.de> wrote: > Thomas wrote: > > Trying to find slope of function using numpy. > > Getting close, but results are a bit off. Hope someone out here can > > help. > > You don't make it easy to understand your post. I

infinite recursion in pickle.load()

2009-07-01 Thread Thomas
we regularly pickle and unpickle data from the same script (mostly dictionaries). sometimes, a file written this way cannot be unpickled with pickle.load(), due to an infinite recursion with __getattr__ in codecs.py. here is a python2.5 stack trace excerpt: /usr/local/lib/python2.5/pickle.py

Re: Style question -- plural of class name?

2013-05-09 Thread Thomas Rachel
Am 09.05.2013 02:38 schrieb Colin J. Williams: On 08/05/2013 4:20 PM, Roy Smith wrote: "A list of FooEntry's" +1 Go back to school. Both of you... That is NOT the way to build a plural form... Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: object.enable() anti-pattern

2013-05-10 Thread Thomas Rachel
te(3, message, strlen(message)); } No, what I've done is taken advantage of behaviors which are guaranteed by POSIX. Maybe, but the integer numbers get or los their property as a file descriptor with open() and close() and not by assigning them to an int. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: What was the project that made you feel skilled in Python?

2013-05-20 Thread Thomas Murphy
Hi Demian, Can I ask what you mean by working through the stdlib? As in writing code pieces utilizing each module from the stdlib? Also, you're talking about "patches" in the stdlib? Is there a separate library of patches? Forgive me if I'm google-failing hard over here. -- http://mail.python.org

Prepending string "@" to usernames

2013-05-24 Thread Thomas Murphy
27;TheGermanHatesSaurkraut', 'WhatsThatBoy932834'] I know I'm iterating wrong. May I ask how? -- Sincerely, Thomas Murphy Code Ninja 646.957.6115 -- http://mail.python.org/mailman/listinfo/python-list

Re: Prepending string "@" to usernames

2013-05-24 Thread Thomas Murphy
address.append("@" + str(address)) > print final_address > Exactly it. Thank you so much Dan. Perfect! -- Sincerely, Thomas Murphy Code Ninja 646.957.6115 -- http://mail.python.org/mailman/listinfo/python-list

Re: Prepending string "@" to usernames

2013-05-24 Thread Thomas Murphy
m the need to visually write every little step out and write in these more powerful chunks. -- Sincerely, Thomas Murphy Code Ninja 646.957.6115 -- http://mail.python.org/mailman/listinfo/python-list

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-29 Thread Thomas Rachel
Am 27.05.2013 02:14 schrieb Carlos Nepomuceno: pipes usually consumes disk storage at '/tmp'. Good that my pipes don't know about that. Why should that happen? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Thomas Murphy
is would project > a need for a good sex life. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Sincerely, Thomas Murphy Code Ninja 646.957.6115 -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrong website loaded when other requested

2013-06-13 Thread Thomas Murphy
thon.org/mailman/listinfo/python-list > -- Sincerely, Thomas Murphy Code Ninja 646.957.6115 -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-26 Thread Thomas Rachel
self.badder.is_full: take_potty_break() close_command_window() with command_window(): whilst learning or debugging: type_command() press_enter() observe_output() if self.badder.is_full: take_potty_break() looks nicer. SCNR Thomas -- http://mail.python.org

Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
ther: >>> class MyEnum_meta(type(ctypes.c_int), type(enum.Enum)): ... pass ... >>> class MyEnum(ctypes.c_int, enum.Enum): ... FOOBAR = 42 ... __metaclass__ = MyEnum_meta ... >>> MyEnum.FOOBAR 42 >>> It should have printed ''. Any ideas? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
Am 28.06.2013 17:16, schrieb Ethan Furman: On 06/28/2013 03:48 AM, Thomas Heller wrote: trying out the enum34 module. What I want to create is a subclass of enum.Enum that is also based on ctypes.c_int so that I can better use enum instances in ctypes api calls. Have you tried using

Re: Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
Am 28.06.2013 17:25, schrieb Thomas Heller: Robert Kern: enum.EnumMeta uses super() in its __new__() implementation but _ctypes.PyCSimpleType doesn't. Thus, only _ctypes.PyCSimpleType.__new__() gets a chance to run. Switching the order of the two might work. Robert found the proble

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-19 Thread Thomas Rachel
interface is missing: block until there's enough entropy, then generate data cryptographically, folding in new entropy when it's available. What am I missing? You exactly describe /dev/random's interface. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Generator vs functools.partial?

2012-06-21 Thread Thomas Rachel
end(i) rather def some_func(it): arg = big_calculation() for i in it: do_something(arg, i) some_func(lots_of_items) HTH, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Filenames started with _(underscore) in Modules/ why?

2012-06-23 Thread Thomas Jollans
On 06/24/2012 02:54 AM, gmspro wrote: There are some files whose filename is started with _(underscore). Why are they started with a underscore? By convention, a leading underscore means private/internal. A module with a leading underscore is typically an implementation detail of another modu

Executing Python Scripts on Mac using Python Launcher

2012-06-25 Thread David Thomas
Hello, This is my first post so go easy on me. I am just beginning to program using Python on Mac. When I try to execute a file using Python Launcher my code seems to cause an error in terminal, when I execute the exact same piece of code and run it in windows it seems to execute as exactly in

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread David Thomas
w how I can open such a file using 10.7. Thanks http://www.freeimagehosting.net/ilbqt http://www.freeimagehosting.net/r5ars On Monday, June 25, 2012 8:49:07 PM UTC+1, Benjamin Kaplan wrote: > On Mon, Jun 25, 2012 at 11:19 AM, David Thomas wrote: > > Hello, > > This is my first post

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread David Thomas
On Tuesday, June 26, 2012 6:37:42 PM UTC+1, Dave Angel wrote: > On 06/26/2012 01:19 PM, David Thomas wrote: > > I have installed Python 2.7.3 from Python.org also in Terminal it states > > that I have 2.7.3. > > How can I execute the script from Terminal? I've tried t

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread David Thomas
On Monday, June 25, 2012 7:19:54 PM UTC+1, David Thomas wrote: > Hello, > This is my first post so go easy on me. I am just beginning to program using > Python on Mac. When I try to execute a file using Python Launcher my code > seems to cause an error in terminal, when I execu

2to6 ?

2012-06-27 Thread Thomas Heller
Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-27 Thread David Thomas
On Tuesday, June 26, 2012 10:48:22 PM UTC+1, Hans Mulder wrote: > On 26/06/12 22:41:59, Dave Angel wrote: > > On 06/26/2012 03:16 PM, Hans Mulder wrote: > >> > >> > >> Python is an executable, and is > >> typically located in a "bin" directory. To find out where > >> it is, type > >> > >> ty

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-27 Thread David Thomas
Thank you ever so much raw_input works fine. Do you think I should stick with Python 2 before I go to 3? I have a text book which is using 3 but I've been using an online tutorial which has been helping me lots, which uses version 2. I found by just typing python then having a space and dragging

Recommend decent Computer Science books

2012-06-27 Thread David Thomas
Hi I know that this is a group about Python. But I am just wondering if anybody can recommend any introductory/good books on Conputer Science. Kind regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommend decent Computer Science books

2012-06-28 Thread David Thomas
Thanks everyone for the feedback really appreciate it especially the above post cheers -- http://mail.python.org/mailman/listinfo/python-list

Following syntax error in Mac OX10.7 Terminal

2012-06-28 Thread David Thomas
Hi, I have the following error regarding a loop tutorial found on http://www.sthurlow.com/python/lesson04/ >>> a=0 >>> while a<10: ... a=a+1 File "", line 2 a=a+1 ^ IndentationError: expected an indented block When I run Python IDE it seems to work fine. The following code is: a=0 w

Re: Following syntax error in Mac OX10.7 Terminal

2012-06-28 Thread David Thomas
Thank you very much I didn't realise that the indentation was important. The IDE indents automatically whilst terminal doesn't. Thanks for pointing it out. -- http://mail.python.org/mailman/listinfo/python-list

Re: Re Following syntax error in Mac OX10.7 Terminal

2012-06-29 Thread David Thomas
On Thursday, June 28, 2012 6:30:42 PM UTC+1, Sergi Pasoev wrote: > You just have to consider that indentation matters in Python, so you > have to type the code in Python interpreter as you have written it > below, that is, press Tab before each line when you are inside the > 'while (or any other li

Re: Re Following syntax error in Mac OX10.7 Terminal

2012-06-29 Thread David Thomas
On Friday, June 29, 2012 4:21:56 PM UTC+1, MRAB wrote: > On 29/06/2012 16:13, David Thomas wrote: > > On Thursday, June 28, 2012 6:30:42 PM UTC+1, Sergi Pasoev wrote: > >> You just have to consider that indentation matters in Python, so you > >> have to type the code i

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote: > Peter Otten wrote: > >> If you spell it >> >> def is_valid_password(password): >> return mud.minpass <= len(password) <= mud.maxpass >> >> it is even easier to see that you

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 10:30 PM, Alister wrote: > On Sat, 30 Jun 2012 21:38:58 +0200, Thomas Jollans wrote: > >> On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote: >>> Peter Otten wrote: >>> >>>> If you spell it >>>> >>>>

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 11:07 PM, Alain Ketterlin wrote: > Thomas Jollans writes: > >>>>>> def is_valid_password(password): >>>>>> return mud.minpass <= len(password) <= mud.maxpass > >> Which of the two comparisons is done first anyway? >

Re: code review

2012-06-30 Thread Thomas Jollans
On 06/30/2012 11:47 PM, Terry Reedy wrote: > On 6/30/2012 5:35 PM, Thomas Jollans wrote: >> On 06/30/2012 11:07 PM, Alain Ketterlin wrote: >>> Thomas Jollans writes: >>> >>>>>>>> def is_valid_password(password): >>>>>>>>

Re: code review

2012-06-30 Thread Thomas Jollans
On 07/01/2012 01:25 AM, Chris Angelico wrote: > On Sun, Jul 1, 2012 at 8:05 AM, Thomas Jollans wrote: >> Yes. My sole point, really, is that "normally", one would expect these >> two expressions to be equivalent: >> >> a < b < c >> (a < b) <

Re: code review

2012-07-01 Thread Thomas Jollans
On 07/01/2012 04:06 AM, Steven D'Aprano wrote: > On Sun, 01 Jul 2012 00:05:26 +0200, Thomas Jollans wrote: > >> As soon as you read it as a ternary operator, > > Well that's your problem. Why are you reading it as a ternary operator? > It isn't one. It

Re: code review

2012-07-01 Thread Thomas Jollans
On 07/01/2012 09:28 AM, Ben Finney wrote: > Chris Angelico writes: > >> On Sun, Jul 1, 2012 at 10:08 AM, Ben Finney >> wrote: >>> Thomas Jollans writes: >>> >>>> My sole point, really, is that "normally", one would expect these

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

2012-07-01 Thread Thomas Jollans
On 07/01/2012 07:51 PM, dmitrey wrote: > hi all, > are there any information about upcoming availability of parallel > computations in CPython without modules like multiprocessing? I mean > something like parallel "for" loops, or, at least, something without > forking with copying huge amounts of

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

2012-07-01 Thread Thomas Jollans
On 07/01/2012 08:44 PM, Dan Stromberg wrote: > IronPython, sadly, lacks a python standard library. Beg pardon? https://github.com/IronLanguages/main/tree/master/External.LCA_RESTRICTED/Languages/IronPython/27/Lib -- http://mail.python.org/mailman/listinfo/python-list

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

2012-07-01 Thread Thomas Jollans
On 07/01/2012 09:28 PM, Dan Stromberg wrote: > > > On Sun, Jul 1, 2012 at 11:58 AM, Thomas Jollans <mailto:t...@jollybox.de>> wrote: > > On 07/01/2012 08:44 PM, Dan Stromberg wrote: > > IronPython, sadly, lacks a python standard library. > >

Re: code review

2012-07-02 Thread Thomas Jollans
On 07/02/2012 02:43 AM, Steven D'Aprano wrote: > On Sun, 01 Jul 2012 09:35:40 +0200, Thomas Jollans wrote: >> This is simply wrong. The comparisons are not acting as binary >> operators. > > Of course they are. Take this chained comparison: Technically, yes - two-inpu

Re: code review

2012-07-02 Thread Thomas Jollans
On 07/02/2012 03:28 AM, Steven D'Aprano wrote: > We *really did have* somebody arguing that chained comparisons are Bad > because you can't stick parentheses around bits of it without changing > the semantics. That was an actual argument, not a straw-man. Ahem. It may have been sub-optimally phr

Re: 2to6 ?

2012-07-02 Thread Thomas Heller
Am 27.06.2012 20:06, schrieb Terry Reedy: On 6/27/2012 10:36 AM, Thomas Heller wrote: Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Others have expressed a similar wish, but I do not know that anyone

Re: code review

2012-07-02 Thread Thomas Jollans
On 07/02/2012 08:22 PM, Rick Johnson wrote: > Agreed. I wish we had one language. One which had syntactical > directives for scoping, blocks, assignments, etc, etc... > > BLOCK_INDENT_MARKER -> \t > BLOCK_DEDENT_MARKER -> \n > STATEMENT_TERMINATOR -> \n > ASSIGNMENT_OPERATOR -> := > CONDITIONAL_IF

Re: How can i do python form post request?

2012-07-03 Thread Thomas Jollans
u need. http://docs.python.org/library/cgi.html A better way to write web applications in Python is with WSGI. You can run WSGI scripts in a number of ways, including CGI and other, more efficient ways that integrate with the web server. Maybe somebody else knows of a good tutorial on WSGI that they&

Re: How can i do python form post request?

2012-07-03 Thread Thomas Jollans
On 07/03/2012 02:32 PM, gmspro wrote: > @Thomas, > >>First, you need to tell the web server to execute your Python script. > What you do next depends on how you've done that. > >>The simplest way is probably to pub p.py in your cgi-bin directory. This > could be

Re: Why site-packages?

2012-07-03 Thread Thomas Jollans
On 07/03/2012 11:34 PM, Dan Stromberg wrote: > On Tue, Jul 3, 2012 at 9:04 PM, Ian Kelly > wrote: > > On Tue, Jul 3, 2012 at 2:40 PM, Dan Stromberg > wrote: > > > > Why is it that so much 3rd party python code gets install

Re: 2 + 2 = 5

2012-07-04 Thread Thomas Jollans
On 07/04/2012 09:37 PM, Paul Rubin wrote: > 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[

Re: import class from string

2012-07-04 Thread Thomas Jollans
On 07/04/2012 10:27 PM, Mariano DAngelo wrote: > Hi I'm trying to create a class from a string > This is my code, but is not working It would be helpful if you posted an error message. Then, we could know what's actually going on. > 'myshop.models.base' > module_name, class_name = model

Re: Which way is best to execute a Python script in Excel?

2012-07-05 Thread Thomas Jollans
ipt Microsoft office, by far the easiest way is to simply stick to VBA and forget about Python in this particular environment. If it's an option, try LibreOffice. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: stuck in files!!

2012-07-06 Thread Thomas Jollans
On 07/06/2012 01:53 PM, Chirag B wrote: > i want to kno how to link two applications using python for eg:notepad > txt file and some docx file. like i wat to kno how to take path of > those to files and run them simultaneously.like if i type something in > notepad it has to come in wordpad whenever

  1   2   3   4   5   6   7   8   9   10   >