Re: Can't import modules

2012-09-30 Thread cjgohlke
On Sunday, September 30, 2012 5:35:02 PM UTC-7, Peter Farrell wrote: > Thanks for trying to help, everybody. Sorry I didn't post the whole error > message. Now my problem is I just installed VPython and I'm trying to run the > very first example, bounce.py which I located. I opened it and ran it

Re: "#!/usr/bin/env python" vs. "#!/usr/bin/python"?

2012-09-30 Thread Matej Cepl
On 28/09/12 12:57, Roy Smith wrote: > But, you might as well get into the habit of > using the /usr/bin/env flavor because it's more flexible. In the same manner as one's freedom-fighter is another's fundamentalist terrorist, what's flexible could be also dangerous. E.g., #!/usr/bin/env python

Re: Can't import modules

2012-09-30 Thread Peter Farrell
On Sunday, September 30, 2012 8:19:28 PM UTC-7, Dave Angel wrote: > On 09/30/2012 09:35 PM, Peter Farrell wrote: > > > On Sunday, September 30, 2012 6:25:29 PM UTC-7, Steven D'Aprano wrote: > > >> On Sun, 30 Sep 2012 17:35:02 -0700, Peter Farrell wrote: > > >> > > >> > > >> > > >>> Thanks for

Re: parse an environment file

2012-09-30 Thread Chris Angelico
On Mon, Oct 1, 2012 at 10:11 AM, Jason Friedman wrote: > $ env > > produces about 100 entries, most of which are provided by my .bashrc; > cron provides only a limited number of environment variables. > > I want my python 3.2.2 script, called via cron, to know what those > additional variables are

Re: Coexistence of Python 2.x and 3.x on same OS

2012-09-30 Thread Dave Angel
On 09/30/2012 11:06 PM, Edward Diener wrote: > On 9/30/2012 3:38 PM, Andrew Berg wrote: >> On 2012.09.30 14:14, Edward Diener wrote: >>> The situation is so confusing on Windows, where the file associations, >>> registry entries, and other internal software which allows a given >>> Python release t

Re: Coexistence of Python 2.x and 3.x on same OS

2012-09-30 Thread Andrew Berg
On 2012.09.30 22:06, Edward Diener wrote: > The problem with that is that one has to already being using 3.3 to use > this facility. I was hoping for a solution which was backwards > compatible with Python 2.x. It's a separate tool that comes with 3.3. You can install 3.3 and never use the actual

Re: Can't import modules

2012-09-30 Thread Dave Angel
On 09/30/2012 09:35 PM, Peter Farrell wrote: > On Sunday, September 30, 2012 6:25:29 PM UTC-7, Steven D'Aprano wrote: >> On Sun, 30 Sep 2012 17:35:02 -0700, Peter Farrell wrote: >> >> >> >>> Thanks for trying to help, everybody. Sorry I didn't post the whole >>> error message. Now my problem is I j

Re: Can't import modules

2012-09-30 Thread Dwight Hutto
On Sun, Sep 30, 2012 at 10:48 PM, Dwight Hutto wrote: > Plus from What's New From Python 3", which are things you should be > able to change comes: > > http://docs.python.org/release/3.0.1/whatsnew/3.0.html > > Change the module yourself. > > And, of course: http://docs.python.org/library/2to3.h

Re: Coexistence of Python 2.x and 3.x on same OS

2012-09-30 Thread Edward Diener
On 9/30/2012 3:38 PM, Andrew Berg wrote: On 2012.09.30 14:14, Edward Diener wrote: The situation is so confusing on Windows, where the file associations, registry entries, and other internal software which allows a given Python release to work properly when invoking Python is so complicated, tha

Re: Can't import modules

2012-09-30 Thread Dwight Hutto
Plus from What's New From Python 3", which are things you should be able to change comes: http://docs.python.org/release/3.0.1/whatsnew/3.0.html Change the module yourself. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-lis

Re: Can't import modules

2012-09-30 Thread Dwight Hutto
On Sun, Sep 30, 2012 at 10:15 PM, Steven D'Aprano wrote: > On Sun, 30 Sep 2012 18:35:50 -0700, Peter Farrell wrote: > >> Since I use Python 3.2.3 I've had trouble with programs and modules >> designed for Python 2 and many programs don't work on my 64-bit system. > > While Python tries very hard t

Re: Can't import modules

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 18:35:50 -0700, Peter Farrell wrote: > Since I use Python 3.2.3 I've had trouble with programs and modules > designed for Python 2 and many programs don't work on my 64-bit system. While Python tries very hard to be backward compatible, the transition from the 2.x series to t

Re: Can't import modules

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 18:35:50 -0700, Peter Farrell wrote: > Since I use Python 3.2.3 I've had trouble with programs and modules > designed for Python 2 and many programs don't work on my 64-bit system. While Python tries very hard to be backward compatible, the transition from the 2.x series to t

