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 2411
What are you trying to accomplish with variable block?
dwblas 626
Recognized Expert Contributor
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 VB-procedure. I choose first a value
into the first Select (sel1), then i click on the button to start
VB-procedure. If the value="a", then get 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 be use interchangeably,
that is:
ptr = new ClassA;
|
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 user in
the network which has application running should automatically see the
change. in case of remove action, the item should disappear from the...
| |
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 FunctionW for
unicode...
So basically what happens is:
void FunctionA();
void FunctionW();
|
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 work.
Have anybody some idea?
Problem only with IE .... like always :/
Here is the simple example:
<html>
|
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 table login with fields username(varchar(50)), password(varchar(50)), firstname(varchar(50)), lastname(varchar(50)).
U had to display username , first...
|
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 been terminated.
MY QUESTION:
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |