Skip to content

Commit 35a4d0d

Browse files
author
dksimpson
committed
Fix spacing in code samples
1 parent 10d4960 commit 35a4d0d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/storage/blobs/storage-quickstart-blobs-python.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This command clones the *Azure-Samples/storage-blobs-python-quickstart* reposito
4141
In the application, provide your storage account name and account key to create a `BlockBlobService` object. Open the *example.py* file from the Solution Explorer in your IDE. Replace the `accountname` and `accountkey` values with your account name and key.
4242

4343
```python
44-
block_blob_service = BlockBlobService(account_name='accountname', account_key='accountkey')
44+
block_blob_service = BlockBlobService(account_name = 'accountname', account_key = 'accountkey')
4545
```
4646

4747
## Run the sample
@@ -88,11 +88,11 @@ Once you have the Cloud Blob container, instantiate the **CloudBlockBlob** objec
8888
In this section, you instantiate the objects, create a new container, and then set permissions on the container so the blobs are public. The container is called **quickstartblobs**.
8989

9090
```python
91-
# Create the BlockBlockService that is used to call the Blob service for the storage account
92-
block_blob_service = BlockBlobService(account_name='accountname', account_key='accountkey')
91+
# Create the BlockBlockService that is used to call the Blob service for the storage account.
92+
block_blob_service = BlockBlobService(account_name = 'accountname', account_key = 'accountkey')
9393

9494
# Create a container called 'quickstartblobs'.
95-
container_name ='quickstartblobs'
95+
container_name = 'quickstartblobs'
9696
block_blob_service.create_container(container_name)
9797

9898
# Set the permission so the blobs are public.
@@ -108,19 +108,19 @@ The sample code creates a local file to be used for the upload and download, sto
108108

109109
```python
110110
# Create a file in Documents to test the upload and download.
111-
local_path=os.path.expanduser("~\Documents")
112-
local_file_name ="QuickStart_" + str(uuid.uuid4()) + ".txt"
113-
full_path_to_file =os.path.join(local_path, local_file_name)
111+
local_path = os.path.expanduser("~\Documents")
112+
local_file_name = "QuickStart_" + str(uuid.uuid4()) + ".txt"
113+
full_path_to_file = os.path.join(local_path, local_file_name)
114114

115115
# Write text to the file.
116-
file = open(full_path_to_file, 'w')
116+
file = open(full_path_to_file, 'w')
117117
file.write("Hello, World!")
118118
file.close()
119119

120120
print("Temp file = " + full_path_to_file)
121121
print("\nUploading to Blob storage as blob" + local_file_name)
122122

123-
# Upload the created file, use local_file_name for the blob name
123+
# Upload the created file, use local_file_name for the blob name.
124124
block_blob_service.create_blob_from_path(container_name, local_file_name, full_path_to_file)
125125
```
126126

@@ -133,7 +133,7 @@ Block blobs can be as large as 4.7 TB, and can be anything from Excel spreadshee
133133
Get a list of files in the container with the `list_blobs` method. This method returns a generator. The following code retrieves the list of blobs—then loops through them—showing the names of the blobs found in a container.
134134

135135
```python
136-
# List the blobs in the container
136+
# List the blobs in the container.
137137
print("\nList blobs in the container")
138138
generator = block_blob_service.list_blobs(container_name)
139139
for blob in generator:
@@ -148,7 +148,7 @@ The following code downloads the blob uploaded in a previous section. *_DOWNLOAD
148148
```python
149149
# Download the blob(s).
150150
# Add '_DOWNLOADED' as prefix to '.txt' so you can see both files in Documents.
151-
full_path_to_file2 = os.path.join(local_path, string.replace(local_file_name ,'.txt', '_DOWNLOADED.txt'))
151+
full_path_to_file2 = os.path.join(local_path, string.replace(local_file_name, '.txt', '_DOWNLOADED.txt'))
152152
print("\nDownloading blob to " + full_path_to_file2)
153153
block_blob_service.get_blob_to_path(container_name, local_file_name, full_path_to_file2)
154154
```
@@ -157,7 +157,7 @@ block_blob_service.get_blob_to_path(container_name, local_file_name, full_path_t
157157
If you no longer need the blobs uploaded in this quickstart, you can delete the entire container using the `delete_container` method. To delete individual files instead, use the `delete_blob` method.
158158

159159
```python
160-
# Clean up resources. This includes the container and the temp files
160+
# Clean up resources. This includes the container and the temp files.
161161
block_blob_service.delete_container(container_name)
162162
os.remove(full_path_to_file)
163163
os.remove(full_path_to_file2)

0 commit comments

Comments
 (0)