如何知道我正在使用哪个发行版? 例如。我的版本行说:
3.6.6(v3.6.6:4cf1f54eb7,2018年6月27日,03:37:03)[MSC v.1900 64位(AMD64)]
是CPython吗? PyPy? Jython?等等...
答案 0 :(得分:1)
您可以在2.6以上的python版本上使用// Main index.ts
exports.funct = functions.https.onRequest(functexp)
// functexp file
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
import * as _request from 'request';
const serviceAccount = require('./credentials.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});
const db = admin.firestore();
export function functexp(request, response) {
console.log(`request`);
console.log(request);
let celebName_A = null;
let celebName_B = null;
if(request !== undefined){
celebName_A = request.body.data['Celebrity_A'];
celebName_B = request.body.data['Celebrity_B'];
console.log(`celebA is ${celebName_A}`)
} etc...
}
模块。
platform
对于C实现,这将返回“ CPython”,对于IronPython实现,将返回“ IronPython”,对于Java实现,将返回“ Jython”,对于PyPy版本将返回“ PyPy”。