python> os.path.join ('data','checkpoint')>'data / checkpoint' on linux

Operating environment


Ubuntu 14.04 LTS desktop amd64
GeForce GTX 750 Ti
ASRock Z170M Pro4S [Intel Z170chipset]
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v7.5
Python 2.7.6

I'm learning python code for Deep Learning related things called TensorFlow. https://www.tensorflow.org/versions/master/tutorials/mnist/tf/index.html#tensorflow-mechanics-101

flags.DEFINE_string('train_dir', 'data', 'Directory to put the training data.')
...
        
checkpoint_file = os.path.join(FLAGS.train_dir, 'checkpoint')

I implemented the above with ideone.

http://ideone.com/v9DXUH

# your code goes here
import os.path

train_dir = 'data'
print train_dir

train_file = 'checkpoint'
print train_file

train_path = os.path.join(train_dir, train_file)
print train_path

result


Success	time: 0.01 memory: 9024 signal:0
data
checkpoint
data/checkpoint

It seems that / is added automatically.

Recommended Posts

python> os.path.join ('data','checkpoint')>'data / checkpoint' on linux
Install Python Pillow on Amazon Linux
Introduce Python 3.5.2 environment on Amazon Linux
Find files like find on linux in Python
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
Python on Windows
python on mac
Python on Windbg
Python conda on cygwin
Daemonizing processes on Linux
Install Python on Pidora.
Install Scrapy on python3
Take your own peak memory usage on Linux & Python
Linux (WSL) on Windows
NAT router on Linux
Yum command to access MySQL with Python 3 on Linux
Install Python on Mac
Install Python 3 on Mac
Install Python3.4 on CentOS 6.6
Installing pandas on python2.6
python basic on windows ②
Install python on windows
Develop .NET on Linux
Wake on lan on Linux
Compile and install MySQL-python for python2.7 on amazon linux
Monitor traffic on Linux
About the --enable-shared option when building Python on Linux
build Python on Ubuntu
Try NeosVR on Linux
Install Python 3.4 on Mac
Check capacity on Linux
How to build a Python environment on amazon linux 2
Install Python 3.6 on Docker
LiveUSB creation on Linux
Linux operation on Win10
Put the latest version of Python on linux (Debian) on Chromebook
Test Python with Miniconda on OS X and Linux with travis-ci
Update monitoring of dmesg (/ dev / kmsg) from python on Linux
NTP configuration memo on Linux
Set-enable Python virtualenv on Windows
Install Minecraft on Arch Linux
Set up Python 3.4 on Ubuntu
Run Openpose on Python (Windows)
Use matplotlib on Ubuntu 12 & Python
Install Linux on your Chromebox
Install watchdog on Windows + Python 3.3
Python on Ruby and angry Ruby on Python
Downgrade Mcomix on Arch Linux
Install pygame on python3.4 on mac
Monitor disk usage on Linux
Python + Kivy development on Windows
Use Github Desktop on Linux
Install Python 3.8 on CentOS 7 (SCL)
Install the JDK on Linux
Elixir = Comfortable on Linux Mint
Real-time graphs on Plotly (Python)
Made python available on macOS
Recording and playback on Linux
Sphinx-autobuild (0.5.2) on Windows7, Python 3.5.1, Sphinx 1.3.5
Put Python 3.x on Ubuntu
Fastest Python installation on Windows