Less/more module for python?

I've been searching for the longest time to find a python module that behaves like less or more with no luck. Even if I was able to harness the viewer from help() would be great but I can't figure out where that thing is on my system.
Any ideas?

From pydoc.py:
pipepager and tempfilepager are constructed by passing os.environ['PAGER'] as the second arg.
def pipepager(text, cmd):
"""Page through text by feeding it to another program."""
pipe = os.popen(cmd, 'w')
try:
pipe.write(text)
pipe.close()
except IOError:
pass # Ignore broken pipes caused by quitting the pager program.
def tempfilepager(text, cmd):
"""Page through text by invoking a program on a temporary file."""
import tempfile
filename = tempfile.mktemp()
file = open(filename, 'w')
file.write(text)
file.close()
try:
os.system(cmd + ' ' + filename)
finally:
os.unlink(filename)
def ttypager(text):
"""Page through text on a text terminal."""
lines = split(plain(text), 'n')
try:
import tty
fd = sys.stdin.fileno()
old = tty.tcgetattr(fd)
tty.setcbreak(fd)
getchar = lambda: sys.stdin.read(1)
except (ImportError, AttributeError):
tty = None
getchar = lambda: sys.stdin.readline()[:-1][:1]
try:
r = inc = os.environ.get('LINES', 25) - 1
sys.stdout.write(join(lines[:inc], 'n') + 'n')
while lines[r:]:
sys.stdout.write('-- more --')
sys.stdout.flush()
c = getchar()
if c in ['q', 'Q']:
sys.stdout.write('r r')
break
elif c in ['r', 'n']:
sys.stdout.write('r r' + lines[r] + 'n')
r = r + 1
continue
if c in ['b', 'B', 'x1b']:
r = r - inc - inc
if r < 0: r = 0
sys.stdout.write('n' + join(lines[r:r+inc], 'n') + 'n')
r = r + inc
finally:
if tty:
tty.tcsetattr(fd, tty.TCSAFLUSH, old)
def plainpager(text):
"""Simply print unformatted text. This is the ultimate fallback."""
sys.stdout.write(plain(text))