Re: Compairing filenames in a list

2012-09-30 Thread Joshua Landau
On 30 September 2012 23:08, Arnaud Delobelle wrote: > On 30 September 2012 02:27, Kevin Anthony > wrote: > > I have a list of filenames, and i need to find files with the same name, > > different extensions, and split that into tuples. does anyone have any > > suggestions on an easy way to do t

Re: Can't import modules

2012-09-30 Thread Peter Farrell
On Sunday, September 30, 2012 6:25:29 PM UTC-7, Steven D'Aprano wrote: > On Sun, 30 Sep 2012 17:35:02 -0700, Peter Farrell wrote: > > > > > Thanks for trying to help, everybody. Sorry I didn't post the whole > > > error message. Now my problem is I just installed VPython and I'm trying > > > t

Re: Can't import modules

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 17:35:02 -0700, Peter Farrell wrote: > Thanks for trying to help, everybody. Sorry I didn't post the whole > error message. Now my problem is I just installed VPython and I'm trying > to run the very first example, bounce.py which I located. I opened it > and ran it in Idle. I

Re: Can't import modules

2012-09-30 Thread Joshua Landau
On 1 October 2012 01:35, Peter Farrell wrote: > Thanks for trying to help, everybody. Sorry I didn't post the whole error > message. Now my problem is I just installed VPython and I'm trying to run > the very first example, bounce.py which I located. I opened it and ran it > in Idle. I got this m

Re: parse an environment file

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 18:11:09 -0600, Jason Friedman wrote: > $ crontab -l > * * * * * env > > This produces mail with the following contents: [snip] Yes, env returns the environment variables of the current environment. > On the other hand > > $ env > > produces about 100 entries, most of whi

Re: Can't import modules

2012-09-30 Thread Dave Angel
On 09/30/2012 08:35 PM, Peter Farrell wrote: You top-posted, which means there's no context; the message is now out of order. Please put your responses after the parts you're quoting, or don't bother quoting. > Thanks for trying to help, everybody. Sorry I didn't post the whole error > message

Re: Slicing iterables in sub-generators without loosing elements

