I have been learning python for a few days now and needed something to put my mind into, I was searching for a way to create a map using turtle and came across this code on my computer I created a file.txt with the following coordinates:
river, 5
-400, 400
-333, 400
300, 500
sand, 5
555, -200
600, 554
334, 432
4332, 43 - import csv
-
block=[]
-
f=open("file.txt", "r")
-
csv_reader=csv.reader(f)
-
for row in csv_reader:
-
block.append(tuple(row))
This function does not work can someone help me conquer this
2 2405
What are you trying to accomplish with variable block?
I don't know what
This function does not work
means. It prints fine for me. - test_data="""river, 5
-
-400, 400
-
-333, 400
-
300, 500
-
-
sand, 5
-
555, -200
-
600, 554
-
334, 432
-
4332, 43"""
-
with open("./test.txt", "w") as fp_out:
-
fp_out.write(test_data)
-
-
import csv
-
block=[]
-
f=open("./test.txt", "r")
-
csv_reader=csv.reader(f)
-
print "\nInput file is"
-
for row in csv_reader:
-
print row
-
f.close()
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andre |
last post by:
Hi,
In 'test.htm', there are two Select, one visible, the other invisible. The
second becomes visible only if the number of records in a Access table <2.
There is also a button to start the...
|
by: Alex |
last post by:
Hi, I have a problem involving some design issue.
I have two unrelated (that is, they do not derive from the same base)
classes:
ClassA
ClassB
Both have a quite similar interface, so they can...
|
by: Jet Leung |
last post by:
When I debug my program and it return me an error call " have not handle
¡°System.StackOverflowException¡± appear in system.windows.forms.dll "
How can I solve this problem??
|
by: Shapper |
last post by:
Hello,
I have an ASP:ImageButton where I want to call a function and pass a
string:
OnClick="Change_Photo("John")"
I am having problems with "".
I tried
|
by: Mat |
last post by:
I am developping multi-user windows application. i use Access database.
user edit, add and delete data from database.
Request:
when an item is deleted ,added or modified by an user, all others...
|
by: Nobody |
last post by:
Anyone have a clean way of solving this define issue?
In Windows, there are sometimes unicode functions and multibyte functions...
the naming convention used is FunctionA for multibyte and...
|
by: jautrus |
last post by:
I would like to have div tag over list box, not list box over div tag.
I have this problem on many pages usually when I use drop down menus.
I try to solve this problem with z-index but it doesn't...
|
by: itsvineeth209 |
last post by:
My task is to create login control without using login control in tools. I shouldnt use sqldatasource or any other. I should use only data sets, data adapters and data readers etc.
U had created...
|
by: akmaRudiliyn |
last post by:
Hai everybody :). I have problem and need help.
ERROR:
ERROR Violation of PRIMARY KEY constraint 'PK_Table1_01'. Cannot insert duplicate key in object 'dbo.table1'.
ERROR The statement has...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |