kragniz / anyprint Goto Github PK
View Code? Open in Web Editor NEWUse any* language's print statements in Python
License: Do What The F*ck You Want To Public License
Use any* language's print statements in Python
License: Do What The F*ck You Want To Public License
Add Debug.Log("some string") support
It would be really useful to add windows powershell syntax support for "Write-Output" cmdlet.
Here is an example:
Write-Output This is a test
output:
This
is
a
test
๐
(prn "why not?")
echo 'Hello world!'
echo Hello world!
You forgot the greatest language of all, Clojure!
(println "Hello from Clojure!")
Makes it easier to install this.
When using C/C++, whenever I use something like printf, I usually use symbols such as __LINE__
or __FUNC__
.
It would be nice to define such symbols.
What is nice is that abusing the __str__
and/or __repr__
logic, it can be done easily: (disclaimer : code is not very tested):
import sys
def func_name(_):
return sys._getframe(1).f_code.co_name
def line_number(_):
return str(sys._getframe(1).f_lineno)
def file_name(_):
return sys._getframe(1).f_code.co_filename
class FunctionNameObject():
__str__ = func_name
__repr__ = func_name
class LineNumberObject():
__str__ = line_number
__repr__ = line_number
class FilenameObject():
__str__ = file_name
__repr__ = file_name
__FUNC__ = FunctionNameObject()
__LINE__ = LineNumberObject()
__FILE__ = FilenameObject()
class Titi():
def __init__(self):
print(__FILE__, __FUNC__, __LINE__)
def toto():
def tutu():
print(__FILE__, __FUNC__, __LINE__)
tutu()
print(__FILE__, __FUNC__, __LINE__)
toto()
Titi()
print(__FILE__, __FUNC__, __LINE__)
Hi,
The Rust idiom to write something on the console is:
println!("format {} arguments", "some");
the !
denotes a macro.
Any idea how this could be done in Python?
Ironically, what I miss most from Python is Python2's print, which for a language proud of getting rid of parenthesis, that is very contradictory....
As well all know, if you write using namespace std;
, you're a plebe.
Please add support for idiomatic C++ in Python.
std::cout << "Hello, C++ pedant!\n";
Ruby is a popular language, it's on top 20 of TOBIE Index and even get top 1 at 2006.
So anyprint should support least one of Ruby's print methods:
puts "Ruby"
print "๐"
p "โค"
The name says anyprint, yet it does not support prints like CMake or Elixir.
I propose to rename this module "partialprint"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.