A play about the Indian IT industry
My name is Sathyaish. I am a software engineer. Last year, i.e. in 2011, I wanted to do some theater. No one took me, so I announced that I would start my own group. I wrote a script. Then, I wrote a screen play from that. Now, I am almost ready to begin the auditions. The play will be a comedy with a sad undertone profiling the life (or rather the lack) of programmers and how they are generally taken for granted and treated poorly by people who should really have been working in a bread making factory baking bread, or people who should have been making biscuits or whatever, i.e. the non-technical people in the software development industry who have become managers and architects and what-not. Here is a teaser: http://www.youtube.com/watch?v=6V-Lchu7aiA I hope you like it. I'll be posting more stuff about this play on the Web page at http://sathyaish.net/acting The play will be performed at a theater in New Delhi, India. The group that I am organizing to perform this play will rehearse only over weekends so that they may keep their day jobs. I expect that the auditions will run through April 2012. We will start rehearsing in May 2012 and will carry on with the rehearsals for May, June, July, August and September 2012 only over the weekends. We should perform in the last week of September 2012 or some time in October 2012. -- http://mail.python.org/mailman/listinfo/python-list
Re: in-place string reversal
>But what's got that to do with it? Strings are very mutable in C. I realized after posting that I'd said something incorrect again. The concept of "mutability" itself is a high-level concept compared to C. Memory allocation for strings is expensive because of the way malloc() works to find a "best-fit" against a "first-fit" in traditional memory management systems. Because of the performance hit, high level languages and frameworks, such as the Common Type System of the .NET Framework for example, considers strings as immutable. That, unlike Python, doesn't however, make them impossible to modify in-place. -- http://mail.python.org/mailman/listinfo/python-list
Re: in-place string reversal
And that the "extra-memory" operation I've given above is expensive, I believe. Is there an efficient way to do it? -- http://mail.python.org/mailman/listinfo/python-list
in-place string reversal
How would you reverse a string "in place" in python? I am seeing that there are a lot of operations around higher level data structures and less emphasis on primitive data. I am a little lost and can't find my way through seeing a rev() or a reverse() or a strRev() function around a string object. I could traverse from end-to-beginning by using extra memory: strText = "foo" strTemp = "" for chr in strText: strTemp = chr + strTemp but how would I do it in place? Forget it! I got the answer to my own question. Strings are immutable, *even* in python. Why not! The python compiler is written in C, right? It is amazing how just writing down your problem can give you a solution. PS: Or, if my assumption that strings are immutable and an in-place reversal is possible, is wrong, please correct me. -- http://mail.python.org/mailman/listinfo/python-list
Re: Chained Comparisons
Thanks for the encouragement, Steve. I am learning Python out of earnest; I am intrigued by several languages such as Ruby, Python and Lisp. At work, I program VB6 (used to), VB.NET, C# and C over the Win32 platform. > that Sathyaish's time is more important than your time, of course. LOL. Certainly didn't mean that. :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: ** Operator
Thanks very much for helping out, Christopher. -- http://mail.python.org/mailman/listinfo/python-list
Re: Chained Comparisons
Thanks, Peter. I do use the interpreter alongside while reading the documentation and also try out the examples. It was just a matter of chance that for this particular situation, I did not. Thank you for the answers, everyone. I hope I am still welcome here for more questions. -- http://mail.python.org/mailman/listinfo/python-list
Re: Chained Comparisons
OK, I get it. Just stop whining endlessly about it, guys. I *do* use the interpreter. I posted a question here. Sorry, I committed a sin. -- http://mail.python.org/mailman/listinfo/python-list
Re: Chained Comparisons
>And firing up a news client, posting a message, and /waiting/ for a response isn't? In most cases, you could have read half the language reference manual in the time it takes to get an online response. No, it isn't because you continue reading the same stuff and you have the stuff open in another window at the same point you left reading it. That point is not lost. Posting a question in the newsgroup is like asking someone else; asking some other person to help you out and it works better than searching the documentation and loosing your train of thought. Besides, one doesn't stop reading the help file after posting a question on the newsgroup until the answer comes. The reading goes on. >and what exactly do you think the other people in the forum do? They go off and read the documentation so that they can be sure to quote it back accurately to you. So you've saved yourself the bother of looking up the docs just so that a large number of people can all do it for you. No, I see the people in this forum engage in trivia instead of understanding a beginner's anxiety, they engage in these flame wars on trivial issues. OK, let me calm down. People here are helpful, too. Python is a new language for me. I've been programming for over eight years now and have been there, done that on other forums where I saw a beginner. Sometimes, a few posts as a beginner can be a bitch. >I've tried reading this several times and can't make sense of what you are >trying to say? http://www.joelonsoftware.com/articles/fog22.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Chained Comparisons
John, I did "guess" but I wasn't quite sure and so I asked. OK, I did not perform a search on the docs, but that was because: 1) It is easier to learn through an interactive medium like a forum; and 2) A search in the same document you are reading takes you "off" and "adrift", and as such, is equivalant to a task-switch, because you're already reading some material from the same help file and are stuck at some point. Thanks for the help. -- http://mail.python.org/mailman/listinfo/python-list
Re: ** Operator
Thanks, Alex. -- http://mail.python.org/mailman/listinfo/python-list
Re: ** Operator
Thanks, Alex. -- http://mail.python.org/mailman/listinfo/python-list
Chained Comparisons
I) What does the following expression evaluate to? a < b == c 1) (a < b) and (b == c) 2) (a < b) or (b == c) II) How many operands can be chained for comparison in a single expression? For e.g, is the under-stated expression a valid comparison chain? a < b == c > d -- http://mail.python.org/mailman/listinfo/python-list
Re: ** Operator
I tried it on the interpreter and it looks like it is the "to the power of" operator symbol/function. Can you please point me to the formal definition of this operator in the docs? -- http://mail.python.org/mailman/listinfo/python-list
** Operator
In the example below from the python docs (http://docs.python.org/tut/node7.html#SECTION00714), I am not able to understand the ** operator in the following expression: >>> [(x, x**2) for x in vec] I understand the list comprehension as a whole but have forgotten the ** operator's use. Can someone please guide me. -- http://mail.python.org/mailman/listinfo/python-list
Re: Environmental Variables
I recall now, the shells in Unix - a child inherited the variables declared in its parent but not vice-versa. It works the same way in DOS. So, I wasn't seeing it clearly earlier. I am seeing it clearly now. I was imagining that the PYTHONPATH had some default value on installation and was expecting to see it. And since it was an *environmental* variable I was setting, I just expected it to turn up in the entire environment, totally forgetting the scope of the environment I was declaring it in - a process and not an OS. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: Environmental Variables
Thanks for the replies. I am trying to have a startup file execute everytime I launch the interpreter. So, for a test, I wrote a small file I called "Sathyaish.py". The contents of the file were simply: # ! This is my new start-up file. print "Sathyaish is the best." Then, in the interpreter, on its prompt, I said: >>> os.environ['PYTHONSTARTUP'] = 'C:\\Sathyaish.py' >>> It didn't complain. I tested it immediately. On the same interpreter instance, I said: >>> import os >>> os.environ.get('PYTHONSTARTUP') It gave me back 'C:\Sathyaish.py'. I didn't close that interpreter. I left it open and launched a new instance of the interpreter. In this I queried the same: >>> import os >>> os.environ.get('PYTHONSTARTUP') None was what I got. I checked the at DOS prompt (cmd) for PYTHONSTARTUP, and I got an 'unrecognized program/command/batch file' interrupt. What's the deal with environmental variables? Are they specific to an interpreter session? That shouldn't be. -- http://mail.python.org/mailman/listinfo/python-list
Environmental Variables
In which physical file are the python environmental variables located? I know I can access them using the: os.environ.get('PYTHONSTARTUP') or os.environ.get('PYTHONPATH') to get their values. But out of the program, if I need to look at them and alter their values, where do I find them? Are they the OS environmental variables as I suspect? If they are, then I'll find them with the other OS environ variables in My Computer->System->Properties->Advanced->Environmental Variables. But I checked that place and did not find any default values for them. -- http://mail.python.org/mailman/listinfo/python-list
Re: How is wxWindows related to Python?
Thanks, guys. -- http://mail.python.org/mailman/listinfo/python-list
How is wxWindows related to Python?
My question will sound daft to the good old craftsmen, but they will excuse my nescience on the subject. I come new to the Pythonic world from the land of .NET languages, VB6 and some familiarity in C and C++. I just read about wxWindows last night. From my understanding, it is a GUI framework like MFC that lets you create UI apps with ease calling a standard set of API accross multiple platforms (unlike MFC) and if the Windows port is complementary to MFC in that it shields you from calling the Win32 API directly. However, I do not understand its correlation with Python. The documentation page says, "wxWindows 2.4.2: A portable C++ and Python GUI toolkit." So, my question is, "How is wxWindows related to Python?" -- http://mail.python.org/mailman/listinfo/python-list