Re: Import order question

2014-02-19 Thread Chris Angelico
On Wed, Feb 19, 2014 at 6:32 PM, Steven D'Aprano wrote: > On Tue, 18 Feb 2014 13:44:47 -0800, Rick Johnson wrote: > >> Are you telling me you're willing to search through a single file >> containing 3,734 lines of code (yes, Tkinter) ... > > For a mere 4000 lines of code, yes, I'd rather have it a

Re: Turning an AST node / subnodes into something human-readable

2014-02-19 Thread Irmen de Jong
On 19-2-2014 4:58, Chris Angelico wrote: > but what I'd really like to do is get something that looks > approximately like "x[1]". Is there an easy way to do that? Its str > and repr aren't useful, and I can't see a "reconstitute" method on the > node, nor a function in ast itself for the job. In

SSH/Telnet program to Router/switch

2014-02-19 Thread Sujith S
Hi, I am new to programming and python. I am looking for a python script to do ssh/telnet to a network equipment ? I know tcl/perl does this using expect/send. Do we have expect available in python as well or need to use some other method ? Regards Sujith -- https://mail.python.org/mailman/l

Re: Turning an AST node / subnodes into something human-readable

2014-02-19 Thread Chris Angelico
On Wed, Feb 19, 2014 at 7:05 PM, Irmen de Jong wrote: > On 19-2-2014 4:58, Chris Angelico wrote: > >> but what I'd really like to do is get something that looks >> approximately like "x[1]". Is there an easy way to do that? Its str >> and repr aren't useful, and I can't see a "reconstitute" method

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread Chris Angelico
On Wed, Feb 19, 2014 at 7:14 PM, Sujith S wrote: > Hi, > > I am new to programming and python. I am looking for a python script to do > ssh/telnet to a network equipment ? I know tcl/perl does this using > expect/send. > > Do we have expect available in python as well or need to use some other

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread Wojciech Łysiak
On 19.02.2014 09:14, Sujith S wrote: > Hi, > > I am new to programming and python. I am looking for a python script to do > ssh/telnet to a network equipment ? I know tcl/perl does this using > expect/send. > > Do we have expect available in python as well or need to use some other > method ?

Re: a question about list as an element in a tuple

2014-02-19 Thread Marko Rauhamaa
John O'Hagan : > The weirdest part for me is this: > t = ([],) l = t[0] l is t[0] > True l += [1] t[0] += [1] > Traceback (most recent call last): > File "", line 1, in > TypeError: 'tuple' object does not support item assignment > > Whether there is an error or not dep

Re: a question about list as an element in a tuple

2014-02-19 Thread Marko Rauhamaa
Marko Rauhamaa : > operator.add(x, y) [...] leaves x and y intact and must return a new > object. Well, if the addition doesn't modify x, the method can of course return x. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread Johannes Schneider
On 19.02.2014 09:14, Sujith S wrote: Hi, I am new to programming and python. I am looking for a python script to do ssh/telnet to a network equipment ? I know tcl/perl does this using expect/send. Do we have expect available in python as well or need to use some other method ? Regards Sujith

how to install automatically missing modules on a debian-system

2014-02-19 Thread hugocoolens
It often happens I start a python-script I wrote some time ago on another system and get messages like "module_x is missing". I then perform an apt-cache search module_x, followed by an apt-get install name_of_missing_module.deb I was wondering whether someone here has a kind of method which autom

Re: Wheezy.web - is it been developed?

2014-02-19 Thread Marcio Andrey Oliveira
Hi. Thanks for replying. I navigated in its site. I just feel strange that no one wrote tutorials of it (not counting some speed testing) and that there is no Wheezy.web community (yet). I'll give it a try and for sure I'll get in touch in case of problems. Thank you. 2014-02-19 4:18 GMT-03:0

Python Requests script to login to a phpbb forum

2014-02-19 Thread Leo
Hi there, I have decided to jump in at the deep end to try and learn python. I have been able to get requests to pull the login page off the server and I think send the login request. I don't get logged in though. Please let me know if I would be better off asking in a phpBB related group or

Re: Python Requests script to login to a phpbb forum

2014-02-19 Thread Chris “Kwpolska” Warrick
On Wed, Feb 19, 2014 at 12:46 PM, Leo wrote: > Hi there, > > I have decided to jump in at the deep end to try and learn python. I have > been able to get requests to pull the login page off the server and I think > send the login request. I don't get logged in though. Please let me know if > I wou

