Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Steven D'Aprano
On Thu, 06 Jan 2011 21:05:10 -0800, Chris Rebert wrote: > On Thu, Jan 6, 2011 at 8:00 PM, Erwin Mueller > wrote: >> On Thursday 06 January 2011 21:23:57 Robert Kern wrote: >> > On 1/6/11 12:43 PM, Erwin Mueller wrote: >> > > On Thursday 06 January 2011 16:28:49 dmitrey wrote: >> > >> hi all, >> >

Re: python only prints integers

2011-01-06 Thread Steven D'Aprano
On Fri, 07 Jan 2011 03:32:54 +, Edward A. Falk wrote: > In article > , Ian > wrote: >> >>In Python 3, the '/' operator always performs true division. > > How can I get integer division? >>> 25//4 6 -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Chris Rebert
On Thu, Jan 6, 2011 at 8:00 PM, Erwin Mueller wrote: > On Thursday 06 January 2011 21:23:57 Robert Kern wrote: > > On 1/6/11 12:43 PM, Erwin Mueller wrote: > > > On Thursday 06 January 2011 16:28:49 dmitrey wrote: > > >> hi all, > > >> I have th PEP (I'm not sure something like that hadn't been pr

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Erwin Mueller
On Thursday 06 January 2011 21:23:57 Robert Kern wrote: > On 1/6/11 12:43 PM, Erwin Mueller wrote: > > On Thursday 06 January 2011 16:28:49 dmitrey wrote: > >> hi all, > >> I have th PEP (I'm not sure something like that hadn't been proposed > >> although): > >> very often in a Python file header t

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Erwin Mueller
On Thursday 06 January 2011 21:23:57 Robert Kern wrote: > On 1/6/11 12:43 PM, Erwin Mueller wrote: > > On Thursday 06 January 2011 16:28:49 dmitrey wrote: > >> hi all, > >> I have th PEP (I'm not sure something like that hadn't been proposed > >> although): > >> very often in a Python file header t

Re: python only prints integers

2011-01-06 Thread Noah Hall
On Fri, Jan 7, 2011 at 3:32 AM, Edward A. Falk wrote: > In article < > cd9d1c80-b1d2-4d20-9896-a6fd77bd7...@j25g2000yqa.googlegroups.com>, > Ian wrote: > > > >In Python 3, the '/' operator always performs true division. > > How can I get integer division? > > -- >-Ed Falk, f...@despams.

Re: python only prints integers

2011-01-06 Thread Edward A. Falk
In article , Ian wrote: > >In Python 3, the '/' operator always performs true division. How can I get integer division? -- -Ed Falk, f...@despams.r.us.com http://thespamdiaries.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Resolve circular reference

2011-01-06 Thread MRAB
On 07/01/2011 02:24, moerchendiser2k3 wrote: Hi, I have a small problem with circular references. I embedded Python into my app and I have two types which are flagged with Py_TPFLAGS_BASETYPE so I can inherit Python types from these types. Lets call my C types A and B. Here is the dependency:

Resolve circular reference

2011-01-06 Thread moerchendiser2k3
Hi, I have a small problem with circular references. I embedded Python into my app and I have two types which are flagged with Py_TPFLAGS_BASETYPE so I can inherit Python types from these types. Lets call my C types A and B. Here is the dependency: class Foo(A): e=Bar() class Bar(B): d

Re: Trying to decide between PHP and Python

2011-01-06 Thread BartC
"Ben Finney" wrote in message news:87bp3wf3zw@benfinney.id.au... Tomasz Rola writes: Heh. One day, guys, when you have nothing better to do, try writing a parser for Lisp-like language (Common Lisp, Scheme, whatever). After that, do the same with some other language of your preference

Re: Trying to decide between PHP and Python

2011-01-06 Thread geremy condra
On Thu, Jan 6, 2011 at 12:54 PM, John Nagle wrote: > On 1/6/2011 12:41 PM, Chris Rebert wrote: >> >> On Thu, Jan 6, 2011 at 11:11 AM, John Nagle  wrote: >>> >>> On 1/4/2011 12:20 PM, Google Poster wrote: About once a year, I have to learn yet another programming language. Given all

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Steven D'Aprano
On Thu, 06 Jan 2011 09:03:02 -0800, Ian wrote: > On Jan 6, 9:32 am, Tim Harig wrote: >> 2. Your so-called PEP probably clashes with Python's use of @ for >>         decorators. >> >> 3. Do you really expect a language holding the mantra that there should >> be >>         a single way of doing thi

Re: Trying to decide between PHP and Python

2011-01-06 Thread Sol Toure
> > >> > >>> There. Now that I've tossed some gasoline on the language wars fire, > >>> I'll duck and run in the other direction :-) > >> > >> May I suggest a better strategy? Run first, duck next :-). > > > > Or more precisely: > > > > ((run) duck) > > If you're going to mock another language,

