result actually is. We
also don’t know the context in which the TypeError occurs.
Please paste the actual text session showing your interaction with the program
_and_ the full traceback so we can see what the TypeError is related to in the
code.
—
D
On 13/08/19 7:11 AM, Marissa Russo wrote:
This is my code:
import math
def get_numbers():
print("This program will compute the mean and standard deviation")
file1 = input("Please enter the first filename: ")
file2 = input("Please enter the second filename: ")
x = open(file1,
NB am heading somewhat OT
NBB Python3+
On 3/08/19 12:38 PM, Alan Gauld via Tutor wrote:
On 03/08/2019 00:47, Malcolm Greene wrote:
Anyways, I'm looking for help coming up for the proper name for a class that
collects the following type of telemetry data
Classes should never be named for the
maybe a copy/paste of your terminal session so we can see the text of the steps
you are actually performing will give use some clues.
—
David
> On Aug 1, 2019, at 18:22, David L Neil wrote:
>
> On 2/08/19 3:23 AM, Spencer Wannemacher wrote:
>> I'm new to python and I was
On 2/08/19 3:23 AM, Spencer Wannemacher wrote:
I'm new to python and I was trying to perform a simple one code. All that is
included in the code is print(61). I save it as 61.py and change the directory
before typing in python 61.py and I don't get an output. There is no error and
the output i
On 30/07/19 8:36 AM, James Hartley wrote> On occasion, I put long URL's
into comments/docstrings simply to document
where I found specific information. However, to be a good disciple of
PEP8, anything which can't fit within 72 characters needs to be split
across multiple lines. Since a number o
in-line in the
body of the email if we are going to be able to see it.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 24/07/19 3:21 PM, TAISHI KAWAMURA wrote:
Hi tutors on Tutor,
I'm Taishi from Japan working in a data analytics team.
Currently, I'm trying to analyse purchase data of a fashion brand.
However, mysterious KeyErrors started occurring continuously when I was coding,
and I haven't been able to
Hi Animesh,
Unfortunately the list server/email has removed the formatting from your
sample, but no matter...
On 24/07/19 5:06 AM, Animesh Bhadra wrote:
# This code creates a generator and not a tuple comprehensions.
my_square =(num *num fornum inrange(11))
print(my_square) # at 0x7f3c838c0c
On 18/07/19 10:08 AM, Alan Gauld via Tutor wrote:
On 17/07/2019 21:01, David L Neil wrote:
One line offers plenty of space to exert a claim (such can be very
simple and does not need to be lawyer-speak!) which should also refer to
the template's/package's external file or web-page.
On 16/07/19 12:47 PM, Alan Gauld via Tutor wrote:
On 15/07/2019 23:34, Mats Wichmann wrote:
Rule #1: it's all opinion in the end...
Not quite. Different jurisdictions (remember, this list has an
international membership!) have different understandings of (even,
respect for) copyrights and p
uirement to know them, but it does get easier with practice.
That said, if making a little python one-off filter to do what you need is
faster (to write) and works (well enough), it comes down to what your time is
worth.
—
David Rock
da...@graniteweb.com
_
On 16/07/19 10:34 AM, Mats Wichmann wrote:
On 7/15/19 3:25 PM, James Hartley wrote:
help(module_name) will place any text in the *first* module-level docstring
into the description section of the help page in Python 3.4.5. Subsequent
docstrings found at module level are ignored.
I have been us
On Tue, 9 Jul 2019 at 03:13, Alan Gauld via Tutor wrote:
> On 08/07/2019 15:14, Ibarra, Jesse wrote:
> >
> > I cannot seem to figure this potential bug out.
>
> Neither can we since we cannot see any code.
I'm guessing this might be the original post:
https://mail.python.org/pipermail/docs/2019-J
On 8/07/19 10:54 AM, Alan Gauld via Tutor wrote:
On 07/07/2019 20:54, David L Neil wrote:
(However, some of us grew-up at a time when RAM was expensive and even
in our relaxed state, such 'costs' still impinge on our consciousness -
Indeed, my first computer was at the local univ
On 8/07/19 2:48 AM, Alan Gauld via Tutor wrote:
On 07/07/2019 09:19, David L Neil wrote:
First-off, it has to be said that "100's of elements" suggests using an
RDBMS - particularly if 'age' (eg 23 and 99) is not the only likely
selection mechanism.
Multiple selection
First-off, it has to be said that "100's of elements" suggests using an
RDBMS - particularly if 'age' (eg 23 and 99) is not the only likely
selection mechanism.
On 7/07/19 2:39 PM, mhysnm1...@gmail.com wrote:
Hi all.
In C, you can use pointers to reference variables, arrays, ETC. In python, I
Hi Looking for a way to use the determine the position of a card in a grid
using the mouse click event in Python. Code is attached. There are no
viruses.
Unfortunately using Tinkter grids / frames can't determine between the two
demo cards.
Any suggestions are welcome
--
Dave Merrick
TutorInve
Hi Looking for a way to use the determine the position of a card in a grid
using the mouse click event in Python. Code is attached.
Unfortunately using Tinkter grids / frames can't determine between the two
demo cards.
The Relevant code is below
def showCardInitial(cardList):
cardsToPlay = [
On 26/06/19 4:56 AM, Alan Gauld via Tutor wrote:
On 25/06/2019 15:52, Sinardy Xing wrote:
My question is, how currently all of this great technology glue together
and as a final product for the enduser. Because I cant imagine that we
install Anaconda Jupyter Notebook at frontend for the enduser
Hi John,
On 25/06/19 4:15 AM, johnf wrote:
Hi folks,
I have the following loop (actually repeated many times )
def locChoices(self):
locDS = self.eslocation.getDataSet()
loc_Choices=['']
locKeys=[0]
for row in locDS:
loc_Choices.append(row['facil
ways helps along with any error
> messages. Also tell us about any 3rd party libraries you are using.
Also, what’s the use case? Do you want this to be something that is only
capturing keystrokes within the program itself, or do you mean to capture all
keystrokes happening regardless of appl
On 15/06/19 9:35 PM, mhysnm1...@gmail.com wrote:
This is a follow-up on my previous question for removing elements. Below is
the code I am currently using. I am removing the elements at the end of the
outer loop. The data structure goes along this:
[
['123123',[2019-2-18', 'transaction text',
new, the file reads is
probably more usable. The shelving of data is most useful for easier retrieval
later so you don’t have to re-process the raw data every time.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To un
Hi.
I am currently working on a project for myself.
The code posted here is supposed to ask the user for an amount of numbers,
what those numbers are, and places those numbers in a list.
The next job of the code is to sort the list of numbers that were inputted
in an ascending fashion.
There is no
On 18/05/19 4:15 AM, Alan Gauld via Tutor wrote:
On 16/05/2019 04:17, Alex Kleider wrote:
Alt-Tab and the X cut 'n paste mechanism provides
enough integration between windows.
I tried this (Ubuntu 18.4) and Alt-Tab cycles between terminal and
browser but I can't make it cycle from one termina
On 13/05/19 6:13 AM, Alan Gauld via Tutor wrote:
On 12/05/2019 10:15, David L Neil wrote:
Interestingly, I split these into two - my laziness for running/testing
is 'Save, Alt-Tab, Up-arrow, Enter' which would be 'ruined' by using the
cmdLN for anything else.
In a bash sh
On 12/05/19 7:59 PM, Alan Gauld via Tutor wrote:
On 12/05/2019 00:24, David L Neil wrote:
"3 consoles": what is the purpose of each?
(my first reaction stemmed from many editors including a built-in console)
One for vim,
yes - that 'replaces' the window/app running an
Hi Dave,
I also volunteer to do PAT safety testing during my "20% time".
Clambering around Snowdonia as a boy, I eschewed* the Rheilffordd yr
Wyddfa/SMR in favor of shanks' pony...
* OK, I was made to...! For the good of my soul???
On 9/05/19 8:04 AM, Dave Hill wrote:
I have a csv file whic
On 12/05/19 10:57 AM, Alan Gauld via Tutor wrote:
On 11/05/2019 19:59, Cranky Frankie wrote:
...
1) For the IDE I'm most comfortable with Netbeans/Java,
In that case use Netbeans. I use Netbeans myself when working
with Java and have played with its Python implementation and
its OK. Personall
Hi Arup,
On 30/04/19 5:55 AM, Arup Rakshit wrote:
class NonBlank:
def __init__(self, storage_name):
self.storage_name = storage_name
def __set__(self, instance, value):
if not isinstance(value, str):
raise TypeError("%r must be of type 'str'" % se
On Sun, 28 Apr 2019 at 02:57, Alan Gauld via Tutor wrote:
> On 27/04/2019 01:22, David wrote:
>
> > It's no big deal, but I wonder why you wouldn't approve an address
> > the first time you see that it is being used for legitimate discussion.
>
> Time...
>
On Sat, 27 Apr 2019 at 02:14, Alan Gauld via Tutor wrote:
> On 26/04/2019 13:48, Arup Rakshit wrote:
>
> > BTW, one thing I would like to know about this list is that, everytime I
> > send an email I see it the in list after 2 hours approx. Is this for me
> > or everybody? I am just curious.
>
> J
apologize in advance! But that is okay. I am not a professional nor
expert programmer myself. Because of this, I recall agonizing over
the choice of code editor, or, possibly even worse, deciding whether
to use an IDE or editor. This is a difficult decision about which
many wax poetic and expr
On 18/03/19 6:05 AM, Mats Wichmann wrote:
On 3/16/19 11:39 AM, Valerio Pachera wrote:
Consider this:
import collections
d = OrderedDict(a='hallo', b='world')
I wish to get a single string like this:
'a "hallo" b "world"'
Notice I wish the double quote to be part of the string.
In other words I w
the output you had, I’d think something was broken because I think in
terms of first day being Sunday, so maybe include a note in the output what the
First day of the week is if that’s appropriate?
—
David Rock
da...@graniteweb.com
___
Tutor mail
, 0, 0, 0, 0, 1, 2]
Which I’m sure is just a question of “defining the start of the week” properly,
but if you just took it as-is, Mar 1 would be Thursday, not Friday if you
translated literally.
—
David Rock
da...@graniteweb.com
___
Tutor mailli
r(2019,3)
> [[0, 0, 0, 0, 1, 2, 3], [4, 5, 6, 7, 8, 9, 10], [11, 12, 13, 14, 15, 16,
> 17], [18, 19, 20, 21, 22, 23, 24], [25, 26, 27, 28, 29, 30, 31]]
>>>>
>
> That looks close to what you want?
That seems close, but off by a day?
—
David Rock
da...@graniteweb.com
_
table of what each setting does, to help you pick the best
option for your needs.
You might also want to set the RestartSec to something other than zero. If you
set it to something like 20 seconds, it would also give you time to manually
disable the service i
s. Naming it TestVideo6.py would be less prone to “weird things”
happening down the road.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
e? How long of a delay before you don’t try to
start anymore? What about media resources? How long will you wait if you have
tape devices all in use? Is this just a disk-based backup system?
Good backup software is not trivial to write. Maybe if we better understood
your goals, we could better
On Thu, 21 Feb 2019 at 14:35, Matthew Polack
wrote:
>
> Just wanted to update this thread regarding a resource for beginning
> students. We are now 4 weeks into the course and have found ...
Hi Matthew,
Thanks for sharing your progress here! I'm very pleased to hear
you are finding classroom re
On Tue, 5 Feb 2019 at 15:03, David wrote:
>
> 1) The given title is misleading, in my opinion its subtitle would be much
> more
> representative: "Enabling students [by] example-driven teaching".
Hi again,
Sorry for replying to myself, but I want to correct something wr
On Tue, 22 Jan 2019 at 20:30, Matthew Polack
wrote:
>
> Hi All,
>
> In our growing school we're teaching Python programming for the first time
> as an elective subject with Year 9 and 10 students. (Had a dabble at this
> last year with 3 students in Year 11)
Hi Matthew and other readers,
I wonde
> On Jan 17, 2019, at 16:13, Peter Otten <__pete...@web.de> wrote:
>
> David Rock wrote:
>
>> both a and nan are floats, so why does a == a work, but nan == nan
>> doesn’t?
>
> It does "work", it's only produces a result you didn't expec
> On Jan 17, 2019, at 13:40, Peter Otten <__pete...@web.de> wrote:
>
> David Rock wrote:
>
>>
>> Isn’t this a bit artificial, though? The reason this is False is because
>> you explicitly tell it to return False when using equality. That’s not
>&
.
>>>> a = A()
>>>> a == a
> False
Isn’t this a bit artificial, though? The reason this is False is because you
explicitly tell it to return False when using equality. That’s not the same
thing as using __eq__ without over
n I type return(function) will it
rerun the code from the top?
I'd appreciate any advice!
David Lynch
print("Passive income from incentivised onboarding")
capital = float(input("Amount of capital raised: "))
amount_invested = float(input("Amount invested: &qu
ke a concise, on
topic, point would be helpful in this case. When discussions appear to ramble
at length in odd tangents, the helpfulness to the beginner is diluted and the
original point of the discussion is lost.
—
David Rock
da...@graniteweb.com
> On Dec 4, 2018, at 13:31, Avi Gross wrote:
>
> David,
>
> What does it mean when someone says they cannot install a module? I can see
> how a school assignment might require using only some limited set of
> functionality. I note some installations add more t
> On Dec 4, 2018, at 15:37, Alan Gauld via Tutor wrote:
>
> On 04/12/2018 18:30, David Rock wrote:
>> you MUST stop trying to use batch mode, because it will never work.
>
> But you could presumably use interactive mode via Popen
> by taking control of the stdin/out
n the
constraints you have proposed up to this point.
1. Can you set up ssh key passwordless authentication?
if yes, then do it and what you have now will start working
if no, then you can’t use sftp the way you are currently trying (the -b
“batch mode”) and find a different solution (expe
>> module .
>
> That looks like the problem that David already highlighted
> with sftp.
Yup. So, back to my other question regarding ssh key access…
Do you have the ability to ssh to an account on the target system (i.e., use
ssh to log in, not use sftp to grab a file)?
If you
tive authentication.
You would need to set up an ssh key with a null passphrase, or set up an
ssh-agent in order for that to work.
Another option would be to use pexpect to automate console input
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
tasets in
AWS. Unless you can use a web proxy, or possibly get a local mirror of the
deepchem.io data on a university system you _can_ reach, this may not be
possible to resolve.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@pyt
ve:
How would you get input?
How would you break up a string into individual characters?
How would you break up an encoded string into individual numbers?
How would you put the characters/numbers back together for output?
Have you started writing any code? What have you tried so far?
—
Da
ock and handle exceptions
For the OS version, test against os.name or sys.platform
The last one, “functionality,” is a bit vague. Probably another candidate for
a try block.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
T
rcuitpython
These have been great to allow people learn not only python, but how to
physically interact with the world outside the computer.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change su
port displaying the colors.
If you are trying this in the python interpreter, try making a basic test
script and run it instead to see if it works outside the interpreter
environment.
I assume you are on Windows, too. What OS and what version of Python are you
using?
—
David Rock
da...@gr
d-GPA
let us know what you have tried so far and where you get stuck, and we will be
better able to help.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> gws = netifaces.gateways()
>>> gws
{'default': {2: ('192.168.69.1', 'e
the top, I would suggest looking for a "plain text" selection on a dropdown.
--
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
7; | cut -d"=" -f3" % (fs)*
It’s probably because you have “ characters that are inside “ characters and it
can’t tell where the string ends. It looks like you are trying to do
cmd = "blkid -o export %s | grep 'TYPE' | cut -d” = " -f3"
.
>>
>
> You'll want to get the original and work from there. You already know
> where it is - you've included the github link.
>
There’s another option… Ask Adafruit directly.
They are amazingly helpful and would be more than happy to hear if there’s a
potentia
some lingering cruft in memory.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
cs.kali.org/downloading/kali-linux-live-usb-install
Doing it this way, you get better flexibility with having Kali without
[potentially] destroying what’s currently on your system through trying to set
up a multi-boot environment.
Bite of smaller chunks instead of trying to learn everything at once
> On Jul 10, 2018, at 22:04, David Rock wrote:
>
>> On Jul 10, 2018, at 21:46, Jim wrote:
>>
>> ltrs = [['A', 'B'], ['C', 'D', 'E'], ['F', 'G', 'H', 'I']]
>
> A fairly s
for j in ltrs[1]:
... for k in ltrs[2]:
... print l,j,k
A C F
A C G
A C H
A C I
A D F
A D G
A D H
A D I
A E F
A E G
A E H
A E I
B C F
B C G
B C H
B C I
B D F
B D G
B D H
B D I
B E F
B E G
B E H
B E I
Not the most elegant, but probably the easiest to follow.
—
David Rock
da...@granitewe
every file look the same? is it always a header and
data separated by empty lines?
Hopefully we will get some feedback.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
t; range(1,5)
[1, 2, 3, 4]
https://docs.python.org/2/library/functions.html#range
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
with your
questions and interview, as well as to give you pointers on next steps in
learning and proficiency.
Good Luck,
David
On Thu, Apr 26, 2018 at 4:00 PM, Kahraman, Sam K. <
skahra...@cherrycreekschools.org> wrote:
> Hello,
>
> I am a 8th grade student at Campus Middle Sch
nction using text is a pretty complete exercise that
might help you visualize problems (and help with you other classes, too).
Are you interested in making things move or turning stuff on/off? Using python
on a Raspberry Pi is a great way to start with using a computer to control the
“real world.
rt separately, and it should be fairly straightforward. Look up
methods for parsing formatted strings as a place to start.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ere you have tried to go.
I would also recommend talking to your classmates that are having more success
as a first attempt to get some direction. 2 days is not much time for a
mailing list to help you understand an unknown assignment.
—
David Rock
da...@graniteweb.com
___
ore) pythonic to use the standard libraries. It’s very
common in a professional environment to not have access to outside (i.e.,
internet) resources. I wouldn’t venture into Pypi unless there’s something you
can’t do well with what’s already provided by default.
—
David R
7; to
> tutor-requ...@python.org
>
> You can reach the person managing the list at
> tutor-ow...@python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
> Today's Topi
umber == 4:
print("\n", prefix,"You will love the spicy shrimp and garlic.")
elif number == 5:
print("\n", prefix,"You will meet an old friend soon.")
#input("\n\nPress the enter key to get another fortune.")
--
*David*
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
-
Message: 2
Date: Thu, 22 Mar 2018 18:35:17 +0100
From: Peter Otten <__pete...@web.de>
To: tutor@python.org
Subject: Re: [Tutor] Oracle forms
Message-ID:
Content-Type: text/plain; charset="ISO-8859-1"
David Holland via Tutor wrote:
> Is there anyway I can use Py
Is there anyway I can use Python to fill in an Oracle form rather than typing
it in myself.I.e take values from a .csv file and put them into an Oracle
form.Any ideas (I have googled it) what libraries to use?
___
Tutor maillist - Tutor@python.org
T
Welcome,
Your attachments did not come through. This list generally only works with
in-line text. If you post your code, what you expect and what the errors are,
we will have a better chance of helping.
Being a tutor list, help with the selenium framework is not guaranteed, though.
it doesn't work, you are suppsed to declare a function as def func() and it
comes back as:
File "", line 1
def func()
^
SyntaxError: invalid syntax
that is not expected I would also expect def to turn red because it is a
keyword in Python, but that doesn't happen, anyone else hav
lem. You are importing date _from_
datetime, but then try to call datetime.date
> from datetime import date
You have _not_ imported date time, so the program doesn’t know what you mean
when you say
answer = datetime.date(year, month, day).weekday()
Try just doing
import datetime
instead
ll (i.e., where
did you get it from)? Different bundles install differently, so knowing
exactly what you downloaded will help identify some of the other questions.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To u
lly strings, so make sure you are storing them as floats
2. put them in a list. You can then use list built-ins to sort
What have you tried so far? Are you trying to start at all, or are you trying
things that aren’t working?
—
David Rock
da...
me thing about python 3, and that’s not something I’m likely
to be able to fix within the bounds of company procedures.
So while the original statement is obviously false, the heart of why it was
said is functionally true.
—
David Rock
da...@graniteweb.com
_
found.
Please let me know if we can email each other or call. I would appreciate
your help, I am very desperate! Thanks
David A. Torres
GitHub : https://github.com/dav1dt0rres
-Man lives like a robot: mechanically efficient, but with no awareness.
Department of Computer Science
Departme
pts tend to be pretty self-contained and written
for my own purposes, so that would rarely be an issue.
How would you hide main() if you _were_ concerned about it?
--
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscri
* Alan Gauld via Tutor [2017-07-05 20:36]:
> On 05/07/17 16:37, David Rock wrote:
>
> > This is a question about the benefits of using a main() function vs not.
>
>
> Others have answered for the pros, but I confess that I don't
> always use a main(), but
f __name__ == '__main__':
#code goes here
vs
def main():
#code goes here
if __name__ == '__main__':
main()
I personally find using main() cumbersome, but many examples I come
across use main(). Is there some fundamental benefit to using main()
that I&
> On Jun 15, 2017, at 13:16, William Gan wrote:
>
> Hi David,
>
> Very much thanks for taking time to help.
>
> Your explanation has helped me understand that syntax issue better. I have
> resolved that error.
>
> Your counsel on the second issue has given me
ust keep trying things. When you run into something like this, the
most effective way to troubleshoot is narrow it down to the essential issue.
In this case, “why is the if statement always evaluating to true?” Look at the
parts and re-read what each does (eg, reread how the ‘or’ operator works
Which reads the entire file into memory. They specifically did not want you to
do that.
The implication is they were looking for a solution where you read the file
maybe one line (or even one word) at a time and look for anagrams in smaller
groups.
—
David
___
Thanks all for the help.
Pycharm just posted an update to their Pycharm Edu product, and when I
re-ran the script, everything was fine.
Best,
David
On Tue, May 2, 2017 at 4:27 AM, Alan Gauld via Tutor
wrote:
> On 02/05/17 01:42, David Wolfe wrote:
>
> > I'm working through
p getting the error message
"Too short string in the output"
Any suggestions?
Thanks,
David
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature
code and the errors you are getting so we can see what issue
you are having.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
> On Mar 13, 2017, at 16:19, jarod_v6--- via Tutor wrote:
>
>
> What can I do for parse better that file and Have only the comma outside the
> string ?
>
I recommend using the cvs module rather than try to write your own.
https://docs.python.org/2/library/csv.html
ollow what you expect the output to be, though.
What do you want the results of running the script to look like?
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
yours: You have a book, towel, shirt, pants, in your luggage.
String concatenation with a loop is notorious for adding extra stuff at the
end. To get it right, you have to take into account what to do at the end of
the list, which adds code complexity.
—
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
e he wasn't looking, and
> sneaked in some commas and spaces ;)
>
> That's cheating...
yeah, just a little. :-)
You can use join for this:
suitcase = ["book", "towel", "shirt", "pants"]
output = ', '.join(suitcase)
print ("You
e a specific order by design so will always be in
the order they were created.
What are you trying to do with join() on a dictionary in the first place? Is
there a specific outcome you are trying to get? It’s unlikely that using join
on a dictionary is what you actually want.
—
David Rock
da...@g
1 - 100 of 1103 matches
Mail list logo