Similar Messages

  • SQL Server module for Python

    Hi,
    I was wondering if there is a module for Python (3.4) to connect Django to SQL Server (Azure).
    Any help will be appreciated.
    Thank you,
    Ricardo

    Hello,
    Please try the following resources.
    http://code.google.com/p/django-mssql/
    http://code.google.com/p/django-pyodbc/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • ADF application taking more time for first time and less from second time

    Hi Experts,
    We are using ADF 11.1.1.2.
    Our application contains 5 jsp pages, 10 - 12 taskflows, and 50 jsff pages.
    For the first time in the day if we use the application it is taking more than 60 sec on some actions.
    And from the next time onwords it is taking 5 to 6 sec.
    Same thing is happening daily.
    Can any one tell me why this application is taking more time for first time and less time from second time.
    Regards
    Gayaz

    Hi,
    If you don't restart you WLS every day, then you should read about Tuning Application Module Pools and Connection Pools
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0301
    And pay attention to the parameter: Maximum Available Size, Minimum Available Size
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0314
    And adjust them to suit your needs.

  • What SAP module is more appropriate for my background?

    HI,
    I'm very interested to join a SAP course in India but i'm really not making any decision so far. which module is more suitable for me and my background.
    I have done my Master in "computer science" and my undergrad in "Education in computer". I've asked some guys and some have advised me to go for Basis or BI. I'm telling you that I have no experience in SAP world but I'll take a step further to join the most appropriate course that meets my background.
    my Questions are:
    - Any requirements to study SAP Basis/BI module in an authorized institute?
    - What do u suggest me to study?
    plz share your experience :):):)

    BTW, I'd like to get some advices about my situation:
    i'm interested to enter into SAP world but i duno which way is more appropriate for me:
    1- join a course in a non-authorized institute in India for about 2 months (2 h/day) then join SIEMENS institute (8 h/day) which is authorized then do the exam to be a SAP certified consultant. [a long way, total of studying is 3 months, will cost a bit more]
    2-  join a course in SIEMENS institute then do the exam to be a SAP certified consultant. [short period .. just 1 month, intensive]
    Things to bear in mind:
    - no experience in SAP world.
    - the aim of studying in a non-authorized institute is to enter into SAP world and make sure if the module is suitable for u or need to switch to another one. studying in a non-institute is a bit cheap.
    what do u recommend me to do?
    cheers,

  • Why is there not more support from VMware for Sprng 1.2 for Python

    It would seem that VMware/Pivotal would support the framework that was created for Python. What happened?

    If you want support from Apple you need to contact them by phone or visit a store.
    If you are still under warranty, that would be the best thing to do anyway.
    There are no Apple techs here on these forums. Apart from the hosts who manage the site, all the people posting here are volunteers; users, the same as you.
    The quality of the advice varies, and considering it costs nothing, I'd argue it is good value, but one should be prudent and not believe everything that is said, though you could also apply the same to life in general.
    This site is more extensive than many realize and finding the right place to post your problem can help enormously, as people tend to hang in the forums that they know most about.
    Here is a link to the site map to explore.
    http://www.apple.com/support/sitemap/
    Remember you can always contact an Apple store for professional help.

  • Memory modules for Msi Big Bang trinergy

    Hey forum,
    i want to buy some memory modules for my trinergy mobo because the ones i had earlier also proved to be incompatible. I would like to ask you if there are any memory modules besides the ones recommended from the MSI site concerning my mobo. I am looking for a 2x2 gb ram kit with a heat dispenser so it can work around 1600mHz. Thank you in advance 
    P.S Is the list on the site the only one? i mean are there any updated versions of it with more high end memory modules tested?

    Ideally you would provide us with your fullsystem specs first >>Posting Guide<<
    From a memory perspective, the reason these modules have heatspreaders is mostly due to marketing and to impress the potential buyers. The secondary reason is that most manufacturers sell you overvolted and overclocked 1066 or 1333 chips on a 1600 marketed module that needs 1,65V instead of the standard 1,5V. Your memory controller is part of the CPU and natively only supports 1333 at 1,5V.
    If you really insist, then at least get yourself a 1600 kit that does this speed at 1,5V. One of the modules that seem to work well are the CMZ4GX3M2A1600C9 from Corsair. From a user perspective, the mem modules from Crucial that you see in my signature come highly recommended as they have been proven to work on the P55 platform whenever used.

  • Function Module for open Purchase Order & Sales Order?

    Hi, commonly I read the data from tables and calculate the open quantity for sales order and purchase order, but I want to know, are there any standard function modules for getting the list of open "purchase order" and "sales order" respectively?
    Thanks and Regards.

    hi Ren,
    u can check all these bapi's related to salesorder
    BAPI_SALESORDER_CHANGE Sales order: Change Sales Order
    BAPI_SALESORDER_CONFIRMDELVRY Sales Order: Confirmation of Delivery; Document Flow Update
    BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More Maintenance
    BAPI_SALESORDER_GETLIST Sales order: List of all Orders for Customer
    BAPI_SALESORDER_GETSTATUS Sales Order: Display Status
    BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
    May be this FM can help you
    MB_ADD_PURCHASE_ORDER_QUANTITY (Reading and adding open purchase order quantities)
    Regards,
    Naveen

  • Open module for managing property file and environment variables

    Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
    Any ideas are greatly welcomed.

    You seem wright, you hit a brick wall here with Air to find the location
    of the command console on windows...
    So in fact I never build an exe tool, but this little problem was a nice
    case to test it and I tried it.:
    I downloaded monodevelop
    -GTK# for .NET 2.12.10*
    -MonoDevelop 2.4.2*
       from http://monodevelop.com/Download
    created a console project and had an exe in 5 minutes !
    You can download the findconsole tool and the projectfiles here:
       http://greencollective.nl/temp/dump/findconsole_monoproject.zip
    findconsole.exe will reveal the path/location of cmd.exe on a windows system.
    Cheers,
    Latcho

  • There is no more space for virtual disk ServerName_2.vmdk. You might be able to continue this session by freeing disk space on the relevant volume, and clicking Retry. Click Cancel to terminate this session.   Time: 30/05/2014 1:16:20 AM

    Recently, our mail server crashed at about 7pm one night, with the error 'There is no more space for virtual disk ServerName_2.vmdk. You might be able to continue this session by freeing disk space on the relevant volume, and clicking Retry. Click Cancel to terminate this session.'
    When we click Retry, the server starts up OK.
    There are no snapshots listed in Snapshot manager for any of the virtual machines on the host.
    There is also free disk space available on the host and for the VM with the disk errors.
    This happened at least three more times, often at bad times. Each time, we were able to click 'Retry' and the disk/system would allow the VM to start-up successfully.
    I checked the Forums, the VMware support articles and the internet as I had not seen this problem before. I have completed the VSphere 5.1 - Fast Track course and this issue was NOT covered in the training.
    Most of the advice on-line and even that on the VMware web-site was pointing to snapshots being the cause of this issue. There are no snapshots enabled and I cannot see evidence of snapshots ever being used.
    - We are running VMware vsphere (5.1.0) and there are (were) 4 virtual machines running on the ESX host. We are using the free version of VMware/ESXi.
    - The Hard disk types we are using for this Virtual Machine are 'Thin Provisioned'.
    - There are 4 [Thin Provisioned] Hard Disks for this virtual machine.
    - There are 6 CPUs
    - There is 20GB of RAM (memory)
    - The VM is running Windows Server 2008 R2 as the guest/VM operating system. It is an Exchange 2010 SP1 mail server. There is plenty of available disk space on all the drives. The [Exchange] log files are cleaned out regularly (automated).
    I decided to move one of our non-critical servers off this host and on to another host to see if this helped the problem. This took quite some time, as we are not using HA or vmotion, nor do we have VCenter Server...nonetheless, I finally managed to get the non-critical server on to another host (n.b. This was a much smaller machine with less virtual resources assigned to it).
    After moving the non-critical server off this host, we decided to monitor the Host and see if the issue resolved itself.
    I checked the host about 6-10 times a day, from first thing in the morning till last thing at night - monitoring the performance of not only the Virtual Machine, but the ESXi host also.
    There were no adverse performance issues. The only thing I did note, was in the Summary page on the ESX Host, under Storage, was If I right-clicked on the datastore and clicked refresh, then the free disk space would drop (ie from 140GB to 125GB).
    After monitoring the host and VM for about 2 weeks, we did NOT have another instance of the above error.
    Sorry for the long winded post, but I wanted to give as much detail given this error has been raised before and snapshots are usually blamed as the cause.
    My question is this:
    If the ESX host had plenty of available disk capacity and there were no snapshots enabled on the VM (or any other VM's on the same host), then why did our Virtual machine crash with the error that 'there is not more space for virtual disk Servername_2.vmdk'?
    How do we prevent this issue from happening if we don't know the underlying cause?
    I would greatly appreciate any advice or suggestions.
    If I have not provided enough info on the specs or environment, please let me know and I will provide more information.
    Thanks all,
    Kurt

    The type of storage is really based on your requirements, and your ability to withstand downtime.
    iSCSI as you are using with a NAS such as Synology or QNAP.  NAS Selector - Support - Synology - Network Attached Storage (NAS)
    I wouldn't use iSCSI for Exchange or any database.  It's a bit slow.
    Do you have a single physical host?  Then I'd probably to an external direct attached storage.  This would be a card inserted in your host server that gives you multilane SAS/SATA connectivity (www.techcable.com/SAS-SATA/SAS-SATA.pps) and an external disk enclosure/array.
    For multiple hosts to a single array, I recommend a fibre channel connection to a FC capable switch, and on to a FC connected array.
    We used to use a HP P2000 (on old G1), but it's since been retired.  Worked pretty well once firmware was upgraded.  http://www8.hp.com/us/en/products/disk-storage/product-detail.html?oid=4118559#!tab=features.  They can be connected via iSCSI, Fibre Channel or 6GB SAS so they are flexible and reasonably priced.
    Recommendations:
         Use RAID 6 with your large disk arrays.  With large disks there is a measurable failure rate when rebuilding a failed RAID5 array based on MTBF.
         Use smaller 15K disks in RAID 0+1 for speed on databases/Exchange.
         Use slower 7.2K disks in RAID6 for file storage.
    We are a small hospital and we have 3 VMware servers with dual CNA (FC and Ethernet in a single twinax cable) connections to 2 redundant Cisco Nexus 5K switches and then 4 Fibre Channel connections to an EMC VNX 5300.  It's extremely fast with about 50 virtual servers, but was quite an investment.  One thing we don't have to worry about is down time.  If there ever is an equipment failure, we have redundant everything, including power split between two UPSs.
    Our VNX has 3 tiers of performance.  3 100GB SSD "Fast Cache" in RAID 1 with hot spare, to keep the most used data ready, but it's not really a tier, however one could be built utilizing the same disks.  A second tier is performance tier with a 8 600GB RAID 0+1 and hot spare.  The third is a bunch of 7.2K 3TB disks in RAID6.  The VNX autotiers, placing data on disks depending on where it's needed.  The volumes are sliced and diced automatically in the background to make this happen and we never have to touch it.  I used a demo of Solarwinds Storage Manager to monitor performance for a while and the utilization was always low, meaning all data access was fast, througout the day.
    D

  • How to disable a module for awhile when MOD_AUTOLOAD="yes"?

    Hello,
    By default, my system loads the ndiswrapper module on boot, and has my native wifi driver blacklisted. This is because the ndiswrapper driver works much more reliably for everyday use. However, I sometimes need a feature that the native rt2500pci driver offers. So, I figured this would be easy, I will write a shell script to unload the ndiswrapper module, and load the native driver module, and run this script when needed.
    What I found was that this does not work, the ndiswrapper module is automatically started again as soon as it is disabled. Then the wifi card continues to use ndis instead of the native driver. This is apparently because MOD_AUTOLOAD is enabled. So, I turned off MOD_AUTOLOAD, but found that to be an unsatisfactory solution for many reasons so I re-enabled it.
    What is a way that I can disable a module without having it automatically reload, without requiring a reboot every time I want to do this?
    My rc.conf (the relevant part):
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(autofs4 !snd_usb_lib !rt2500pci snd_virtuoso ndiswrapper)
    My shell script (This script probably has steps in it that are not necessary):
    #!/bin/bash
    # Script to unload ndiswrapper and load native rt2500pci driver, then reconnect to network. Run as root user
    ifconfig wlan0 down
    /etc/rc.d/network stop
    modprobe -r ndiswrapper
    modprobe rt2500pci
    /etc/rc.d/network start
    ifconfig wlan0 up
    iwconfig wlan0 essid "IMGIVINGUCANCER"
    dhcpcd wlan0
    Last edited by fatjake (2010-05-24 06:43:42)

    The problem was in /etc/modprobe.d
    There was a file with the following:
    alias wlan0 ndiswrapper
    If I changed my scripts so that every time the script was run it would remove that alias and add an alias for rt2500pci, then I could change to that driver on the fly without rebooting.
    The only problem is that after I am done using the native driver and want to switch back to ndiswrapper it fails. I made another script similar to the first one but to switch it back to ndiswrapper. It is unable to start the network and the mac address of the card shows as all zeros. Maybe I am crazy and should not be trying to change drivers for my wifi card without rebooting.
    Last edited by fatjake (2010-05-24 06:55:15)

  • WM/IM modules for SAP

    Being a newby to the WM/IM modules for SAP, does anyone know where I can get documentation and/or refer me to documentation on low level features of these modules.  I'm basically looking for answers to the features listed below. Thanks
    Feature
    RECEIVING
    ASN/EDI:
    Conventional:
    Automatic:
    Purchase Order:
    Lot:
    Serial Number:
    Vendor:
    QC Sampling:
    Receipts Tagging:
    Cross-docking:
    STORAGE/PUTAWAY
    Operator Directed:
    System Directed:
    Dedicated Storage:
    Random Storage:
    Verification:
    Quarantine:
    INVENTORY CONTROL
    Units of Measure:
    Shelf Life:
    QC Status:
    Bulk Storages:
    Lot Tracking:
    Consolidation:
    Relocation:
    Cycle Counting:
    ORDER PROCESSING
    Conventional:
    Local Terminal:
    Emergency:
    Back Orders:
    ORDER PICKING
    Mechanized:
    Pick Generation:
    Stock Allocation:
    Picking Labels:
    Picking Strategy:
    Negative Picking:
    Sortation:
    Restrictions:
    Pick Strategies:
    Verification:
    Pick Retasking:
    SHIPPING
    Order Verification:
    Anomaly Handling:
    Manifesting:
    Bills of Lading:
    Freight Ratings:
    Shipment Labels:
    Product Sizing:
    OTHER
    Reports/Screens:
    GUI
    Host Link:
    Returns:
    Fine Granularity
    Partial Receiving
    Handling Unknown
    Reverse Pick

    Hi Sonny,
    I am working with Extended Warehouse Management, the latest solution of SAP for WM/PI, and you will be glad to know that all the functionality asked by you are provided by EWM and many more.
    to know more about EWM you can search its documantation at https://help.sap.com
    search for mySAP Business Suite -> Supply Chain Management-> SCM 5.0 -> EWM
    you will find the complete documentation explaining the solutions to all your problems regarding warehouse management and PI. Just check it out.
    If you still faces problems or need some direct answers just ask me I will be happy to help you out.
    Regards,
    Shailesh

  • Standard BAPI or Function Module for FB01posting

    Hi Experts,
    My requirement is as follows.
    Invoice details would be sent across from Middleware to SAP and for which I have developed a Custom Remote Enabled Function Module. The Function Module needs to post the data using FB01 Transaction.
    I had planned for recording a BDC for FB01 and post the data, however, we are on the verge of getting upgraded from 4.7 to ECC 6.0. To avoid problems that we might face for change of screens in ECC 6.0, I would prefer using a BAPI or Function Module for FB01 posting, if available, instead of BDC.
    Data coming from Middleware are as follows.
    HEADER:
    BKPF-BLDAT :  Document Date
    BKPF-BUDAT : Posting Date
    BKPF-XBLNR: Reference (Invoice#)
    BKPF-BLART : Document Type
    BKPF-BUKRS : Company Code
    BKPF-BKTXT : DocHeader Text
    BKPF-WAERS : Currency
    LINE ITEM:
    BSEG-LIFNR : Vendor no
    BSEG-WRBTR - Total amt -Debit/Credit -Vendor
    BSEG-ZUONR : Assignment field
    BSEG-EMPFB : Alternative Payee
    BSEG-UZAWE : Payment Method Supplement
    BSEG-ZTERM : Pmt terms
    BSEG-KOSTL : Costcenter
    BSEG-HKONT : GL AccountNumber
    BSEG-WRBTR : Amount for GL
    BSEG-SGTXT : Line item text
    The Vendor Line Item would be one where as GL line items could me more than one.
    Can any of you suggest me a standard BAPI or Func Mod?
    Points will be awarded for valuable inputs.
    Thanks to all!!!!

    You can use RFBIBL00 program for FB01 postings. Go through the program help on how to use this program.
    This program requires a file to be on application server in a certain format.
    You may also refer the program RFBIBLT0 on how the file format should be.
    Hope this helps.
    Thanks,
    SKJ

  • Adapter Module for File Adapter

    I have a scenario where I have 2 related files (text file and a pdf file) for the message. I need to enhance the payload (content conversion from text file) with the size of the pdf file. I have developed a adapter module for this and it is working fine if there is 1 set of text and pdf file. But if there are more than 1 set of files, it is processing the first set and giving the below error for other files.
    "Error: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback."
    Regards
    Yogesh

    check this thread :
    BaseTransactionRolledbackLocalException in custom adapter module
    Exceptions in Recievr Communication Channel with Adapter Module

  • MalformedInputException Error in Adapter module for SFTP channel

    Dear All,
    I am using MessageTransformBean in adapter module for Plain to XML conversion. The channel works fine in all the cases but when I recieve     "  ì " or few more special characters in the file my channel does not pick file and show below error.
    Error: com.aedaptive.adapter.sftp.SFTPException : Aborting processing: com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
    I am using below parameter value in adapter module.
    Transform.Class : com.sap.aii.messaging.adapter.Conversion
    Transform.ContentType : text/xml;charset=ISO-8859-1
    Please help me if any of you have faces such error in your developments.
    Avanish

    Hi Grzegorg,
    I have tried using UTF-8 encoding in my channel but this doesn't work. Communication cahnnel is still giving same problem.
    Error: com.aedaptive.adapter.sftp.SFTPException : Aborting processing: com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
    The file which we are trying to process have character  Ì and as far as my serach is concerned i think this belongs to charset ISO-8859-1.
    Any more suggestion Guys to solve this problem.
    Thanks and Regards
    Avanish

  • Problem with Time stamp function module for converting US to Japan

    Hi All,
    I need standard function module for converting US Timestamp to Japan, Can any one let me know is there any standard function modules.
    thanks in advance!
    Regards,
    Kalidas.T
    Edited by: Kalidas Thirumoorthy on May 5, 2009 5:29 PM
    Edited by: Kalidas Thirumoorthy on May 5, 2009 5:30 PM
    Edited by: Kalidas Thirumoorthy on May 5, 2009 5:30 PM

    Try this way:
    CONVERT TIME STAMP <tst> TIME ZONE <tz> INTO DATE <d> TIME <t>.
    CONVERT DATE <d> TIME <t> INTO TIME STAMP <tst> TIME ZONE <tz>.
    <tst> is of type P(8) or P(11) with 7 decimal places
    <tz> of type C(6)
    Refer to help.sap.com for more details.

Maybe you are looking for

  • Why do I need to provide Apple with a credit card to change locations in the app store to download a FREE (yes, FREE) app?

    Is all this part of Apple's collective desire to **** off the consumer and drive them off? If so then its working for me.

  • External hard drive not showing up on the desktop

    I have a external hard drive and when i turn it on the icon for the drive does not show up. I used disk warrior and it found sever damaged sections of the drive. i fixed that and it is still not mounting. Should it get a new hard drive?

  • Regular Expressions in Oracle

    Hello All, I come from Perl scripting language background. Perl's regular expressions are rock solid, robust and very fast. Now I am planning to master Regular Expressions in Oracle. Could someone please point the correct place to start with it like

  • Offcycle Payment

    Hi Is there a way to process a single wage in OffCycle Payment which is dependend on other wage? Lets say wage type "5001 - Leave Encashment", for which the input is NUMBER, and output is AMOUNT. In PCR, the daily basic pay should be multipled by Lea

  • Itunes is unable to locate my appletv and my iphone won't sync

    Ever since I upgraded to ios5 and itunes 10.5 I am having trouble. First I got a message about being unable to remove an older version of Bonjour which I still have not resolved. Now when I open iTunes I get a message that it is connecting to the iTu