Re: python only prints integers

2011-01-06 Thread francesco
On 6 Gen, 23:59, Ian wrote: > On Jan 6, 3:49 pm, francesco wrote: > > > I'm pretty new in Python language. I have a problem with numbers: it > > seems python doesn't know any more how to count! > > I get only the down rounded integer > > 20/8 = 2 > > 8/3=2 > > I probably changed some option to ro

Re: python only prints integers

2011-01-06 Thread kost BebiX
Well, that's because 20 is integer. To get float you can write 20.0 (or 20.). 20.0/8.0 = 2.5 8.0/3.0 = 2.6665 07.01.2011, 00:49, "francesco" : > I'm pretty new in Python language. I have a problem with numbers: it > seems python doesn't know any more how to count! > I get only the down

Re: python only prints integers

2011-01-06 Thread Noah Hall
On Thu, Jan 6, 2011 at 10:49 PM, francesco wrote: > I'm pretty new in Python language. I have a problem with numbers: it > seems python doesn't know any more how to count! > I get only the down rounded integer > 20/8 = 2 > 8/3=2 > I probably changed some option to round the numbers, but I don't >

Re: python only prints integers

2011-01-06 Thread Ian
On Jan 6, 3:49 pm, francesco wrote: > I'm pretty new in Python language. I have a problem with numbers: it > seems python doesn't know any more how to count! > I get only the down rounded integer > 20/8 = 2 > 8/3=2 > I probably changed some option to round the numbers, but I don't > remember how.

Re: python only prints integers

2011-01-06 Thread geremy condra
On Thu, Jan 6, 2011 at 2:49 PM, francesco wrote: > I'm pretty new in Python language. I have a problem with numbers: it > seems python doesn't know any more how to count! > I get only the down rounded integer > 20/8 = 2 > 8/3=2 > I probably changed some option to round the numbers, but I don't > r

python only prints integers

2011-01-06 Thread francesco
I'm pretty new in Python language. I have a problem with numbers: it seems python doesn't know any more how to count! I get only the down rounded integer 20/8 = 2 8/3=2 I probably changed some option to round the numbers, but I don't remember how. Is there a way to reset the number of digits to def

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Alice Bevan–McGregor
On 2011-01-06 11:11:27 -0800, Adam Tauno Williams said: On Thu, 2011-01-06 at 11:07 -0800, Alice Bevan–McGregor wrote: On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a Content-Length header - so you have to generate the enti

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-06 Thread Bill Felton
On Jan 6, 2011, at 3:46 PM, Ned Deily wrote: > In article <775a9d45-25b5-4a16-9fe5-6217fd67f...@cagttraining.com>, > Bill Felton wrote: >> I'm new to python, trying to learn it from a variety of resources, including >> references posted recently to this list. >> I'm going through /www.openbookpr

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-06 Thread Alice Bevan–McGregor
On 2011-01-06 11:44:13 -0800, Bill Felton said: I've also seen various resources indicate that one can install both Python 2.7 and Python 3.1 -- but when I did this, I get no end of problems in the 2.7 install. I have Apple's native Python installations (2.5 and 2.6, I believe), plus Python 2

Rewriting __getattr__

2011-01-06 Thread kost BebiX
Hi everyone! I just saw a bug (?) in bson.dbref:DBRef.__getattr__ Here's they're code:     def __getattr__(self, key):     return self.__kwargs[key] And when you do copy.deepcopy on that object it will raise you KeyError. So here's a small piece of code that reproduces the problem: >>> clas

Re: Trying to decide between PHP and Python

2011-01-06 Thread Kurt Smith
On Thu, Jan 6, 2011 at 3:32 PM, Alan Meyer wrote: > On 1/5/2011 11:40 AM, Tomasz Rola wrote: >> >> On Tue, 4 Jan 2011, Roy Smith wrote: >> >>> There.  Now that I've tossed some gasoline on the language wars fire, >>> I'll duck and run in the other direction :-) >> >> May I suggest a better strateg

