グループ
ログイン
グループ
brython
スレッド
情報
フィードバックを送信
ヘルプ
How to make __name__ return "__main__" in exec
閲覧: 19 回
最初の未読メッセージにスキップ
Carlo Oliveira
未読、
2015/08/01 16:08:35
2015/08/01
投稿者に返信
投稿者に返信する場合はログインしてください
転送
転送する場合はログインしてください
削除
このグループ内のメッセージを削除する権限がありません
リンクのコピー
メッセージを報告
元のメッセージを表示
メールアドレスがこのグループでは匿名化されているか、メンバーのメールアドレスを表示する権限がないため、元のメッセージを表示できません
To: brython
Older versions of on line Brython would return "__main__" for __name__. Now they return exec_[number].
I want to use ace editor to teach python to my students to use the famous boilerplate:
if __name__ == "__main__":
main()
Currently I have to teach a weird variation:
if "exec_" in __name__:
main()
That is not compatible with Desktop Python and they have to change their code to run in Cpython.
How can a tune exec as to make __name__ = "__main__"?
This will help them to produce modules that can be tested as stand_alone but remain unchanged when tied together as a large program.
Olemis Lang
未読、
2015/08/01 17:39:37
2015/08/01
投稿者に返信
投稿者に返信する場合はログインしてください
転送
転送する場合はログインしてください
削除
このグループ内のメッセージを削除する権限がありません
リンクのコピー
メッセージを報告
元のメッセージを表示
メールアドレスがこのグループでは匿名化されているか、メンバーのメールアドレスを表示する権限がないため、元のメッセージを表示できません
To: bry...@googlegroups.com
Please , create a ticket . Thanks for the report .
> --
> You received this message because you are subscribed to the Google Groups
> "brython" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
brython+u...@googlegroups.com
.
> To post to this group, send email to
bry...@googlegroups.com
.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/brython/0818a666-3295-4e64-a2c5-624a8abad0d0%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout
.
>
--
Regards,
Olemis - @olemislc
Apache™ Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net
Blog ES:
http://simelo-es.blogspot.com/
Blog EN:
http://simelo-en.blogspot.com/
Featured article:
全員に返信
投稿者に返信
転送
新着メール 0 件