Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6872115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:53:14+00:00 2026-05-27T03:53:14+00:00

In ipython (0.10.2), I’d like to run with bash shell style (or glob.glob) expansion.

  • 0

In ipython (0.10.2), I’d like to run with bash shell style (or glob.glob) expansion. I’d like to do something like these and have the arguments expand out just as they would if I were in bash. Is this possible?

filenames = !ls *.sbet
run sbet.py $filenames
# fails because filenames is a list

# or the simpler case:
run sbet.py *.sbet
# failes with "*.sbet" being directly passed in without being expanded.

Suggestions? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:53:15+00:00Added an answer on May 27, 2026 at 3:53 am

    The return of filenames = !ls *.sbet is a special list, with a few extra attributes:

    • filenames.l – the list
    • filenames.s – a whitespace-separated string
    • filenames.n – a newline-separated string

    do filenames? in IPython for more info.

    So to pass the args to run, you want filenames.s:

    filenames = !ls *.sbet
    run sbet.py $filenames.s
    

    If you have a regular list, then you will need to turn it into a string yourself, before passing to run:

    filenames = glob.glob('*.sbet')
    filenames_str = ' '.join(filenames) # you will need to add quotes if you allow spaces in filenames
    run sbet.py $filenames_str
    

    You might make a feature request for automatic expansion of file globs when passed to %run if run foo.py *.sbet is valuable to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few IPython scripts which have redundant functionality. I would like to
If I have run a long line in IPython, and try and recall it
Python has IPython .. does OCaml have anything similar? I'd very much like to
I like to use IPython's zope profile to inspect my Plone instance, but a
I love iPython and am learning RoR along with some libraries like Mechanize and
Is there a way to get PHP-like print_r(object) funcionality in iPython? I know I
I have just been playing around with IPython. Currently I am wondering how it
I encountered a problem with the scope variables have when IPython is invoked at
Using ipython 0.11 if I type a function definition, like def f(s): print s
I have ipython (0.12.dev) installed and I have noticed that I cannot use it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.