Re: Trying to decide between PHP and Python

2011-01-06 Thread Alan Meyer
On 1/5/2011 10:30 AM, Grant Edwards wrote: 1) How often is a compiler for language X written? 2) How often is source code written in language X? 3) How often is that source code in language X read/modified? If you compare those numbers you'll realize that optimizing for case 1 at the ex

Re: Trying to decide between PHP and Python

2011-01-06 Thread Alan Meyer
On 1/5/2011 11:40 AM, Tomasz Rola wrote: On Tue, 4 Jan 2011, Roy Smith wrote: There. Now that I've tossed some gasoline on the language wars fire, I'll duck and run in the other direction :-) May I suggest a better strategy? Run first, duck next :-). Or more precisely: ((run) duck) Al

Re: Which coding style is better? public API or private method inside class definition

2011-01-06 Thread Carey Tilden
On Wed, Jan 5, 2011 at 9:15 AM, Peter Otten <__pete...@web.de> wrote: > Jacek Krysztofik wrote: > > > Sorry for OT, but this is actually a question of mine > >> if numbers % 2 == 0: > > wouldn't the following be faster? > >> if numbers & 1 == 0: > > You can answer t

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-06 Thread Ned Deily
In article <4d261d2e.5070...@verizon.net>, Gerry Reno wrote: > On 01/06/2011 02:44 PM, Bill Felton wrote: [...] > > I've also seen various resources indicate that one can install both Python > > 2.7 and Python 3.1 -- but when I did this, I get no end of problems in the > > 2.7 install. IDLE, i

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Alan Meyer
On 1/6/2011 10:28 AM, dmitrey wrote: > hi all, > I have th PEP (I'm not sure something like that hadn't been proposed > although): > very often in a Python file header the following lines are present, > like: > from MyModule1 import myFunc1 > import MyModule2 as mm2 > from MyModule3 import myFunc3

Re: Trying to decide between PHP and Python

