Awsome Python - chained exceptions

2013-02-11 Thread Steven D'Aprano
As an antidote to the ill-informed negativity of Ranting Rick's illusionary "PyWarts", I thought I'd present a few of Python's more awesome features, starting with exception contexts. If you've ever written an exception handler, you've probably written a *buggy* exception handler: def getitem

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Chris Angelico
On Tue, Feb 12, 2013 at 12:06 PM, 8 Dihedral wrote: > A permanently mutated list is a tuple of constant objects. I nominate this line as "bemusing head-scratcher of the week". ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: how to call shell?

2013-02-11 Thread Tim Roberts
contro opinion wrote: > import os os.system("i=3") >0 os.system("echo $i") > >0 >why i can't get the value of i ? Each invocation of os.system creates a brand new shell that starts, runs, and terminates. Your first command adds a variable "i" to the environment for that shell

Re: call shell from python

2013-02-11 Thread Chris Rebert
On Mon, Feb 11, 2013 at 9:13 PM, contro opinion wrote: import os os.system("i=3") > 0 os.system("echo $i") > > 0 > how can i get the value of i? Your example is too heavily contrived for me to give a much more specific/useful answer than "use the `subprocess` module": http://docs.

Re: LangWart: Method congestion from mutate multiplicty

2013-02-11 Thread Mark Janssen
On Mon, Feb 11, 2013 at 8:55 PM, Rick Johnson wrote: > On Monday, February 11, 2013 7:27:30 AM UTC-6, Chris Angelico wrote: > >> So... >> flatten([None, 23, [1, 2, 3], (2, 3), ["spam", "ham"]]) >> >> would return >> >> [None, 23, 1, 2, 3, (2, 3), "spam", "ham"] >> >> I think that's even more unexp

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Mark Janssen
On Fri, Feb 8, 2013 at 9:48 AM, Rick Johnson wrote: > On Friday, February 8, 2013 9:16:42 AM UTC-6, Steven D'Aprano wrote: >> Rick Johnson wrote: > Just because /everything/ in Python is an object does not mean that Python is > 100% OOP. The whole idea of "make everything an object" is possibly

how to call shell?

2013-02-11 Thread contro opinion
>>> import os >>> os.system("i=3") 0 >>> os.system("echo $i") 0 >>> why i can't get the value of i ? -- http://mail.python.org/mailman/listinfo/python-list

Re: LangWart: Method congestion from mutate multiplicty

2013-02-11 Thread Rick Johnson
On Monday, February 11, 2013 7:27:30 AM UTC-6, Chris Angelico wrote: > So... > flatten([None, 23, [1, 2, 3], (2, 3), ["spam", "ham"]]) > > would return > > [None, 23, 1, 2, 3, (2, 3), "spam", "ham"] > > I think that's even more unexpected. Why? Are you over-analyzing? Show me a result that /do

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Rick Johnson
On Monday, February 11, 2013 7:52:24 AM UTC-6, Chris Angelico wrote: > [...] > But my statement wasn't based on my own knowledge of the stdlib, but > rather on this: > > On Sat, Feb 9, 2013 at 6:58 AM, Rick Johnson wrote: > > I'm a bit unnerved by the sum function. Summing a > > sequence only make

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Rick Johnson
On Monday, February 11, 2013 7:35:23 AM UTC-6, Chris Angelico wrote: > On Tue, Feb 12, 2013 at 12:13 AM, Rick Johnson wrote: > > I am vehemently against using more than one "opening seq char" and one > > "closing seq char". ... we could use start and end tags like: > > > > set{1,2,3}set > > > >

Re: Python recv loop

2013-02-11 Thread MRAB
On 2013-02-12 02:20, Chris Angelico wrote: On Tue, Feb 12, 2013 at 12:41 PM, Ihsan Junaidi Ibrahim wrote: On Feb 11, 2013, at 11:24 PM, Chris Angelico wrote: On Tue, Feb 12, 2013 at 2:11 AM, MRAB wrote: I probably wouldn't make it fixed length. I'd have the length in decimal followed by,

Re: Import redirects