Re: Wheezy.web - is it been developed?

2014-02-19 Thread Chris “Kwpolska” Warrick
On Wed, Feb 19, 2014 at 8:18 AM, Andriy Kornatskyy wrote: > I believe the web framework should not be something cryptic (requiring > community to exchange ideas about workarounds) nor something that involves > infinitive development cycle. Having lots of humans give support is much better when

Re: Wheezy.web - is it been developed?

2014-02-19 Thread Marcio Andrey Oliveira
To say the truth right now I'm studying some frameworks (not only in Python) to get one I feel more comfortable with. I'm learning Flask too and it seems a very nice project. And I completely agree with you that the bigger the community the easier is to get support. Regards. 2014-02-19 9:01 GM

Re: Import order question

2014-02-19 Thread Roy Smith
In article <53045df2$0$2788$c3e8da3$76491...@news.astraweb.com>, Steven D'Aprano wrote: > How do you know that the module tk_optionmenu.py contains the class > OptionMenu? Perhaps it contains the function optionmenu. Or the class > TK_OptionMenu. Stuff like this is a really important issue o

Win32 Write RAW Physical Disk Python 3.3.2

2014-02-19 Thread khanta
Hello, I am trying to write to the raw physical disk on Windows 8.1 but I get an error: PermissionError: [Errno 13] Permission denied: '.\\PHYSICALDRIVE2' OS: Windows 8.1 Python: 3.3.2 Drive is a USB drive Running as administrator Code Snippet: with open(r"\\.\PHYSICALDRIVE2\\",

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread Roy Smith
In article , Sujith S wrote: > Hi, > > I am new to programming and python. I am looking for a python script to do > ssh/telnet to a network equipment ? I know tcl/perl does this using > expect/send. > > Do we have expect available in python as well or need to use some other > method ? You

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread Chris Angelico
On Thu, Feb 20, 2014 at 12:35 AM, Roy Smith wrote: > As far as I know, fabric only works with ssh. If you are forced to use > telnet to talk to legacy equipment, that's another problem. If it's telnet, it's likely to be a pretty simple protocol. All you really need is the socket module, build it

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread Roy Smith
In article , Roy Smith wrote: > in conjunction with a near command-line driver tool called fab Typo there: "near" should have been "neat". [this is why I love wikis] -- https://mail.python.org/mailman/listinfo/python-list

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread William Ray Wing
On Feb 19, 2014, at 3:14 AM, Sujith S wrote: > Hi, > > I am new to programming and python. I am looking for a python script to do > ssh/telnet to a network equipment ? I know tcl/perl does this using > expect/send. > > Do we have expect available in python as well or need to use some other

Re: Turning an AST node / subnodes into something human-readable

2014-02-19 Thread Mark Lawrence
On 19/02/2014 03:58, Chris Angelico wrote: I'm working with the ast module to do some analysis on Python codebases, and once I've found what I'm looking for, I want to print something out. The file name I'm hanging onto externally, so that works; and the nodes all have a lineno. So far so good. B

extend methods of decimal module

2014-02-19 Thread Mark H. Harris
Would it be possible to extend the methods of the decimal module just a bit to include atan(), sin(), cos(), and exp() ? The module has methods for ln() and sqrt(); and that's great! I have done some rudimentary searching of the pep history and I'm not finding any pep related to extending the d

Re: Turning an AST node / subnodes into something human-readable

2014-02-19 Thread Chris Angelico
On Thu, Feb 20, 2014 at 2:04 AM, Mark Lawrence wrote: >> but what I'd really like to do is get something that looks >> approximately like "x[1]". > > http://alexleone.blogspot.co.uk/2010/01/python-ast-pretty-printer.html ? That's still based on ast.dump(), so it's still highly verbose. I've stuck

Re: Win32 Write RAW Physical Disk Python 3.3.2

2014-02-19 Thread Chris Angelico
On Wed, Feb 19, 2014 at 11:42 PM, khanta wrote: > PermissionError: [Errno 13] Permission denied: '.\\PHYSICALDRIVE2' Have you tried running your script as administrator? Raw writing to a disk quite possibly is (and definitely should be) a restricted action. ChrisA -- https://mail.python

Re: Win32 Write RAW Physical Disk Python 3.3.2

2014-02-19 Thread Chris Angelico
On Thu, Feb 20, 2014 at 2:44 AM, Chris Angelico wrote: > On Wed, Feb 19, 2014 at 11:42 PM, khanta wrote: >> PermissionError: [Errno 13] Permission denied: '.\\PHYSICALDRIVE2' > > Have you tried running your script as administrator? Raw writing to a > disk quite possibly is (and definitely

Re: Help creating new module which inherits existing class from another module.

2014-02-19 Thread Jonno
On Tue, Feb 18, 2014 at 11:48 PM, Ben Finney wrote: > Jonno writes: > > > I tried to explain the necessary properties in the requirements below. > > What you've described is a bunch of abstract behaviour. > > But as I said, I'm suspecting this is a poor design; and I can't know > better until you

Re: Help creating new module which inherits existing class from another module.

2014-02-19 Thread Jonno
> > > > The idea is that when you have a NewClass instance, calling > "newobject.foo" will automatically call the descriptor's __getmethod__, > passing it the class and instance. That descriptor will create and > populate the FooClass instance, which does the real work. > > Descriptors are how meth

NEW RESEARCH DISPROVES EVOLUTION

2014-02-19 Thread THRINAXODON'S CREATION STUDIES
=== >BREAKING NEWS! === NEW YORK TIMES, THRINAXODON, OHIO = > THRINAXODON RECENTLY FOUND 3 HUMAN FOSSILS FROM DEVONIAN STRATA FROM GREENLAND, THE EVOLUTIONISTS HAVE NO BONES ABOUT. > ONE EVIL EVOLUTIONIST, BOB CASANOVA HAS ADMITTED THAT HUMAN EVOLUTION I

NEW STUNNING RESEARCH SHOWS THAT HUMANS HAVE ORIGINS IN THE DEVONIAN

2014-02-19 Thread THRINAXODON OF THRINAXODON
=== >BREAKING NEWS! === NEW YORK TIMES, THRINAXODON, OHIO = > THRINAXODON RECENTLY FOUND 3 HUMAN FOSSILS FROM DEVONIAN STRATA FROM GREENLAND, THE EVOLUTIONISTS HAVE NO BONES ABOUT. > ONE EVIL EVOLUTIONIST, BOB CASANOVA HAS ADMITTED THAT HUMAN EVOLUTION I

Re: Help creating new module which inherits existing class from another module.

2014-02-19 Thread biolord9
On Tuesday, February 18, 2014 3:34:51 PM UTC-5, Jonno wrote: > I'm not sure if this list is a suitable place to ask for this kind of help so > if it's not please just suggest another forum which might be more suitable. > > > > > I'm looking for help/suggestions how to architect a module (perha

NEW STUNNING RESEARCH DISPROVES EVOLUTIONARY FAIRY-TALES

2014-02-19 Thread THRINAXODON
=== >BREAKING NEWS! === NEW YORK TIMES, THRINAXODON, OHIO = > THRINAXODON RECENTLY FOUND 3 HUMAN FOSSILS FROM DEVONIAN STRATA FROM GREENLAND, THE EVOLUTIONISTS HAVE NO BONES ABOUT. > ONE EVIL EVOLUTIONIST, BOB CASANOVA HAS ADMITTED THAT HUMAN EVOLUTION I

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-19 Thread Mark H. Harris
> > Any suggestions? Thanks in advance! > > Switch to Gnu/Linux. Which version of tcl/tk is installed. I would guess that tkinter is honked up somehow... did you clear up the old tkinter stuff? -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-19 Thread Mark Lawrence
On 19/02/2014 16:56, Mark H. Harris wrote: Any suggestions? Thanks in advance! Switch to Gnu/Linux. Which version of tcl/tk is installed. I would guess that tkinter is honked up somehow... did you clear up the old tkinter stuff? The version of tcl/tk is completely irrelevant a

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-19 Thread Mark H. Harris
> > The version of tcl/tk is completely irrelevant as it comes bundled in > > the Python msi installer. > Does the previous version put stuff into the registry that keeps the new version from running correctly? -- https://mail.python.org/mailman/listinfo/python-list

Re: Turning an AST node / subnodes into something human-readable

2014-02-19 Thread Dan Goodman
Chris Angelico gmail.com> writes: > I'm working with the ast module to do some analysis on Python > codebases, and once I've found what I'm looking for, I want to print > something out. The file name I'm hanging onto externally, so that > works; and the nodes all have a lineno. So far so good. But

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-19 Thread Mark Lawrence
On 19/02/2014 17:30, Mark H. Harris wrote: The version of tcl/tk is completely irrelevant as it comes bundled in the Python msi installer. Does the previous version put stuff into the registry that keeps the new version from running correctly? Not that I'm aware of. But then again if

Re: "JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com "JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com "JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com "JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com

2014-02-19 Thread iamalimuhammad
On Tuesday, August 4, 2009 3:06:59 PM UTC+5, Riaz Ahmad wrote: > "JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com " > > > JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com " > > > JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com " > > JOBS IN PAKISTAN" www.pakjobs2008.blogspot.com " > > >

Re: extend methods of decimal module

2014-02-19 Thread Terry Reedy
On 2/19/2014 10:30 AM, Mark H. Harris wrote: Would it be possible to extend the methods of the decimal module just a bit to include atan(), sin(), cos(), and exp() ? The decimal module implements IEEE 854 The module has methods for ln() and sqrt(); and that's great! that includes just these

A Brief Introduction to Islam

2014-02-19 Thread BV BV
A Brief Introduction to Islam A brief introduction to the meaning of Islam, the notion of God in Islam, and His basic message to humanity through the Prophets. http://www.islamhouse.com/426146/en/en/articles/A_Brief_Introduction_to_Islam Thank you -- https://mail.python.org/mailman/listinfo/py

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-19 Thread Terry Reedy
On 2/19/2014 12:50 PM, Mark Lawrence wrote: On 19/02/2014 17:30, Mark H. Harris wrote: Does the previous version put stuff into the registry that keeps the new version from running correctly? Not that I'm aware of. But then again if people knew the answer it would have been posted by now.

Insert variable into text search string

2014-02-19 Thread Kevin Glover
These two lines are from a program that carries out a phrase search of Wikipedia and returns the total number of times that the specific phrase occurs. It is essential that the search contains an apostrophe: results = w.search("\"of the cat's\"", type=ALL, start=1, count=1) print results.total

Re: Insert variable into text search string

2014-02-19 Thread MRAB
On 2014-02-19 19:39, Kevin Glover wrote: These two lines are from a program that carries out a phrase search of Wikipedia and returns the total number of times that the specific phrase occurs. It is essential that the search contains an apostrophe: results = w.search("\"of the cat's\"", type=A

Re: Insert variable into text search string

2014-02-19 Thread Jussi Piitulainen
Kevin Glover writes: > These two lines are from a program that carries out a phrase search > of Wikipedia and returns the total number of times that the specific > phrase occurs. It is essential that the search contains an > apostrophe: > > results = w.search("\"of the cat's\"", type=ALL, start=1

Re: Insert variable into text search string

2014-02-19 Thread Kevin Glover
Thank you both so much. I had tried % but not successfully. -- https://mail.python.org/mailman/listinfo/python-list

Can I use Python 3 - script on github

2014-02-19 Thread Mark Lawrence
https://github.com/brettcannon/caniusepython3 may be of interest to some of you fine folks. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protect

Re: extend methods of decimal module

2014-02-19 Thread Mark H. Harris
> > The decimal module implements IEEE 854 > Thanks Terry... ... long time. I would like to find out if there is some iron-clad policy about extending the implementation of an IEEE standard... decimal module in this case; I'm just thinking that this particular extension really fits the pyt

Re: extend methods of decimal module

2014-02-19 Thread Zachary Ware
On Wed, Feb 19, 2014 at 3:30 PM, Mark H. Harris wrote: >> >> The decimal module implements IEEE 854 >> > > Thanks Terry... ... long time. > > I would like to find out if there is some iron-clad policy about extending > the implementation of an IEEE standard... decimal module in this case; I'm >

Python 2.7 importing pyc files without py files

2014-02-19 Thread Mircescu Andrei
Hi, I encountered a strange issue. I have an application which uses extensively python 2.7.6 (CPython). The issue that I see is the following: If there are only pyc files, the loading time of the application is much more than if I have pyc and py files. It is behind with 2 minutes more than i

Re: extend methods of decimal module

2014-02-19 Thread Terry Reedy
On 2/19/2014 4:54 PM, Zachary Ware wrote: On Wed, Feb 19, 2014 at 3:30 PM, Mark H. Harris wrote: The decimal module implements IEEE 854 Thanks Terry... ... long time. I would like to find out if there is some iron-clad policy about extending the implementation of an IEEE standard... deci

Re: Python 2.7 importing pyc files without py files

2014-02-19 Thread Emile van Sebille
On 2/19/2014 2:03 PM, Mircescu Andrei wrote: > If there are only pyc files, the loading time of the application is > much more than if I have pyc and py files. It is behind with 2 > minutes more than if it had py files You may get some clues by starting python as /path/to/python/python2.7 -vv

Re: Python 2.7 importing pyc files without py files

2014-02-19 Thread Terry Reedy
On 2/19/2014 5:03 PM, Mircescu Andrei wrote: Hi, I encountered a strange issue. I have an application which uses extensively python 2.7.6 (CPython). The issue that I see is the following: If there are only pyc files, the loading time of the application is much more than if I have pyc and py f

Re: extend methods of decimal module

2014-02-19 Thread Zachary Ware
On Wed, Feb 19, 2014 at 4:10 PM, Terry Reedy wrote: > On 2/19/2014 4:54 PM, Zachary Ware wrote: >> You might consider suggesting a "decimal.math" module on python-ideas. > > > Or just dmath. The name (and location) is of course endlessly bikesheddable :) > I think this is a better idea than sugg

Re: extend methods of decimal module

2014-02-19 Thread Oscar Benjamin
On 19 February 2014 15:30, Mark H. Harris wrote: > Would it be possible to extend the methods of the decimal module just a bit > to include atan(), sin(), cos(), and exp() ? > > The module has methods for ln() and sqrt(); and that's great! > > I have done some rudimentary searching of the pep his

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-19 Thread eglowstein . h
On Wednesday, February 19, 2014 2:00:52 PM UTC-5, Terry Reedy wrote: > On 2/19/2014 12:50 PM, Mark Lawrence wrote: > > > On 19/02/2014 17:30, Mark H. Harris wrote: > > > > >> Does the previous version put stuff into the registry that keeps the > > >> new version from running correctly? > > >

Re: Insert variable into text search string

2014-02-19 Thread Chris Angelico
On Thu, Feb 20, 2014 at 7:15 AM, Kevin Glover wrote: > Thank you both so much. I had tried % but not successfully. To do it with %, just do this: whatever = "cat" results = w.search("\"of the %s's\""%whatever, type=ALL, start=1, count=1) Use either that or .format(), whichever you like - both a

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-19 Thread David Robinow
On Tue, Feb 18, 2014 at 9:56 AM, wrote: > The next adventure in Python was to install Python 3 into a Windows XP > machine. I had a previous 2.7 installation that I uninstalled and carefully > removed all traces of from the directory and the registry. It is not necessary to uninstall previous

Re: Help creating new module which inherits existing class from another module.

2014-02-19 Thread Ben Finney
Jonno writes: > Let's say the existing module provides a class RoboCom() which allows > the user to communicate with robots (it doesn't). Well, can you say what it *does* do? These hypotheticals aren't very helpful; I don't know what inferences I'm safe to draw from the made-up situation. What i

Re: extend methods of decimal module

2014-02-19 Thread casevh
On Wednesday, February 19, 2014 1:30:13 PM UTC-8, Mark H. Harris wrote: > > I guess what I'm really asking for are the same routines found in "bc -l" > math library. I've finally moved my number crunching stuff to python (from > bc) because the performance of "decimal" is finally way better than b

Tanglin With Alpha

2014-02-19 Thread David Hutto
Just as a quick survey...Are individual programmers happier with tangling with the alpha code, or more comfortable with beta versions, or does it matter, dependant on the circumstances? -- https://mail.python.org/mailman/listinfo/python-list

Re: Tanglin With Alpha

2014-02-19 Thread Chris Angelico
On Thu, Feb 20, 2014 at 5:06 PM, David Hutto wrote: > Just as a quick survey...Are individual programmers happier with tangling > with the alpha code, or more comfortable with beta versions, or does it > matter, dependant on the circumstances? > Depends on the program, enormously. Or, to put it

Cannot figure out line of code, also not understanding error

2014-02-19 Thread ApathyBear
I have two questions that come along with the following code: -- from __future__ import print_function def sanitize(time): if '-' in time: splitter = '-' (mins,secs) = time.split(splitter,