question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a mechanism by which Spyder would detect a file's type

See original GitHub issue

Is there a way to help spyder understand that a file (script) is in fact a python script, even if it doesn’t use the usual ‘.py’ extension and neither has the ‘#!’ shebang magic ? For emacs I’m embedding a # -*- python -*- line, but that obviously isn’t recognized by spyder. Is there any other mechanism I could use ?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rlaverdecommented, Jun 27, 2017

The languages configuration (that we’re planing to introduce in spyder4) could have a field “first line”, that will be a regex to detect the file based in the first line (like vscode do)

first_line = r"^#!/.*\\bpython[0-9.-]*\\b"

0reactions
goanpecacommented, Jun 27, 2017

We could use the pygments lexer detector?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Files — Spyder 5 documentation
You can view and filter files according to their type and extension, open them with the Editor or an external tool, and perform...
Read more >
Spiders — Scrapy 2.7.1 documentation
Spiders¶. Spiders are classes which define how a certain site (or a group of sites) will be scraped, including how to perform the...
Read more >
How do I debug efficiently with Spyder in Python?
Quick first debugging using iPython %debug ... The first thing I do is to call pdb from iPython using the magic command %debug...
Read more >
Input Files - Cantera
The required input files can be provided via one of several methods: ... Convert a pre-existing mechanism from Chemkin (CK) format to YAML...
Read more >
Testing Guide - OWASP Foundation
find errors, please add a note to the discussion page or make the ... files. For security testing, developers can rely on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found