2012-09-30 Thread 88888 Dihedral
On Sunday, September 30, 2012 12:15:57 AM UTC+8, Thomas Bach wrote: > Hi, > > > > say we have the following: > > > > >>> data = [('foo', 1), ('foo', 2), ('bar', 3), ('bar', 2)] > > > > is there a way to code a function iter_in_blocks such that > > > > >>> result = [ list(block) for bloc

Re: parse an environment file

2012-09-30 Thread Dave Angel
On 09/30/2012 08:11 PM, Jason Friedman wrote: First comment: I don't know anything about an "environment file." An environment is an attribute of a process, and it's inherited by subprocesses that process launches. This is not a Python thing, it's an OS thing, for whatever OS you're running. >

Re: Can't import modules

2012-09-30 Thread Peter Farrell
Thanks for trying to help, everybody. Sorry I didn't post the whole error message. Now my problem is I just installed VPython and I'm trying to run the very first example, bounce.py which I located. I opened it and ran it in Idle. I got this message: Traceback (most recent call last): File "C

parse an environment file

2012-09-30 Thread Jason Friedman
$ crontab -l * * * * * env This produces mail with the following contents: HOME=/home/spjsf LOGNAME=spjsf PATH=/usr/bin:/bin PWD=/home/spjsf SHELL=/bin/sh SHLVL=1 USER=spjsf _=/usr/bin/env On the other hand $ env produces about 100 entries, most of which are provided by my .bashrc; cron provid

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 18:17:17 -0400, Roy Smith wrote: > In article > <4806a0b7-818a-4844-8286-f1b891a3c...@rj6g2000pbc.googlegroups.com>, > rusi wrote: > >> Here's a test to help you decide: How do you respond to the word >> 'magic'? If positive you will like Ruby, if not you may prefer Python.

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Chris Angelico
On Mon, Oct 1, 2012 at 8:14 AM, Roy Smith wrote: > Yeah, that's a problem. There's nothing fundamental about a TCP > connection endpoint which precludes it being serialized and passed > around. The amount of state involved is pretty small. Unless I've > forgotten something, 2 IP addresses, 2 po

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Roy Smith
In article <4806a0b7-818a-4844-8286-f1b891a3c...@rj6g2000pbc.googlegroups.com>, rusi wrote: > Here's a test to help you decide: How do you respond to the word > 'magic'? If positive you will like Ruby, if not you may prefer > Python. Some might say that magic underscores a lot of the really

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Roy Smith
In article , Chris Angelico wrote: > you can't, for instance, retain a "socket connection object" across > that sort of reload. Yeah, that's a problem. There's nothing fundamental about a TCP connection endpoint which precludes it being serialized and passed around. The amount of state inv

Re: Compairing filenames in a list

2012-09-30 Thread Arnaud Delobelle
On 30 September 2012 02:27, Kevin Anthony wrote: > I have a list of filenames, and i need to find files with the same name, > different extensions, and split that into tuples. does anyone have any > suggestions on an easy way to do this that isn't O(n^2)? >>> import os, itertools >>> filenames =

Re: Can't import modules

2012-09-30 Thread Hans Mulder
On 30/09/12 21:42:37, Peter Farrell wrote: > I'm still new to Python, so here's another easy one. After I save something > I've done as a .py file, how do I import it into something else I work on? > Every time I try to import something other than turtle or math, I get this > error message: > > '

Re: Can't import modules

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 12:42:37 -0700, Peter Farrell wrote: > Hello! > > I'm still new to Python, so here's another easy one. After I save > something I've done as a .py file, how do I import it into something > else I work on? Every time I try to import something other than turtle > or math, I get

Re: Can't import modules

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 12:42:37 -0700, Peter Farrell wrote: > Hello! > > I'm still new to Python, so here's another easy one. After I save > something I've done as a .py file, how do I import it into something > else I work on? Every time I try to import something other than turtle > or math, I get

Re: Can't import modules

2012-09-30 Thread Benjamin Kaplan
On Sun, Sep 30, 2012 at 12:42 PM, Peter Farrell wrote: > Hello! > > I'm still new to Python, so here's another easy one. After I save something > I've done as a .py file, how do I import it into something else I work on? > Every time I try to import something other than turtle or math, I get thi

Can't import modules

2012-09-30 Thread Peter Farrell
Hello! I'm still new to Python, so here's another easy one. After I save something I've done as a .py file, how do I import it into something else I work on? Every time I try to import something other than turtle or math, I get this error message: 'module' object is not callable What am I doi

Re: Coexistence of Python 2.x and 3.x on same OS

2012-09-30 Thread Andrew Berg
On 2012.09.30 14:14, Edward Diener wrote: > The situation is so confusing on Windows, where the file associations, > registry entries, and other internal software which allows a given > Python release to work properly when invoking Python is so complicated, > that I have given up on trying to in

Coexistence of Python 2.x and 3.x on same OS

2012-09-30 Thread Edward Diener
Has there been any official software that allows both the Python 2.x and 3.x releases to coexist on the same OS so that the end-user can easily switch between them when invoking Python scripts after each has been installed to their own directories/folders ? I know of some unoffical solutions,

Re: [Python-Dev] experimental: Misc/NEWS included in docs

2012-09-30 Thread Chris Jerdonek
On Sun, Sep 30, 2012 at 6:17 AM, Georg Brandl wrote: > at http://docs.python.org/3.3/whatsnew/news.html, there is now > a rendering of Misc/NEWS with tracker links and a crude filtering > capability. I thought that this will complement the "whatsnew" > documents nicely for people looking for more

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Joshua Landau
On 30 September 2012 13:58, tcgo wrote: > Hi! > I'm really new to Usenet/Newsgroups, but... I'd like to learn some new > programming language, because I learnt a bit of Perl though its OOP is > ugly. So, after searching a bit, I found Python and Ruby, and both of them > are cute. > So, assuming y

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Mark Lawrence
On 30/09/2012 13:58, tcgo wrote: Hi! I'm really new to Usenet/Newsgroups, but... I'd like to learn some new programming language, because I learnt a bit of Perl though its OOP is ugly. So, after searching a bit, I found Python and Ruby, and both of they are cute. So, assuming you'll say me "lea

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Chris Angelico
On Mon, Oct 1, 2012 at 1:01 AM, Roy Smith wrote: > Well, more strictly, what you need is to keep your state somewhere else. > Doesn't have to be on disk. Could be in memory, if that memory belongs > to another process (memcache, redis, or any of a number of in-memory > databases). Sure. I'll gen

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread rusi
On Sep 30, 5:58 pm, tcgo wrote: > Hi! > I'm really new to Usenet/Newsgroups, but... I'd like to learn some new > programming language, because I learnt a bit of Perl though its OOP is ugly. > So, after searching a bit, I found Python and Ruby, and both of they are cute. > So, assuming you'll say

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Oct 1, 2012 at 12:23 AM, Roy Smith wrote: > > In article , > > Chris Angelico wrote: > > > >> there's no efficient and reliable way to change/reload code in a > >> running application (not often an issue). > > > > What we do (largely cribbed from d

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Chris Angelico
On Mon, Oct 1, 2012 at 12:35 AM, Chris Angelico wrote: > What I'm talking about is > having a single process that never terminates, never stops accepting > connections, but at some point new connections begin to be served with > new code... And to clarify, only the code that needs updating gets u

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Chris Angelico
On Mon, Oct 1, 2012 at 12:23 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> there's no efficient and reliable way to change/reload code in a >> running application (not often an issue). > > What we do (largely cribbed from django's runserver) is start up a > thread which once a

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Roy Smith
In article , Chris Angelico wrote: > there's no efficient and reliable way to change/reload code in a > running application (not often an issue). What we do (largely cribbed from django's runserver) is start up a thread which once a second, looks at all the modules in sys.modules, checks to

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Rodrick Brown
On Sun, Sep 30, 2012 at 8:58 AM, tcgo wrote: > Hi! > I'm really new to Usenet/Newsgroups, but... I'd like to learn some new > programming language, because I learnt a bit of Perl though its OOP is > ugly. So, after searching a bit, I found Python and Ruby, and both of they > are cute. > So, assum

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Tim Chase
On 09/30/12 07:58, tcgo wrote: > So, assuming you'll say me "learn python", why should I learn it > over Ruby? For me, most of Chris's answers apply to both Python and Ruby. Well, I can't speak regarding the Ruby community being as awesome, but it doesn't seem to scare off folks. *READABILITY* is

