> On 12/12/2011 01:38 AM, Pete O'Connell wrote:
>> Hi I have been writing python code for a while now and I never return
>> anything within any of my functions, I just (eg.) print stuff or make
>> directories or update a log or what have you. When I look at other
>> people's code they are always r
ur reply on top -- it makes it difficult to find (and to
keep track of who says what when).
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
n
print(k)
What Peter said is very important too. I very much doubt you'll find
the solution with those loops.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ery well work but it doesn't actually time
anything for me. It's very frustrating, but I feel like I'm too stupid
to read the official documentation for it (that is, I might understand
the words in the documentation, but I can't get it to work). Please
help?
--
best regards,
ation that uses letters instead of phrases. Examples being the
standard Caesar cipher where "APPLE" might be written "BQQMB" (ie,
shifted one letter to the right).
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
On 15 December 2011 23:37, Calle wrote:
> -Ursprungligt meddelande- From: Robert Sjoblom
> Sent: Thursday, December 15, 2011 10:34 PM
> To: Calle
> Cc: tutor@python.org
> Subject: Re: [Tutor] [TUTOR]Code Deciphering
>
>
>> I was wondering, how do you use Python
> Some improvements to think about, in order of least secure (easiest) to most
> secure (hardest).
>
> (1) "my secret password.txt" is a crappy name. Is there a better name?
I'm going to go with "EULA.txt"; the reasons should be
uld know.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
asciiValue += shiftedCypherNumber
#and so on
PEP 8 is really worth reading through: http://www.python.org/dev/peps/pep-0008/
there's also a link to PEP 257 in it. If you follow most of the
suggestions in PEP 8 it will be much easier to read your code, and
because of that easier to help you.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e category including python there are at least 1,100,000.
What is your experience level doing basic research?
Robert Berman
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
I understand your problem. You are pickling a dictionary and
finding that it will not work unless there already is an existing
dictionary for your pickled dictionary to write over. Otherwise, there is
either no write at all or the write is followed by a
t cards are available, too. Forgot about that part. I guess you can
do:
sample(deck, 52) #or instead of deck range(1,53)
for each new round, and pop items from the returned sample instead of
popping the deck list every time. In the end I suppose it's a matter
of style. Oh, a
try it you will hook on to it for ever
>
> Thanks
> Best Regards
> Kapil
>
Pity it is only for Windows.
--
Robert Berman
The Torah says,
Love your neighbor as yourself.
The Buddha says,
There is no self.
So, maybe, we're off the hook.
___
print("This is critter_import.py")
The output will only be:
This is critter_import.py
If I subsequently create critters in critter_import.py, I will indeed
get the output that we see in critter.py, but that's because of class
behaviour and not because the if '__name__' block
new try. Can you think of any way to solve
that?
And while this might not be entirely on topic, there's a wonderful
book for complete beginners -- I've used it as well -- that I'd like
to recommend: Python Programming for the Absolute Beginner. In fact,
one of the excerc
overall I'd say that Eclipse was a better experience, but
Eric was by no means bad. I guess it comes down to user preferences.
As for books, Dive Into Python 3 is one of the better books I've come
across.
http://eric-ide.python-projects.org/
--
best regards,
Robert S.
___
moving parts of a class to a new
class for instance or renaming methods to better say what they're
about, subclassing or superclassing things and such.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change sub
just an educated guess, but it
doesn't really matter because it always comes back to the cp932 error.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
nt itself; it
would be best if it could run on any platform, but I'll take a Windows
machine with no changes to command line if I have to.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
(and I knew that as well, but I wanted to first
make sure that I could find what I was after properly). The structure
looks like this (I opted to use \t instead of relying on the tabs to
getting formatted properly in the email):
\t\tkeyword=
\t\t{
5 72 88 77 90 92 \t\t}
--
best regards,
Robert S.
__
to parse these files. We can't tell you how they're
structured so you'll have to figure that out yourself."? It's just so
much text that's it's hard to get a grasp on the structure, and
there's so much information contained in there as well; this is just
th
; y = random.choice(m_list)
>>> y
'message.'
>>> m_list.remove(y)
>>> m_list
['This', 'is', 'a']
>>> y
'message.'
You should probably move your y = random.choice() into the while loop.
A simpler way
():
myvalue = eval(name)
print name, "is", type(name), "and is equal to ", myvalue
There's also global(), local() and vars().
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
> What's "who and whos"?
They're matlab functions:
who lists the variables currently in the workspace.
whos lists the current variables and their sizes and types. It also
reports the totals for sizes.
--
best regards,
Robert S.
___
ttp://www.briggs.net.nz/snake-wrangling-for-kids.html
I've not had the chance to read "Invent your own computer games with
Python", so can't say anything about it.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To uns
I may be mistaken, but it looks like you are trying to open the socket on
port 2021. Standard ftp uses 21. Is the server listening on 2021?
On Sep 11, 2015 5:29 PM, "Martin A. Brown" wrote:
>
> Hi there Richard,
>
> Strictly speaking, it's no Python question, but... good ol' FTP.
>
> socket.error
To elaborate a little more this is comparing the 'one' bit. Any odd number
will have the 'one' bit set.
On Oct 14, 2015 6:30 PM, "Joel Goldstick" wrote:
> On Wed, Oct 14, 2015 at 4:47 PM, ਨਿਹੰਗ ਪੰਜਾਬੀ wrote:
>
> > 'if (n & 1)' below works but I don't understand why/how. Kindly help.
> >
> > =
I like to use paramiko for these types of things. Of course I don't have
all the details but from the info you have provided it seems like you
should be able to do this with ansible itself.
Regards,
Robert
___
Tutor maillist - Tutor@python.o
it to play back the inverse of the array for a noise cancelling affect. Any
ideas would be great.
Thanks,
Robert
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Would this meet the requirements?
merged_list = list1.extend(list2).sort()
On Mar 4, 2016 3:34 PM, "Danny Yoo" wrote:
> > As we can see, we have to do a lot more consideration of what state
> > our values are in, due to all the mutation happening. It also shows
> > that the second recursive cal
On Jan 3, 2013 2:22 a.m., "Conor Grevlos" wrote:
>
> I downloaded the python source folder, with chapters 1 through 12 I
think. But it just opens up the program that is already built, not one that
shows me the code.
Open the files in an editor of your choice, don't run them.
_
og/2011/08/11/recursion-explained-with-the-flood-fill-algorithm-and-zombies-and-cats/
If you just want to read the stack explanation, scroll down to
"Recursion is Just a Fancy Way of Using a Stack"
--
best regards,
Robert S.
___
Tutor maillist -
I recommend it to anyone who wants to learn Python, but
there are probably better books for *specifically* programming
principles -- this book is more of a bundled deal.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e or
> alternative approaches would be helpful.
I can't help you with that question, since I'm still (!) wrapping my
head around objects and haven't really gotten around to looking at
data validation and when/how you should do it
closely at the FRED API, but something
like (untested):
for key in dictionary:
print(key, dictionary[key])
could possibly get you started.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscri
>> Umm. No. Sorry, Mark, but that site and the core-mentorship list it
>> advertises are intended for progammers who want to be helped in the
>> development *of* Python, not development *in* Python. Ie, otherwise
>> experienced programmers who are unfamiliar with the Python codebase.
>>
>> TJG
>>
>
four keys (shift, ctrl, 1 and 0) nearby).
Some people like to use the number keys (8456 for WASD) instead, as
they too are relatively close to more keys, but overall I think that
WASD is the standard.
At least that's what I suspect.
--
best regards,
Robert S.
___
> What is the correct syntax to covert English characters from uppercase to
> lowercase and from lowercase to uppercase?
>
s.upper() and s.lower()
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change sub
you:
a) didn't send HTML emails
b) actually gave us the error message, as it says a lot about your
error other than "syntax error".
[snipped code]
Since we can't see your games class, nor your error message, we can't
really help you.
--
best regards,
Robert S.
_
next1 + period line:
..
Entering while loop. next1 is: ..
If you don't have to use strings for this program, I would suggest you
check out lists, and especially list.append(). It is possible to write
a program that does what you want, but it'd be a convoluted solution.
--
best regards,
On Mar 20, 2013 10:49 p.m., "xDog Walker" wrote:
>
> On Wednesday 2013 March 20 13:39, Robert Sjoblom wrote:
> > A word of advice: next is a keyword in python
>
> ~/Packages/Python/Notable-0.1.5b> python
> Python 2.5 (r25:51908, May 25 2007, 16:14:04)
> [
re:
http://docs.python.org/3.3/library/pickle.html#module-pickle
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
= Outcome('Ray')
>>> c = Outcome('Bob')
>>> a == b
>>> a == c
True
>>> a != b
True
>>>
However, if I were to create a class without the __eq__ and __ne__
definitions, what is to prevent me from doing: a.na
) class (just writing the unittests
for it), after that I'll tackle the Bin class, at which point I will
definitely return for more questions. As I said before, thanks to
everyone who answered.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@p
is the best one I've
come across.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
y and go with my horrible expressions, but that seems
like a cheap way out of a problem I'd rather tackle in a good way to
begin with)
Much thanks in advance.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hi,
I'm very new to python and am trying to figure out how to make a corpus from a
text file. I have a csv file (actually pipe '|' delimited) where each row
corresponds to a different text document. Each row contains a communication
note. Other columns correspond to categories of types of com
Message: 1
Date: Fri, 03 May 2013 23:05:32 +0100
From: Alan Gauld
To: tutor@python.org
Subject: Re: [Tutor] creating a corpus from a csv file
Message-ID:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 03/05/13 21:48, Treder, Robert wrote:
> I'm very new to python and a
y don't have that particular book, and I imagine many
others on this mailing list don't either, it'll be hard for us to
comment on the challenges, given that we don't know what they are.
--
best regards,
Robert S.
___
Tutor maillist
Hi python folks,
I have a list of lists that looks something like this:
tst = [ [], ['test'], ['t1', 't2'], ['t1', 't1', 't2'] ]
I want to change the empty sets to a blank string, i.e., '' and the lists with
repeat values to the unique set of values. So I have done the following:
>>> for
plain; charset=UTF-8; format=flowed
>
> On 21/05/13 08:49, Treder, Robert wrote:
>> Hi python folks,
>>
>> I have a list of lists that looks something like this:
>>
>> tst = [ [], ['test'], ['t1', 't2'], ['t1', 't1',
Hi,
I have Mac OS X 10.7.5 and would like to install < = python 2.3 on it.
I need it as one of the s/w I would like to try is based on an older version
and does not seem to work with the new ones.
I am not sure if the s/w is wrong (doesn't seem like it) or is it really the
python version that i
the answer glossed over to begin with. I'm not entirely
sure how it works other than that you can edit answers and it's then
moderated by someone -- maybe the person who initially wrote the
answer? Or maybe you get moderator rights when reach a certain sco
On 25 May 2013 14:42, Ken G. wrote:
> May I suggest that instead of:
> how about:
>
> flips = heads = tails = 0
>
> Ken
How about flips = heads = 0
tails can then be calculated from flips - heads.
--
best regards,
Robert S.
___
Tutor
Thanks to the OSA library, which works for SOAP requests with Python
3.x, I can now use SOAP services at http://www.chemspider.com.
The result is a list of accession numbers (which correspond to chemical
compounds) and I get them in the following format:
|(ArrayOfInt){
int[] = [
Hi Python tutors,
I'm fairly new to Python. I'm working with Python v2.7.4 and the nltk package
on a couple of text mining projects. I create several dictionaries that are
pretty static. Will probably only be updated every or month or every couple of
months. I want to turn those dictionaries
le. I have it working
now.
Bob
-Original Message-
From: Prasad, Ramit [mailto:ramit.pra...@jpmorgan.com]
Sent: Tuesday, September 24, 2013 6:23 PM
To: Treder, Robert (Research); tutor@python.org
Subject: RE: How to create dictionaries loadable with import
Treder, Robert wrote:
> H
here is probably a
better/more pythonic way to accomplish the same thing.
One thing to keep in mind is that the number of items in each list
will always be the same, ie... if list1, list2, list4 have 4 items
each, there will be 4 lists in list3.
Any advice would be
in advance!
-Robert
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
cool, thanks guys :)
-Robert
On Thu, Oct 30, 2014 at 7:24 PM, Danny Yoo wrote:
>
>
> On Thu Oct 30 2014 at 7:58:32 AM Lukas Nemec wrote:
>
>> Hello,
>>
>> take a look at argparse library.
>>
>
>
> Hi Robert,
>
> As Lukas mentions, it sounds
Hello Tutor,
I am having trouble finding a python 3.7.2 download for my MacOS Mojave
10.14.3 released mid 2014.
I would like to use Xcode to learn python.
Is my OS too old?
Please provide guidance.
Thanks.
___
Tutor maillist - Tutor@python.org
To un
hi folks, is there in python a gotoxy like in pascal so i can print stuff
in other parts of the screen?
what about some thing like it for the gui in windows?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
how is the best way to find out if a number is a perfect cube in python?
i am working if integer numbers only. i am asking because
pow(1728, 1.0/3.0) --> 11.998
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/
Need ti find out whem a number o this form i**3+j**3+1 is acube.
tryed a simple brute force code but, why this not work?
def iscube(n):
cubed_root = n**(1/3.0)
if round(cubed_root)**3 == n:
return True
else:
return False
for i in range(1,1000):
for j in range
happenig wen python round the the
cubed root. is this code wrong?
On 5/29/08, Kent Johnson <[EMAIL PROTECTED]> wrote:
> On Wed, May 28, 2008 at 8:43 PM, Robert William Hanks
> <[EMAIL PROTECTED]> wrote:
> >
> > Need ti find out whem a number o this form i**3+j**3+1 is ac
t for basic math in place of a calculator app.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
at one for me
Tom beat me to posting that, see here for more information on escape sequences
in Python:
http://docs.python.org/ref/strings.html
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
The correct form of the above would be as follows:
f = open("data.ini","w")
title = "taitle"
f.write('title is \"%s\"\n' % title)
f.close()
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
)
Please note that I have never used the write function before, but I just ran a
quick test with the python interpreter and that appears to be valid code.
For more information on string formatting, see here:
http://docs.python.org/lib/typesseq-strings.html
-Robert
__
e is the corrected version of your example, note that I have changed the
opening quote of f.write() to a singe quote in order to avoid confusion with
regard to the escaped double quotes:
def send(string):
f.write('\"%s\"\n' % string)
f = open("data.ini","
e between vi and vim when in comes
to basic editing tasks.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
between them. I can give you plenty of information about using
'screen' if you want it, what I'm getting around to is that if I was in your
situation I would have the python interpreter running in one virtual shell
whilst running vim in another virtual shell.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Sara Johnson wrote:
> Sure, sounds good. Should I assume that 'any' Unix version allows Vim?
>
> Thanks,
> Sara
Vim is extremely ubiquitous, you can check to see if it's installed by entering
'which vim' at the shell.
-Robert
_
your "SSH client."
The server to which you are connecting is the "SSH server."
Pico and Vim are examples of "text editors," which are sometimes called "UNIX
editors" by Windows folks.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
yone know?
>
> Thanks,
> Sara
Sounds like you're missing some fonts, but that's just a guess. I will look it
up further later tonight/tomorrow morning, I'm in the midst of a Thin Man
marathon.
-Robert
___
Tutor maillist - T
I
already answered on the 17th. I know this is more than a little OT, I'm just
wondering if somehow you didn't get that message.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
age delivery and simply
assume that I shouldn't cover two subjects in one post.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
tioned were for the latest edition of each book on
my list.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hey folks, I just need to know if shutil.copy2() will accept a directory as the
destination or if I have to supply a full path including the name of the file
(e.g. "C:\foo\bar.txt" as opposed to "C:\foo\"). The target is 32-bit Windows
XP with P
Never mind, SPE answered my question for me. Heh, I may have to stop coding
Python in vim 8?}
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Alan,
What you mistook for "vim 8" (with some garbage afterward) was in fact a smiley
I use frequently.
-Robert
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
301 - 381 of 381 matches
Mail list logo