2013-02-11 Thread Isaac To
On Mon, Feb 11, 2013 at 8:27 PM, Oscar Benjamin wrote: > On 11 February 2013 06:50, Isaac To wrote: > > Except one thing: it doesn't really work. If I `import foo.baz.mymod` > now, > > and if in "bar.baz.mymod" there is a statement `import bar.baz.depmod`, > then > > it fails. It correctly load

Re: Python recv loop

2013-02-11 Thread Roy Smith
In article , Ihsan Junaidi Ibrahim wrote: > I'm running JSON for my application messaging protocol but with JSON and > python default unordered dict, > there's no guarantee if I put in the length key in the JSON message, it will > be placed on the first bytes hence > why it was designed for a

Re: Python recv loop

2013-02-11 Thread Chris Angelico
On Tue, Feb 12, 2013 at 12:41 PM, Ihsan Junaidi Ibrahim wrote: > > On Feb 11, 2013, at 11:24 PM, Chris Angelico wrote: > >> On Tue, Feb 12, 2013 at 2:11 AM, MRAB wrote: >>> I probably wouldn't make it fixed length. I'd have the length in >>> decimal followed by, say, "\n". >> >> Or even "followe

Re: Python recv loop

2013-02-11 Thread Ihsan Junaidi Ibrahim
On Feb 11, 2013, at 11:24 PM, Chris Angelico wrote: > On Tue, Feb 12, 2013 at 2:11 AM, MRAB wrote: >> I probably wouldn't make it fixed length. I'd have the length in >> decimal followed by, say, "\n". > > Or even "followed by any non-digit". Chances are your JSON data begins > with a non-digi

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread 88888 Dihedral
Rick Johnson於 2013年2月11日星期一UTC+8下午9時13分58秒寫道: > On Monday, February 11, 2013 6:40:23 AM UTC-6, Chris Angelico wrote: > > > [...] > > > Or doing what you were pointing and laughing at Pike for, and using > > > two-symbol delimiters. You could even make it majorly logical: > > > > > > list_ = [

Re: Python3 curses behavior

2013-02-11 Thread Dan Stromberg
Sent from my android phone. On Feb 10, 2013 2:09 PM, "Vlasov Vitaly" wrote: > > суббота, 9 февраля 2013 г., 23:22:47 UTC+4 пользователь Terry Reedy написал: > > On 2/9/2013 6:23 AM, Vlasov Vitaly wrote: > > > -- > > > > Terry Jan Reedy > > Thank you. > > I tried everything in my test script. > win

Re: Monitoring updating directory for image for GUI

2013-02-11 Thread MRAB
On 2013-02-11 22:50, ciscorucin...@gmail.com wrote: [snip] So I would only create one image location at "images\sheetMusic.png" and that file would be continuously updated as new notes are streamed in. My "monitor" class (might be a legacy component now) would basically look for that one image -

Re: Is Python programming language?

2013-02-11 Thread Dan Stromberg
Sent from my android phone. On Feb 9, 2013 6:41 PM, "Terry Reedy" wrote: > > On 2/9/2013 6:53 PM, Michael Torrie wrote: >> >> On 02/09/2013 04:26 PM, Tim Roberts wrote: >>> >>> Most people would call bash a "scripting language", but it is also clearly >>> a programming language. It has syntax, va

Re: Monitoring updating directory for image for GUI

2013-02-11 Thread ciscorucinski
WOW...I am thinking that all of this was actually unnecessary, I don't think I need a Queue, or List / Stack, or any traversal of the file system to accomplish this!! I only need one image displayed at a time and don't care about them after a newer image is generated. So my prototype of just re

Re: How to Send a Tweet from Python? I can read, but not post.

2013-02-11 Thread Steven D'Aprano
saqib.ali...@gmail.com wrote: > I posted this on StackOverflow.com but haven't got a good response yet: > http://stackoverflow.com/questions/14808245/python-why-cant-i-send-a-tweet > > > > I have tried two different packages python-twitter and tweepy but have not > been successful using either

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-11 Thread Chris Angelico
On Tue, Feb 12, 2013 at 6:15 AM, Michael Torrie wrote: > On 02/11/2013 11:32 AM, Jason Swails wrote: >> >> Perhaps that's your problem ;). Tkinter was the first--and only--GUI >> toolkit I learned [1] (I do almost exclusively CLI, and GUI only for fun -- >> and I program as a result of the work I

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-11 Thread Michael Torrie
On 02/11/2013 11:32 AM, Jason Swails wrote: > > Perhaps that's your problem ;). Tkinter was the first--and only--GUI > toolkit I learned [1] (I do almost exclusively CLI, and GUI only for fun -- > and I program as a result of the work I do). Having no previous knowledge > of any other GUI toolki

Re: PyDev, pep8.py conflict on spaces around negative numbers

2013-02-11 Thread Wanderer
On Monday, February 11, 2013 1:09:38 PM UTC-5, MRAB wrote: > On 2013-02-11 16:39, Wanderer wrote: > > > If I check the 'Use space before and after operators? (+, -, /, *, > > > //, **, etc.)' in the Eclipse>PyDev>Editor>Code Style> Code > > > Formatter, PyDev will insert a space before a negativ

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-11 Thread Jason Swails
On Mon, Feb 11, 2013 at 1:27 AM, Chris Angelico wrote: > On Mon, Feb 11, 2013 at 1:42 PM, alex23 wrote: > > On Feb 9, 2:25 pm, Michael Torrie wrote: > >> Rick seems to know his stuff > >> about Tk programming, but his knowledge of programming language theory > >> and formal computing seems quit

Re: PyDev, pep8.py conflict on spaces around negative numbers

2013-02-11 Thread MRAB
On 2013-02-11 16:39, Wanderer wrote: If I check the 'Use space before and after operators? (+, -, /, *, //, **, etc.)' in the Eclipse>PyDev>Editor>Code Style> Code Formatter, PyDev will insert a space before a negative number in a keyword parameter declaration. Pep8.py will then post a warning 'E

Re: LangWart: Method congestion from mutate multiplicty

2013-02-11 Thread Serhiy Storchaka
On 11.02.13 09:24, Chris Angelico wrote: Can I get a ringside seat at the debate between Rick and jmf on which kind of string theory was the wronger decision? I want to see it. -- http://mail.python.org/mailman/listinfo/python-list

PyDev, pep8.py conflict on spaces around negative numbers

2013-02-11 Thread Wanderer
If I check the 'Use space before and after operators? (+, -, /, *, //, **, etc.)' in the Eclipse>PyDev>Editor>Code Style> Code Formatter, PyDev will insert a space before a negative number in a keyword parameter declaration. Pep8.py will then post a warning 'E251 no spaces around keyword / param

Compiling Python with static runtime library (VS2010)

2013-02-11 Thread Jonatan Magnusson
Hi I'm trying to build Python 3.3.0 on Windows using Visual Studio 2010 Express. I opened the solution (pcbuild.sln) and built the "python" project (including its dependencies of course) and that worked fine with just a few warnings. But I need to build Python using the the static C runtime s

imp.load_module error in Python 3.3

2013-02-11 Thread Iuri
I want to load a file with an invalid module name (with a dash). filename = '...' # something like /my/path/to/ejtp-crypto with open(filename, 'rb') as fp: my_module = imp.load_module('crypto', fp, 'ejtp-crypto', ('.py', 'rb', imp.PY_SOURCE)) It works to all Python >= 2.5, except

Re: Python recv loop

2013-02-11 Thread Dave Angel
On 02/11/2013 10:02 AM, Ihsan Junaidi Ibrahim wrote: print 'message length is {0}'.format(nbuf) while True: buf = sock.recv(nbuf) if not buf: break This loop doesn't terminate till buf is zero length, which it will be eventually. At that point,

Re: Python recv loop

2013-02-11 Thread Chris Angelico
On Tue, Feb 12, 2013 at 2:11 AM, MRAB wrote: > I probably wouldn't make it fixed length. I'd have the length in > decimal followed by, say, "\n". Or even "followed by any non-digit". Chances are your JSON data begins with a non-digit, so you'd just have to insert a space in the event that you're

Re: Python recv loop

2013-02-11 Thread MRAB
On 2013-02-11 14:56, Ihsan Junaidi Ibrahim wrote: Hi Roy, On Feb 11, 2013, at 10:24 AM, Roy Smith wrote: Is this server that you're talking to something that you have control over, i.e. are you stuck with this protocol? Given a choice, I'd go with something like JSON, for which pre-existing

Re: Python recv loop

2013-02-11 Thread Ihsan Junaidi Ibrahim
Hi MRAB, My code now works thanks to your advice. {"msgver": "1.0", "msgid": "200", "subcode": "100", "appver": "1.0", "appid": "1.0", "data": {"1": "igb0", "2": "igb1", "ifcnt": "2"}} connected to misty:8080 sending data 138 bytes sent: 0x86{"msgver": "1.0", "msgid": "200", "subcode": "100", "

matplotlib - removing text from a figure - a bug?

2013-02-11 Thread Raphael Mameghani
Does anyone know if the following error message is a matplotlib bug? Is there an correct/alternative way to remove (or replace) text? Thank you, Raphael from matplotlib.figure import Figure fig = Figure() caption = fig.suptitle("test") caption.remove() Traceback (most recent call last): File ""

Re: Python recv loop

2013-02-11 Thread Ihsan Junaidi Ibrahim
Hi Dave, On Feb 11, 2013, at 9:22 AM, Dave Angel wrote: > Exactly how are you sending "hexadecimal" ? If that 0xad (which is only one > byte, what about the other 3 ?) is intended to be a C description, then it's > certainly not hex, it's binary. And probably little-endian, to boot. That's

Re: Python recv loop

2013-02-11 Thread Ihsan Junaidi Ibrahim
Hi Roy, On Feb 11, 2013, at 10:24 AM, Roy Smith wrote: > > Is this server that you're talking to something that you have control > over, i.e. are you stuck with this protocol? Given a choice, I'd go > with something like JSON, for which pre-existing libraries for every > language under the s

Re: Error in reading and writing CSV format file in python

2013-02-11 Thread inshu chauhan
On Mon, Feb 11, 2013 at 3:22 PM, Dave Angel wrote: > On 02/11/2013 06:00 AM, inshu chauhan wrote: > >> In the programme below I am trying to read two csv format files and >> process >> them and write a new file with some of theirs data. >> >> import csv >> f1_reader = csv.reader(open(r"Z:\Weka >>

Re: Alternative to Apache+mod_fcgid+Flup?

2013-02-11 Thread Chris Rebert
On Feb 11, 2013 6:16 AM, "Gilles" wrote: > > Hello > > I read this article... > > "Why is WSGI deployment under FASTCGI so painful?" > http://blog.dscpl.com.au/2011/09/why-is-wsgi-deployment-under-fastcgi-so.html > > ... and was wondering what better alternative is available to run > Python web sc

Re: Error in reading and writing CSV format file in python

2013-02-11 Thread Dave Angel
On 02/11/2013 06:00 AM, inshu chauhan wrote: In the programme below I am trying to read two csv format files and process them and write a new file with some of theirs data. import csv f1_reader = csv.reader(open(r"Z:\Weka work\Feature_Vectors_Fullset_00.arff")) f2_reader = csv.reader(open(r"Z:\W

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Chris Angelico
On Tue, Feb 12, 2013 at 12:28 AM, Rick Johnson wrote: > I am sure there are quite a few Chris. But if you expect to around making > statements like: "Python does not have typed arrays", then don't get all > upset when someone corrects you. Oh, I don't mind being corrected on those sorts of poin

Re: Logging within a class

2013-02-11 Thread Jean-Michel Pichavant
- Original Message - > Within __init__ I setup a log with self.log = > logging.getLogger('foo') then add a > console and filehandler which requires the formatting to be > specified. There a few > methods I setup a local log object by calling getChild against the > global log object. > > >

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Chris Angelico
On Tue, Feb 12, 2013 at 12:13 AM, Rick Johnson wrote: > I am vehemently against using more than one "opening seq char" and one > "closing seq char". ... we could use start and end tags like: > > set{1,2,3}set > > where "set{" and "}set" are delimiters. Interesting. So what you're actually agai

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Rick Johnson
On Monday, February 11, 2013 6:50:03 AM UTC-6, Chris Angelico wrote: > On Mon, Feb 11, 2013 at 11:28 PM, Rick Johnson > > Well i would expect anyone who considers himself a > > python programmer (not to mention "pythonista"!) to at > > minimum be familiar with the stdlib. [...] > > [...] > > If t

Re: LangWart: Method congestion from mutate multiplicty

2013-02-11 Thread Chris Angelico
On Mon, Feb 11, 2013 at 11:53 PM, Rick Johnson wrote: > Which primitive(s) should NOT have been expanded in your opinion? The "Point" > object? I agree, that's why MY implementation would call seq.flatten() on all > sub-sequences THEREBY allowing each subtype to define it's own flatten > behavi

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Rick Johnson
On Monday, February 11, 2013 6:40:23 AM UTC-6, Chris Angelico wrote: > [...] > Or doing what you were pointing and laughing at Pike for, and using > two-symbol delimiters. You could even make it majorly logical: > > list_ = [[ 1, 2, 3 ]] > tuple_ = ([ 1, 2, 3 ]) > dict_ = [{ 1, 2, 3 }] > frozendic

Re: Error in reading and writing CSV format file in python

2013-02-11 Thread inshu chauhan
On Mon, Feb 11, 2013 at 2:02 PM, MRAB wrote: > On 2013-02-11 12:44, inshu chauhan wrote: > >> >> On Mon, Feb 11, 2013 at 1:26 PM, Steven D'Aprano >> >> > >> wrote: >> >> inshu chauhan wrote: >> >> > In the programme below I am trying to rea

Re: Error in reading and writing CSV format file in python

2013-02-11 Thread MRAB
On 2013-02-11 12:44, inshu chauhan wrote: On Mon, Feb 11, 2013 at 1:26 PM, Steven D'Aprano mailto:steve+comp.lang.pyt...@pearwood.info>> wrote: inshu chauhan wrote: > In the programme below I am trying to read two csv format files and > process them and write a new file with some

Re: LangWart: Method congestion from mutate multiplicty

2013-02-11 Thread Rick Johnson
On Sunday, February 10, 2013 6:36:20 PM UTC-6, Steven D'Aprano wrote: > Rick Johnson wrote: > > On Sunday, February 10, 2013 5:29:54 AM UTC-6, Steven D'Aprano wrote: > >> Rick wrote: > > [...] > > Steven, the definition of flatten (as relates to sequences) is very, VERY > > simple: > > > > Ret

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Chris Angelico
On Mon, Feb 11, 2013 at 11:28 PM, Rick Johnson wrote: > On Saturday, February 9, 2013 11:04:42 PM UTC-6, Chris Angelico wrote: >> On Sun, Feb 10, 2013 at 3:54 PM, Rick Johnson wrote: >> > Well Chris i have wonderful news for you! Python /does/ >> > have "homogenous arrays", and they're called, wai

Re: Error in reading and writing CSV format file in python

2013-02-11 Thread inshu chauhan
On Mon, Feb 11, 2013 at 1:26 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > inshu chauhan wrote: > > > In the programme below I am trying to read two csv format files and > > process them and write a new file with some of theirs data. > > > > import csv > > f1_reader = csv.re

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Chris Angelico
On Mon, Feb 11, 2013 at 11:18 PM, Rick Johnson wrote: > On Sunday, February 10, 2013 5:37:46 AM UTC-6, Steven D'Aprano wrote: >> Rick Johnson wrote: >> > IMO "Set Types" should only exists as a concequence of "freezing" an >> > array, >> >> Sets are not frozen lists. > > Indeed. That wording was a

Re: Error in reading and writing CSV format file in python

2013-02-11 Thread Steven D'Aprano
inshu chauhan wrote: > In the programme below I am trying to read two csv format files and > process them and write a new file with some of theirs data. > > import csv > f1_reader = csv.reader(open(r"Z:\Weka > work\Feature_Vectors_Fullset_00.arff")) > f2_reader = csv.reader(open(r"Z:\Weka > work\

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Rick Johnson
On Saturday, February 9, 2013 11:04:42 PM UTC-6, Chris Angelico wrote: > On Sun, Feb 10, 2013 at 3:54 PM, Rick Johnson wrote: > > Well Chris i have wonderful news for you! Python /does/ > > have "homogenous arrays", and they're called, wait for > > it. arrays! > That's not a built-in. But

Re: Import redirects

2013-02-11 Thread Oscar Benjamin
On 11 February 2013 06:50, Isaac To wrote: > I have a package (say "foo") that I want to rename (say, to "bar"), and for > compatibility reasons I want to be able to use the old package name to refer > to the new package. Copying files or using filesystem symlinks is probably > not the way to go,

Re: Error in reading and writing CSV format file in python

2013-02-11 Thread MRAB
On 2013-02-11 11:00, inshu chauhan wrote: In the programme below I am trying to read two csv format files and process them and write a new file with some of theirs data. import csv f1_reader = csv.reader(open(r"Z:\Weka work\Feature_Vectors_Fullset_00.arff")) f2_reader = csv.reader(open(r"Z:\Weka

Re: Implicit conversion to boolean in if and while statements

2013-02-11 Thread Rick Johnson
On Sunday, February 10, 2013 5:37:46 AM UTC-6, Steven D'Aprano wrote: > Rick Johnson wrote: > > IMO "Set Types" should only exists as a concequence of "freezing" an > > array, > > Sets are not frozen lists. Indeed. That wording was a bit clumsy on my part. > > and should have NO literal syntax a

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 22:42:50 +1100, Chris Angelico wrote: >It's entirely possible you have a third Python, a 3.x, as well. >Different Pythons coexist quite happily on a system. Thank for the help. I'm on my way to figure out how mod_fcgid, Flup, and Python scripts work together. -- http://mail.p

Re: LangWart: Method congestion from mutate multiplicty

2013-02-11 Thread Tim Chase
On Mon, 11 Feb 2013 18:24:05 +1100 Chris Angelico wrote: > Is that Unicode string theory or ASCII string theory? +1 QOTW :-) -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Chris Angelico
On Mon, Feb 11, 2013 at 10:36 PM, Gilles wrote: > On Mon, 11 Feb 2013 22:30:45 +1100, Chris Angelico > wrote: >>Try running python2.6 -V >> >>Your shebang line says that it's looking for a program named >>"python2.6", which is quite probably not the same as the one named >>just "python". > > Inde

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 22:30:45 +1100, Chris Angelico wrote: >Try running python2.6 -V > >Your shebang line says that it's looking for a program named >"python2.6", which is quite probably not the same as the one named >just "python". Indeed, they have two versions of Python installed: # python2.6

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Chris Angelico
On Mon, Feb 11, 2013 at 10:22 PM, Gilles wrote: > On Mon, 11 Feb 2013 21:30:12 +1100, Chris Angelico > wrote: >>That'll catch some forms of error, but not everything. You may also >>want to consider looking for your server's error log - that may be >>getting the actual traceback. I don't know wha

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 21:30:12 +1100, Chris Angelico wrote: >That'll catch some forms of error, but not everything. You may also >want to consider looking for your server's error log - that may be >getting the actual traceback. I don't know what your server setup is, >but there's likely to be one so

Error in reading and writing CSV format file in python

2013-02-11 Thread inshu chauhan
In the programme below I am trying to read two csv format files and process them and write a new file with some of theirs data. import csv f1_reader = csv.reader(open(r"Z:\Weka work\Feature_Vectors_Fullset_00.arff")) f2_reader = csv.reader(open(r"Z:\Weka work\Feature_Vectors_Fullset_00_noxy+class.

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Chris Angelico
On Mon, Feb 11, 2013 at 8:39 PM, Gilles wrote: > On Mon, 11 Feb 2013 10:30:01 +0100, Gilles wrote: >> I have a couple of newbie questions about using Python in a FastCGI >>+ Flup context on a shared CentOS server: > > Please ignore the thread. I found the error, and a way to catch > compile

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 10:30:01 +0100, Gilles wrote: > I have a couple of newbie questions about using Python in a FastCGI >+ Flup context on a shared CentOS server: Please ignore the thread. I found the error, and a way to catch compile-time errors (log on through SSH, and run "python ./myscr

[2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
Hello I have a couple of newbie questions about using Python in a FastCGI + Flup context on a shared CentOS server: 1. The following script runs fine... = #!/usr/bin/env python2.6 def myapp(environ, start_response): start_response('200 OK', [('Content-Type