Re: Can somebody give me an advice about what to learn?

2012-09-30 Thread Chris Angelico
On Sun, Sep 30, 2012 at 10:58 PM, tcgo wrote: > Hi! > I'm really new to Usenet/Newsgroups, but... I'd like to learn some new > programming language, because I learnt a bit of Perl though its OOP is ugly. > So, after searching a bit, I found Python and Ruby, and both of they are cute. > So, assum

Re: [RELEASED] Python 3.3.0

2012-09-30 Thread Georg Brandl
On 09/29/2012 06:53 PM, Antoine Pitrou wrote: Hello, I've created a 3.3 category on the buildbots: http://buildbot.python.org/3.3/ http://buildbot.python.org/3.3.stable/ Someone will have to update the following HTML page: http://python.org/dev/buildbot/ Should be done now. Georg -- http:

Can somebody give me an advice about what to learn?

2012-09-30 Thread tcgo
Hi! I'm really new to Usenet/Newsgroups, but... I'd like to learn some new programming language, because I learnt a bit of Perl though its OOP is ugly. So, after searching a bit, I found Python and Ruby, and both of they are cute. So, assuming you'll say me "learn python", why should I learn it o

Re: python file API

2012-09-30 Thread Ramchandra Apte
On Tuesday, 25 September 2012 03:05:16 UTC+5:30, zipher wrote: > For some time now, I've wanted to suggest a better abstraction for the > type in Python. It currently uses an antiquated C-style interface for moving > around in a file, with methods like tell() and seek(). But after attributes

Re: Should one always add super().__init__() to the __init__?

2012-09-30 Thread Manuel Pégourié-Gonnard
Steven D'Aprano scripsit : > On Sun, 30 Sep 2012 00:08:03 -0600, Ian Kelly wrote: > >> On Sat, Sep 29, 2012 at 10:40 PM, Steven D'Aprano >> wrote: >>> On Sat, 29 Sep 2012 17:51:29 -0400, Piet van Oostrum wrote: >>> It is not necesarily calling the parent class. It calls the initializer

Re: Missing library path (WIndows)

2012-09-30 Thread Kwpolska
On Sat, Sep 29, 2012 at 10:32 PM, FPEFPE wrote: > On Saturday, September 29, 2012 4:02:13 AM UTC-4, Kwpolska wrote: >> >> Python has problems with encoding the arguments to look properly with >> >> the crappy Windows cmd.exe encodings. They cannot be encoded for some >> >> reason. You may need ma

Re: How to get progress in python script.

2012-09-30 Thread Oscar Benjamin
On 28 September 2012 17:26, Rolando Cañer Roblejo wrote: > Hi all, > > Please, I need you suggest me a way to get statistics about a progress of > my python script. My python script could take a lot of time processing a > file, so I need a way that an external program check the progress of the > s

Re: Should one always add super().__init__() to the __init__?

2012-09-30 Thread Steven D'Aprano
On Sun, 30 Sep 2012 00:08:03 -0600, Ian Kelly wrote: > On Sat, Sep 29, 2012 at 10:40 PM, Steven D'Aprano > wrote: >> On Sat, 29 Sep 2012 17:51:29 -0400, Piet van Oostrum wrote: >> >>> It is not necesarily calling the parent class. It calls the >>> initializer of the next class in the MRO order an

Re: How to investigate web script not running?

2012-09-30 Thread Gilles
On Sat, 29 Sep 2012 10:05:25 -0700 (PDT), Ramchandra Apte wrote: >> Definitely not plug 'n play :-/ > >Well the plug and play standard is superseded by USB practically. Indeed ;-) Anyway, Support finally got back to me, and it turns out that they have Flup alreay installed on shared hosts, so I