2011-01-06 Thread John Nagle
On 1/6/2011 12:41 PM, Chris Rebert wrote: On Thu, Jan 6, 2011 at 11:11 AM, John Nagle wrote: On 1/4/2011 12:20 PM, Google Poster wrote: About once a year, I have to learn yet another programming language. Given all the recommendations (an outstanding accolade from Bruce Eckel, author of "Thin

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-06 Thread Gerry Reno
On 01/06/2011 02:44 PM, Bill Felton wrote: > Hi All, > I'm new to python, trying to learn it from a variety of resources, including > references posted recently to this list. > I'm going through /www.openbookproject.net/thinkCSpy/ and find it makes use > of gasp, which apparently is not compatibl

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-06 Thread Ned Deily
In article <775a9d45-25b5-4a16-9fe5-6217fd67f...@cagttraining.com>, Bill Felton wrote: > I'm new to python, trying to learn it from a variety of resources, including > references posted recently to this list. > I'm going through /www.openbookproject.net/thinkCSpy/ and find it makes use > of gas

Re: Trying to decide between PHP and Python

2011-01-06 Thread Chris Rebert
On Thu, Jan 6, 2011 at 11:11 AM, John Nagle wrote: > On 1/4/2011 12:20 PM, Google Poster wrote: >> >> About once a year, I have to learn yet another programming language. >> Given all the recommendations (an outstanding accolade from Bruce >> Eckel, author of "Thinking in Java") I have set my aim

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Robert Kern
On 1/6/11 12:43 PM, Erwin Mueller wrote: On Thursday 06 January 2011 16:28:49 dmitrey wrote: hi all, I have th PEP (I'm not sure something like that hadn't been proposed although): very often in a Python file header the following lines are present, like: from MyModule1 import myFunc1 import MyMo

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread dmitrey
On Jan 6, 8:43 pm, Erwin Mueller wrote: > > Why you have several pages of code in the first place? Don't you know that you > can split your code in files? Just a suggestion. > > -- > Erwin Mueller, dev...@deventm.orghttp://www.global-scaling-institute.de/ Erwin, take a look at Python language dev

Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-06 Thread Bill Felton
Hi All, I'm new to python, trying to learn it from a variety of resources, including references posted recently to this list. I'm going through /www.openbookproject.net/thinkCSpy/ and find it makes use of gasp, which apparently is not compatible with 3.1. I've also seen various resources indicate

Re: Trying to decide between PHP and Python

2011-01-06 Thread John Nagle
On 1/4/2011 12:20 PM, Google Poster wrote: About once a year, I have to learn yet another programming language. Given all the recommendations (an outstanding accolade from Bruce Eckel, author of "Thinking in Java") I have set my aim to Python. Sounds kinda cool. If you're just doing simple

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Adam Tauno Williams
On Thu, 2011-01-06 at 11:07 -0800, Alice Bevan–McGregor wrote: > On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: > > > With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a > > Content-Length header - so you have to generate the entire response at > > once [however you want to

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Alice Bevan–McGregor
On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a Content-Length header - so you have to generate the entire response at once [however you want to muddy "at once"]. Both of these statements are false. Streaming responses t

Re: I get an error when I used urllib2.urlopen() to open a remote file in a ftp server

2011-01-06 Thread Ariel
You are right, Thanks. On Thu, Jan 6, 2011 at 12:55 PM, Ian Kelly wrote: > On Thu, Jan 6, 2011 at 10:26 AM, Ariel wrote: > > Hi everybody: > > > > I get an error when I used urllib2.urlopen() to open a remote file in a > ftp > > server, My code is the following: > > > file = 'ftp:/192.168.

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Erwin Mueller
On Thursday 06 January 2011 16:28:49 dmitrey wrote: > hi all, > I have th PEP (I'm not sure something like that hadn't been proposed > although): > very often in a Python file header the following lines are present, > like: > from MyModule1 import myFunc1 > import MyModule2 as mm2 > from MyModule3

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Adam Tauno Williams
On Wed, 2011-01-05 at 14:56 -0800, Alice Bevan–McGregor wrote: > Howdy! > I'm trying to find a templating engine whose templates can be consumed > directly as a WSGI response body iterable. So far I haven't been very > successful with Google; the engines I've found universally generate a > mono

Re: opinion: comp lang docs style

2011-01-06 Thread Xah Lee
On Jan 4, 3:17 pm, "ru...@yahoo.com" wrote: > On 01/04/2011 01:34 PM, Terry Reedy wrote: > > > On 1/4/2011 1:24 PM, an Arrogant Ignoramus wrote: > > > what he called > >> a opinion piece. > > > I normally do not respond to trolls, but while expressing his opinions, > > AI made statements that are

Re: I get an error when I used urllib2.urlopen() to open a remote file in a ftp server

2011-01-06 Thread Ian Kelly
On Thu, Jan 6, 2011 at 10:26 AM, Ariel wrote: > Hi everybody: > > I get an error when I used urllib2.urlopen() to open a remote file in a ftp > server, My code is the following: > file = 'ftp:/192.168.250.14:2180/RTVE/VIDEOS/Thisisit.wmv' Looks to me like you're missing a slash separating th

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Tim Chase
On 01/06/2011 10:32 AM, Tim Harig wrote: 2. Your so-called PEP probably clashes with Python's use of @ for decorators. 3. Do you really expect a language holding the mantra that there should be a single way of doing things to embrace a language bloating feature for what i

I get an error when I used urllib2.urlopen() to open a remote file in a ftp server

2011-01-06 Thread Ariel
Hi everybody: I get an error when I used urllib2.urlopen() to open a remote file in a ftp server, My code is the following: >>> file = 'ftp:/192.168.250.14:2180/RTVE/VIDEOS/Thisisit.wmv' >>> mydata = urllib2.urlopen(file) Traceback (most recent call last): File "", line 1, in File "/usr/lib/

Re: type of methods of builtin exceptions

2011-01-06 Thread Robert Kern
On 1/6/11 10:41 AM, Eva Maia wrote: Hi, anyone has a list of the types of methods of builtin exceptions. For example, for the exception BaseException i need to know the type of arguments method __reduce__ and type of your return. http://docs.python.org/search.html?q=__reduce__&check_keywords=y

Re: Convert arbitrary function inputs to string

2011-01-06 Thread Robert Kern
On 1/6/11 10:42 AM, David Dreisigmeyer wrote: Yes, I'm calling Gambit-C from Python and would like to make this cleaner. Instead of having to do something like: gambit.eval ("(print \"Hello\n\")") I want to do this: gambit.eval (print "Hello\n") so that the expression following gambit.eval

Re: type of methods of builtin exceptions

2011-01-06 Thread Ian
On Jan 6, 9:41 am, Eva Maia wrote: > Hi, > > anyone has a list of the types of methods of builtin exceptions. For > example, for the exception BaseException i need to know the type of   > arguments method __reduce__ and type of your return. http://docs.python.org/library/pickle.html?highlight=__r

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Ian
On Jan 6, 9:32 am, Tim Harig wrote: > 2. Your so-called PEP probably clashes with Python's use of @ for >         decorators. > > 3. Do you really expect a language holding the mantra that there should be >         a single way of doing things to embrace a language bloating feature >         for w

Re: Convert arbitrary function inputs to string

2011-01-06 Thread Ian
On Jan 6, 9:42 am, David Dreisigmeyer wrote: > Yes,  I'm calling Gambit-C from Python and would like to make this > cleaner.  Instead of having to do something like: > > gambit.eval ("(print \"Hello\n\")") > > I want to do this: > > gambit.eval (print "Hello\n") > > so that the expression followin

RE: list from FTP server to a text file

2011-01-06 Thread Ahmed, Shakir
-Original Message- From: python-list-bounces+shahmed=sfwmd@python.org [mailto:python-list-bounces+shahmed=sfwmd@python.org] On Behalf Of Dan M Sent: Thursday, January 06, 2011 11:06 AM To: python-list@python.org Subject: Re: list from FTP server to a text file On Thu, 06 Jan 2011

type of methods of builtin exceptions

2011-01-06 Thread Eva Maia
Hi, anyone has a list of the types of methods of builtin exceptions. For example, for the exception BaseException i need to know the type of arguments method __reduce__ and type of your return. Thanks, Eva Maia -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert arbitrary function inputs to string

2011-01-06 Thread Ian
On Jan 6, 9:23 am, David wrote: > Hi, > > I'd like to have a function that takes arbitrary inputs and returns > them as a single string, with proper escapes for special characters I > can define.  For example: What sorts of arbitrary inputs? Strings? Sequences of strings? Something else? It's

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Mike Kent
On Jan 6, 11:02 am, Duncan Booth wrote: > Your complaint seems to be that: > >    r1 = myFunc1(...) > > is unclear when you don't know where myfunc1 originates, so why don't > you write: > >    r1 = MyModule1.myFunc1(...) > > -- > Duncan Boothhttp://kupuguy.blogspot.com My interpretation of his

Re: Convert arbitrary function inputs to string

2011-01-06 Thread David Dreisigmeyer
Yes, I'm calling Gambit-C from Python and would like to make this cleaner. Instead of having to do something like: gambit.eval ("(print \"Hello\n\")") I want to do this: gambit.eval (print "Hello\n") so that the expression following gambit.eval is a standard scheme expression. On Thu, Jan 6,

Re: Convert arbitrary function inputs to string

2011-01-06 Thread Jean-Michel Pichavant
David wrote: Hi, I'd like to have a function that takes arbitrary inputs and returns them as a single string, with proper escapes for special characters I can define. For example: fun( ( + 1 2 ) ) => "( + 1 2)" or fun( (define (myhello str) (begin (print (string-append "Hello " str)) (newli

Re: find in smartpdf files

2011-01-06 Thread Wanderer
On Jan 6, 11:20 am, Dan M wrote: > On Thu, 06 Jan 2011 08:11:34 -0800, Wanderer wrote: > > We generate PCB assembly files in pdf format using SmartPDF. This allows > > us to search for a component in the assembly using the find feature. We > > would like to be able to generate a list of components

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Tim Harig
On 2011-01-06, dmitrey wrote: [re-ordered] > On Jan 6, 5:57 pm, Tim Harig wrote: >> Python doesn't require imports to be at the top of a file.  They can be >> imported at any time. >> >> > import MyModule >> > (...lots of code...) >> > r = MyModule.myFunc(...) >> >> (...lots of code...) >> import

Convert arbitrary function inputs to string

2011-01-06 Thread David
Hi, I'd like to have a function that takes arbitrary inputs and returns them as a single string, with proper escapes for special characters I can define. For example: fun( ( + 1 2 ) ) => "( + 1 2)" or fun( (define (myhello str) (begin (print (string-append "Hello " str)) (newline) )) ) => "(

Re: find in smartpdf files

2011-01-06 Thread Dan M
On Thu, 06 Jan 2011 08:11:34 -0800, Wanderer wrote: > We generate PCB assembly files in pdf format using SmartPDF. This allows > us to search for a component in the assembly using the find feature. We > would like to be able to generate a list of components sorted by part > type and then use that

find in smartpdf files

2011-01-06 Thread Wanderer
We generate PCB assembly files in pdf format using SmartPDF. This allows us to search for a component in the assembly using the find feature. We would like to be able to generate a list of components sorted by part type and then use that list to cycle through a search by ref designator in the pdf f

Re: list from FTP server to a text file

2011-01-06 Thread Dan M
On Thu, 06 Jan 2011 10:51:42 -0500, Ahmed, Shakir wrote: > Hi, > > I am trying to create a list in a txt file from an ftp server. The > following code is retrieving the list of the files but could not able to > write in a text file. Any help is highly appreciated. > > Thanks > > > > *

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread dmitrey
Yes, I know, still usually it is placed in file header On Jan 6, 5:57 pm, Tim Harig wrote: > Python doesn't require imports to be at the top of a file.  They can be > imported at any time. > > > import MyModule > > (...lots of code...) > > r = MyModule.myFunc(...) > > (...lots of code...) > impor

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Duncan Booth
dmitrey wrote: > e.g. instead of > > import MyModule > (...lots of code...) > r = MyModule.myFunc(...) > > someone could just type in the single place > > r = @MyModule.myFunc(...) > > Also, "import MyModule2 as mm2" could be replaced to mere > mm2 = @MyModule2 > and "from MyModule3 import my

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Tim Harig
On 2011-01-06, dmitrey wrote: > and after several pages of code they are using somewhere, maybe only > one time, e.g. [SNIP] > It makes programs less clear, you have to scroll several pages of code > in IDE to understand what it refers to. Python doesn't require imports to be at the top of a file

list from FTP server to a text file

2011-01-06 Thread Ahmed, Shakir
Hi, I am trying to create a list in a txt file from an ftp server. The following code is retrieving the list of the files but could not able to write in a text file. Any help is highly appreciated. Thanks import os import time from ftplib import FTP ftp = FTP("*.

PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread dmitrey
hi all, I have th PEP (I'm not sure something like that hadn't been proposed although): very often in a Python file header the following lines are present, like: from MyModule1 import myFunc1 import MyModule2 as mm2 from MyModule3 import myFunc3 as mf3 etc and after several pages of code they are

Re: How suitable is Python to write system utilities?

2011-01-06 Thread Alice Bevan–McGregor
On 2011-01-06 06:38:24 -0800, David Boddie said: Just out of interest, which module/package are you using to examine ELF files? http://pypi.python.org/pypi/elffile - Alice. -- http://mail.python.org/mailman/listinfo/python-list

Re: How suitable is Python to write system utilities?

2011-01-06 Thread David Boddie
On Thursday 06 January 2011 12:08, Alice Bevan?McGregor wrote: > Python does include libraries (and has available third-party libraries) > to interface with external low-level libraries of every kind, has > Python-native third-party libraries to do things like examine ELF > object files / executab

Re: How suitable is Python to write system utilities?

2011-01-06 Thread Roy Smith
In article <8olv6kfb8...@mid.individual.net>, "J.O. Aho" wrote: > Roy Smith wrote: > > In article <8oloo6f56...@mid.individual.net>, > > "J.O. Aho" wrote: > > > >> According to microsoft documentation, the recommendation is to run > >> defragmentation on ntfs on a regular bases. There seems t

RE: Help with code-lists and strings

2011-01-06 Thread Rob Richardson
Cathy, Please take another try at writing your program, using what advice you have received so far that you understand. I think this discussion is going rather far away from what you need, and seeing another step in the evolution of your program should help bring it back on track. I like your op

Re: why generator assigned to slice?

2011-01-06 Thread ana sanchez
In Peter Otten <__pete...@web.de> writes: >ana sanchez wrote: >> i found this when i read the source of a program in python: >> >> self.__chunks[start:end] = (chunk for i in xrange(start, end)) >> what utility has to assign a generator to a slice??? ?the *final >> result* isn't the sa

Re: How suitable is Python to write system utilities?

2011-01-06 Thread J.O. Aho
Roy Smith wrote: > In article <8oloo6f56...@mid.individual.net>, > "J.O. Aho" wrote: > >> According to microsoft documentation, the recommendation is to run >> defragmentation on ntfs on a regular bases. There seems to come some >> improvement on the mft fragmentation, but still it feels long be

Re: How suitable is Python to write system utilities?

2011-01-06 Thread Roy Smith
In article <8oloo6f56...@mid.individual.net>, "J.O. Aho" wrote: > According to microsoft documentation, the recommendation is to run > defragmentation on ntfs on a regular bases. There seems to come some > improvement on the mft fragmentation, but still it feels long behind the > linux/unix file

Re: Google Chart API, HTTP POST request format.

2011-01-06 Thread Tim Harig
On 2011-01-06, Chris Rebert wrote: > On Wed, Jan 5, 2011 at 11:21 PM, Garland Fulton wrote: >> On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: >>>    Python 3.1.2 (r312:79147, Oct  9 2010, 00:16:06) >>>    [GCC 4.4.4] on linux2 >>>    Type "help", "copyright", "credits" or "license" for more in

Re: How suitable is Python to write system utilities?

2011-01-06 Thread J.O. Aho
Alice Bevan–McGregor wrote: > On 2011-01-06 01:35:58 -0800, Rohit Coder said: > >> Is Python suitable to write low-level system utilities like Defrag, >> Malware Removal Tools and Drivers? > > Yes and no. > > Also, file fragmentation is a non-issue on all modern filesystems > (ext3/4, reiser, ntf

Re: Help with code-lists and strings

2011-01-06 Thread Dave Angel
On 01/06/2011 12:28 AM, Steven Howe wrote: On 01/05/2011 07:17 PM, Dave Angel wrote: On 01/-10/-28163 02:59 PM, GrayShark wrote: < In python it's best to build up you functional needs. So two steps. First a nand (negative 'and' operation). Then wrap that with a function to create two string

Working with PyQt and Pydev

2011-01-06 Thread Rohit Coder
I installed the PyDev plugin into Aptana Stdui 3 Beta. Someone suggested me to use PyQt for Python GUI app, and so I downloaded and installed PyQt. But when I open Aptana Studio, I could see a new menu added with the name "PyDev", but there is nothing for PyQt. In the Windows Start Meny item li

Re: How suitable is Python to write system utilities?

2011-01-06 Thread Alice Bevan–McGregor
On 2011-01-06 01:35:58 -0800, Rohit Coder said: Is Python suitable to write low-level system utilities like Defrag, Malware Removal Tools and Drivers? Yes and no. Python does include libraries (and has available third-party libraries) to interface with external low-level libraries of every k

Re: How suitable is Python to write system utilities?

2011-01-06 Thread Chris Rebert
On Thu, Jan 6, 2011 at 1:05 AM, Rohit Coder wrote: > Is Python suitable to write low-level system utilities like Defrag, Malware > Removal Tools and Drivers? No; but I wouldn't classify a malware remover as a "low-level system utility". Writing such a tool in Python seems pretty feasible. Cheers

Re: Google Chart API, HTTP POST request format.

2011-01-06 Thread Chris Rebert
On Wed, Jan 5, 2011 at 11:21 PM, Garland Fulton wrote: > On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: >> >> On 2011-01-06, Slie wrote: >> [reformated to <80 columns per RFC 1855 guidelines] >> > I have read several examples on python post requests but I'm not sure >> > mine needs to be that

How suitable is Python to write system utilities?

2011-01-06 Thread Rohit Coder
Is Python suitable to write low-level system utilities like Defrag, Malware Removal Tools and Drivers? -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching Python-list

2011-01-06 Thread Garland
Amazing you are a genius, I use google chrome and I chose Google Reader as my solution for the e-mail clutter and response. RSS from here. http://permalink.gmane.org/gmane.comp.python.general/681862 All i have to do is click on a response and i'm brought the the search thank you. Sent to you by

Re: Attaching C++ libraries to Python app.

2011-01-06 Thread Stefan Behnel
Stefan Sonnenberg-Carstens, 06.01.2011 07:08: Am 05.01.2011 23:44, schrieb Rohit Coder: I am just asking. In future I may need to import any C++ library, not a Crypto, but some other. Is it possible? Yes. There are at least five possible ways: - Handcode the interface and glue code (http://doc