bmc / fortune Goto Github PK
View Code? Open in Web Editor NEWPython Fortune Program
Home Page: http://software.clapper.org/fortune/
License: Apache License 2.0
Python Fortune Program
Home Page: http://software.clapper.org/fortune/
License: Apache License 2.0
I am a newer, I just clone this repo to my local disk. I want to learn about the source code of this program.
I just find the init.py under the fortune dir, is this all the source code?
error: Couldn't find a setup script in /tmp/easy_install-6K1u0m/grizzled-python-1.0.3.linux-x86_64.tar.gz
Traceback (most recent call last):
File "/bin/fortune", line 6, in
from fortune import main
File "/usr/lib/python2.7/site-packages/fortune/init.py", line 178
print('Missing fortune file.', file=sys.stderr)
^
SyntaxError: invalid syntax
[root@lisiliang-test-vm13-237 data]# fortune /usr/share/games/fortunes/chinese.dat
Traceback (most recent call last):
File "/bin/fortune", line 6, in
from fortune import main
File "/usr/lib/python2.7/site-packages/fortune/init.py", line 178
print('Missing fortune file.', file=sys.stderr)
^
modify this row to " print('Missing fortune file.')
resolved
With both easy_install and running setup.py manually, I receive the following traceback:
Traceback (most recent call last):
File "setup.py", line 41, in
info = load_info()
File "setup.py", line 38, in load_info
result['long_description'] = DESCRIPTION
NameError: global name 'DESCRIPTION' is not defined
Adding a default DESCRIPTION value to setup.py fixes it, but I'm pretty sure we shouldn't be hitting the 'except' clause on line 37, so there may also be a better fix possible.
I'm getting the following error:
$ fortune
Traceback (most recent call last):
File "c:\Python27\Scripts\fortune-script.py", line 9, in <module>
load_entry_point('fortune==1.0', 'console_scripts', 'fortune')()
File "c:\Python27\lib\site-packages\fortune-1.0-py2.7.egg\fortune\__init__.py", line 282, in main
sys.stdout.write(get_random_fortune(fortune_file))
File "c:\Python27\lib\site-packages\fortune-1.0-py2.7.egg\fortune\__init__.py", line 186, in get_random_fortune
data = pickle.load(fortuneIndex)
EOFError
I'm on Windows (Msysgit). I'm using your fortune's database files.
hugo.delacruz@DELLE6430HUGO ~
$
I installed the program via pip
and downloaded your fortune cookies.
Now I can easily run fortune path/to/file
and even fortune $FORTUNE_FILE
as displayed on the screenshot. However, a good simple fortune
fails to find the variable.
This is how I set the variable on my $PROFILE, if it helps:
$FORTUNE_FILE = Get-ChildItem -Path "$env:HOMEPATH\dotfiles\docs\fortunes" | Get-Random | Select-Object -ExpandProperty FullName
It's great as it is, but maybe could you describe how to properly set up the environment variable on Windows? Thanks!!
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.