On 10/02/2012 11:45 PM, Dave Wilder wrote:
>
>>> Hello,
>>> Below is a snippet of a search I want to do for any file that contains the
>>> string "quarantine" in the filename.
>>> It works for picking up any file name containing "quarantine" except when
>>> "quarantine" is used as an extension.
>
On 10/03/2012 03:59 PM, Brannon, Terrence wrote:
> I'm wondering if there is something I overlooked for this function I wrote...
> and also whether it could've been done destrictively instead of returning a
> new dictionary:
>
> def dictNoneValueTo(d, new_value=''):
> """force None values in
On 10/03/2012 09:56 PM, Leo Degon wrote:
> So Ive got code that i import a module to get certain saved variables,
> where i edit the text file that comprises the module to edit those saved
> variable. My problem is I cant reload the module to access those modified
> variables.
> I was wondering how
On 10/03/2012 11:11 PM, boB Stepp wrote:
> Thanks to all who responded.
> .
> What happens if str() or repr() is not supported by a particular
> object? Is an exception thrown, an empty string returned or something
> else I am not imagining?
Let's try it and see:
>>> class A:pass
...
>>> a = A()
On 10/03/2012 11:52 PM, Ed Owens wrote:
> You are fundamentally correct about my confusion, though I'm trying to work
> with tuples as the lowest level, which may not be relevant here.
The tuples are an example of an immutable object. An immutable object
(which contains only immutable objects) may
On 10/05/2012 07:23 AM, Albert-Jan Roskam wrote:
> - Original Message -
>
>> From: Asokan Pichai
>> To: tutor@python.org
>> Cc:
>> Sent: Friday, October 5, 2012 11:06 AM
>> Subject: Re: [Tutor] rounding up to the nearest multiple of 8
>>
>> If you are doing so many times, it may be worth
On 10/06/2012 07:19 PM, Richard D. Moores wrote:
> On Fri, Oct 5, 2012 at 7:15 AM, Walter Prins wrote:
>
>> Does this hint help?
>>
> import datetime
> mydate = datetime.date(2012,10,5)
> mydate = mydate + datetime.timedelta(days=30)
> print mydate
>> 2012-11-04
> Yes! Thanks to al
On 10/06/2012 09:10 PM, Richard D. Moores wrote:
> On Sat, Oct 6, 2012 at 4:29 PM, Dave Angel wrote:
>
>> To turn an integer (0-6, or whatever) into a string, just use a tuple of
>> the same size:
>>
>> tran = ("MONDAY", "TUESDAY", "WEDNESDA
On 10/07/2012 06:49 PM, Esteban Izaguirre wrote:
> Hi, I'm following coursera's learn to program: the fundamentals, which
> teaches programming basics in python. Our first assignement involves the
> modulo operator with a negative divident, and while I've managed to get to
> understand it enough fo
On 10/07/2012 07:16 PM, Oscar Benjamin wrote:
> On 8 October 2012 00:07, Dave Angel wrote:
>> On 10/07/2012 06:49 PM, Esteban Izaguirre wrote:
>>> Hi, I'm following coursera's learn to program: the fundamentals, which
>>> teaches programming basics in pytho
On 10/07/2012 08:00 PM, Jan Karel Schreuder wrote:
>
>
> On Oct 7, 2012, at 7:24 PM, Dave Angel wrote:
>
>>>>>
>>>>
>>
>> It still makes no sense to me. There are at least two equally silly
>> ways to define the results of a negat
On 10/08/2012 12:43 PM, Benjamin Fishbein wrote:
> I figured out a solution for the question I asked on here.
Why then did you start a new thread, instead of responding on the same
one? You didn't even use the same subject string.
> To find the next digit (0-9) in a string, I use:
> text.find("0
On 10/09/2012 12:27 PM, tayo rotimi wrote:
> Hi,
>
>
> I have started creating GUIs. But my current challenge now is saving the GUIs
> created. I have observed that
> whenever I close the console, the GUIs also get closed. So, please what do I
> need to do to save the GUIs, or call them back whe
On 10/10/2012 03:52 PM, Ed Owens wrote:
> I'm trying to iterate over a list of elements, and make changes to the list
> in front of the element I'm currently working with. I can update the list,
> but the 'for' doesn't see the new element. Here's the code:
>
> import string
>
> def add_element(
On 10/11/2012 04:40 AM, eryksun wrote:
> On Wed, Oct 10, 2012 at 9:23 PM, boB Stepp wrote:
> .
>> What is the intended use of byte types?
>
> bytes objects are important for low-level data processing, such as
> file and socket I/O. The fundamental addressable value in a computer
> is a byte (at le
On 10/11/2012 05:21 AM, eryksun wrote:
> On Thu, Oct 11, 2012 at 5:04 AM, Dave Angel wrote:
>>
>> Actually, the upper limit for a decoded utf-8 character is at least 6
>> bytes. I think it's 6, but it's no less than 6.
>
> Yes, but what would be the poi
On 10/11/2012 07:13 AM, Sunil Tech wrote:
> Hi all,
>
> Greetings to you...
> it been so helpful for me to go through your all mails & support & i wish
> it still continues.
>
> I have two text files.
>
> text1 contains
>
> This is from Text1 --- 1st line
> This is from Text1 --- 2nd line
> This is
On 10/11/2012 03:24 PM, Matthew Ngaha wrote:
> i need help on 2 topics.
>
> 1) can someone please tell me what sys is doing, and why its using weird
> indexing?
>
> if __name__ == "__main__":
> A_Class(*sys.argv[1:4]).A_Class_Method()
sys isn't being indexed. sys is a module (presumably you h
On 10/11/2012 04:48 PM, Matthew Ngaha wrote:
>>
>> Obviously a Monty Python fan as I see 3 methods :)
>>
> lol i dont know what i was looking at.. yes its 3 methods sorry:(
>
>
>>> def __init__(self):
>>> self.zipping_directory = "unzipped-{}".format(filename)
>>>
>> Where did filename appear
On 10/13/2012 07:02 AM, syed zaidi wrote:
> Hi,I am trying to develop a python code that takes a character string as
> input and finds for the occurrence of letters that are occurring thrice or
> more consecutively.For E.g.
> a = 'ataattaaacagagtgagcagt'In the output I want a list of tho
On 10/05/2012 11:55 PM, Benjamin Lee wrote:
> Hello,
> I am using python to calculate distances across the cell.
> I used this command: python calculate_distances.py
> This was the response:
> Traceback (most recent call last):
> file "calculate_distances.py" line 4, in
> import celltool.simple_
On 10/17/2012 11:41 PM, boB Stepp wrote:
> >From Programming in Python 3, 2nd edition (p. 22-23):
>
a = ["Retention", 3, None]
b = ["Retention", 3, None]
a is b
> False
b = a
a is b
> True
>
> My current understanding is as follows: On the first two lines, two
> separate ob
On 10/18/2012 03:08 AM, Daniel Gulko wrote:
>
>
>
> Hi Python Tutor, I have a write a simple function named
> "SwapCaseAndCenter(a_string, width).
So why did you define it with only one formal parameter?
> The idea is to use the function swapcase and center so that when the
> userenters a stri
On 10/19/2012 11:40 AM, Daniel Gulko wrote:
> Thanks David. This has been helpful in understanding a bit more on how
> parameters are passed through.
Please don't top-post. it ruins the sequence of events. Your comments
above happened after the parts you quote below. So why are they not
after t
On 10/21/2012 08:01 PM, Saad Javed wrote:
> Hi,
> a = ['Ron', 'Harry', 'Hermoine']
> b = ['25th oct', '27th oct', '29th oct']
> c = ['Charms', 'DADA', 'Potions']
> I want to print like this:
> Ron - 25th oct
> Charms
> Harry - 27th oct
> DADA
> Hermoine - 29th oct
> Potions
>
> The items in each li
On 10/22/2012 03:57 PM, Daniel Gulko wrote:
> Hi Python Tutor,
>
> I have an issue trying to figure out how to print out final answers using
> sort and join functions.
>
> Assignment Specification:
> make a function that is a magic eight ball emulator. emulator will be a
> function that returns o
On 10/23/2012 07:14 PM, Nitin Ainani wrote:
> Dear Sir/Madam,
>
> I am new to python I have a question. It is as follows:
>
> Suppose *s* is a variable and *s* stores empty string
>
> s=""
> Now if we write following statement
>
>
> print(s[0]) # it gives error
There is no 0th character, so
On 10/23/2012 07:48 PM, Alexander wrote:
> On Tue, Oct 23, 2012 at 7:24 PM, Nitin Ainani wrote:
>> Dear Sir/Madam,
>>
>> I am new to python I have a question. It is as follows:
>>
>> Suppose s is a variable and s stores empty string
>>
>> emptyString = ""
> #consider the string to be non-empty, t
On 10/24/2012 07:15 AM, Morten Engvoldsen wrote:
> Hi,
Hi. Welcome to the list.
> I am facing issue with input() of Python 2.7. When i run the program it
> doesn't display any line to take user input . Below is the code:
>
> def user_input()
Need a trailing colon here.
>fat_grams = input("Ho
On 10/18/2012 07:59 PM, Frank Pontius wrote:
> Hello,
> I'm taking a beginners course on Python.
>
> Have class example which is to be used in H/W, which I can't get to work.
> Thus I figure the example is wrong. But I need this to get H/W done.
>
> Using 'import random' and random.randrange in fu
On 10/29/2012 05:49 AM, John Collins wrote:
Did you really leave two very-similar messages 3 minutes apart? Or are
you using a broken gateway, like Google-groups, and it hiccoughed?
> Hi,
> OS: XP
> Py: 2.7.2
>
> I am running some old scripts, not written by me, that produce
> substantial calcu
On 10/29/2012 06:32 AM, John Collins wrote:
> Hi Dave
>> Did you really leave two very-similar messages 3 minutes apart? Or are
>> you using a broken gateway, like Google-groups, and it hiccoughed?
> Sorry, I didn't intend to - flunky LH mouse microswitch!
I was only concerned that there was some
On 10/29/2012 06:54 AM, John Collins wrote:
> Hi Steve,
> Thanks. From
> >>>mkpoints.py 32 32.txt
>
> here's a sample of the output
>
> -0.396087591388 -0.781284022758 0.482400140683
> -0.967387012461 -0.0838047084421 -0.239037944614
> 0.0208969821213 -0.489420208746 0.871797668848
> 0.887250003871
On 10/29/2012 07:19 AM, John Collins wrote:
>
>> Equality.
> Right, in a 1,0 sense.
>> Because of rounding errors this is a dangerous operation for floating
>> point
>> numbers:
> print 1.0 == .1 + .1 + .1 + .1 + .1 + .1 + .1 + .1 + .1 + .1
>> False
> I take it that is because binary for .1 is
On 10/29/2012 07:49 AM, John Collins wrote:
> Hi Dave,
>> Not true. That's just what it was truncated to upon output. If you
>> want to show 15 digits, then use formatted output instead of str()
>> inside the realprint() function.
> BIG light bulb moment! I had no idea the str() statement was tru
On 10/29/2012 08:14 AM, John Collins wrote:
>
>> But please don't just take the format string I supplied as "right." It
>> is if you always want 15 decimal digits to the right of the decimal
>> point. But if you have a number like 50 thousand, then many of those
>> digits to the right are invali
On 10/29/2012 09:00 PM, richard kappler wrote:
> Methinks I'm missing something obvious, but can't quite put my finger on
> it. If, in the interpreter, I enter the following code:
>
> def hungry(batVolt):
> if batVolt >94:
> return ("I am not hungry at the moment")
> elif 64 < ba
On 10/30/2012 12:56 PM, richard kappler wrote:
> If I have a variable and send it's value to a function to be modified and
> returned, how do I get the function return to replace the original value of
> the variable?
>
> Example:
>
> import random
>
> x = 50
>
> def rndDelta(x):
> d = random.un
On 10/30/2012 03:18 PM, richard kappler wrote:
> As I sit through the aftermath of Sandy, I have resumed my personal quest
> to learn python. One of the things I am struggling with is running multiple
> processes. I read the docs on threading and am completely lost so am
> turning to the most excel
On 10/30/2012 05:10 PM, richard kappler wrote:
> Oscar, thanks for the link, though I must say with all due respect, if it
> was "obvious" I wouldn't have had to ask the question. Good link though. I
> suspect the reason I didn't find it is I did my searches under threading as
> opposed to multi-pr
On 10/31/2012 09:28 AM, Dave Wilder wrote:
> Sorry for the poor info on my part Steven et al. I did not do my homework.
>
>
>
> I thought that sshclient was an imported module, however it is pxssh that I
> am importing as sshClient.
>
> import pxssh as sshClient
>
>
Please don't top-post. You
On 11/01/2012 05:24 PM, Matthew Ngaha wrote:
> working through my tutorial ive been told to set up a simple webserver. i
> can't even get started because the 1st line of code its asked me to do
> fails with a syntax error. here's the code:
If you got an error, quote it in full in your message (usi
On 11/01/2012 05:47 PM, Matthew Ngaha wrote:
>>
>>
>> Always, *always* include the *full* error message, otherwise we have to
>> guess. Not fun. Some other questions: What operating system are you using?
>> What version of Python does your tutorial assume? Do you in fact have
>> Python 3 install
On 11/01/2012 05:55 PM, Matthew Ngaha wrote:
>> If you got an error, quote it in full in your message (using copy/paste,
>> not by retyping or paraphrasing. As it stands, we don't know if the
>> error was in bash, in csh, in cmd, or in Python, and if it was in
>> python, we don''t know what versio
On 11/03/2012 09:04 AM, Albert-Jan Roskam wrote:
> Hello,
(I haven't run the code, as it was not presented in a form that I could
do a single copy/paste. So I may have missed some subtlety in the code.)
> I want to make a get() method that uses a binary search. This requires the
> data to be so
On 11/03/2012 10:40 AM, Albert-Jan Roskam wrote:
>> On 11/03/2012 09:04 AM, Albert-Jan Roskam wrote:
>
>>> Hello,
>>
>> (I haven't run the code, as it was not presented in a form that I could
>> do a single copy/paste. So I may have missed some subtlety in the code.)
>
> Hi, sorry about that. H
On 04/16/2015 01:24 PM, Jim Mooney wrote:
Is this "inaccurate"? Well, in the sense that it is not the exact true
mathematical result, yes it is, but that term can be misleading if you
think of it as "a mistake". In another sense, it's not inaccurate, it is
as accurate as possible (given the limi
On 04/17/2015 04:39 AM, Samuel VISCAPI wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Hi,
This is my first post to that mailing list if I remember correctly, so
hello everyone !
Welcome to the list.
I've been stuck on a simple problem for the past few hours. I'd just
like raw_input
On 04/17/2015 11:51 PM, Ben Finney wrote:
Ben Finney writes:
Bill Allen writes:
If I have a list defined as my_list = ['a','b','c'], what is the is
differnce between refering to it as my_list or my_list[:]?
‘my_list’ is a reference to the object you've already described (the
existing obje
On 04/18/2015 03:01 PM, boB Stepp wrote:
As I final note I want to emphasize that I am not writing a program to
*create* a treatment plan. Nor am I writing a program that can *alter*
an existing treatment plan. It is merely reading output from the
treatment plan and evaluating that output agains
On 04/19/2015 12:07 AM, boB Stepp wrote:
.
Before Peter changed one of these
changeable objects, he had:
a = [1, ["x", "y"], 3]
b = a[:]
Now BOTH a[1] and b[1] now identify the location of the inner list
object, ["x", "y"] . Apparently, Python, in its ever efficient memory
management fash
On 04/19/2015 03:08 PM, boB Stepp wrote:
On Sun, Apr 19, 2015 at 6:47 AM, Dave Angel wrote:
On 04/19/2015 12:07 AM, boB Stepp wrote:
[...]
I hope this is helpful, and, if there are any misstepps, that when
they are revealed both of our understandings will be enhanced!
Some of your
On 04/19/2015 06:28 PM, Joel Goldstick wrote:
On Sun, Apr 19, 2015 at 6:23 PM, boB Stepp wrote:
On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel wrote:
On 04/19/2015 03:08 PM, boB Stepp wrote:
Or is the real point that we are adding an abstraction
layer so we don't even have to think
On 04/20/2015 04:15 PM, Jim Mooney wrote:
The key is that the result gets multiplied by 2 each time
so for an N bit number the leftmost digit winds up being
effectively 2**N, which is what you want.
Alan G
Ah, the light dawns once it was restated. It would be even simpler if you
could
On 04/21/2015 01:21 AM, Danny Yoo wrote:
What's supposed to happen in this situation?
##
class Person(object):
def __init__(self): pass
j = Person()
john = j
jack = j
##
What single name should we get back fr
On 04/20/2015 08:44 PM, Jim Mooney wrote:
Why does the compiler choke on this? It seems to me that the enhanced
subtraction resolves to a legitimate integer in the exponent, but I get a
syntax error:
B = '11011101'
sum = 0
start = len(B)
for char in B:
sum += int(char) * 2**(start -= 1) ##
On 04/23/2015 06:37 AM, Jim Mooney wrote:
..
Ï»¿
is the UTF-8 BOM (byte order mark) interpreted as Latin 1.
If the input is UTF-8 you can get rid of the BOM with
with open("data.txt", encoding="utf-8-sig") as csvfile:
Peter Otten
I caught the bad arithmetic on name length, but where is t
On 04/23/2015 02:14 PM, Jim Mooney wrote:
By relying on the default when you read it, you're making an unspoken
assumption about the encoding of the file.
--
DaveA
So is there any way to sniff the encoding, including the BOM (which appears
to be used or not used randomly for utf-8), so you c
On 04/23/2015 05:08 PM, Mark Lawrence wrote:
Slight aside, why a BOM, all I ever think of is Inspector Clouseau? :)
As I recall, it stands for "Byte Order Mark". Applicable only to
multi-byte storage formats (eg. UTF-16), it lets the reader decide
which of the formats were used.
For exa
On 04/24/2015 07:34 PM, Jim Mooney wrote:
Apparently so. It looks like utf_8-sig just ignores the sig if it is
present, and uses UTF-8 whether the signature is present or not.
That surprises me.
--
Steve
I was looking things up and although there are aliases for utf_8 (utf8 and
On 04/26/2015 08:07 AM, Ben Finney wrote:
Jim Mooney writes:
On 25 April 2015 at 18:03, Ben Finney wrote:
Digest mode should only ever be used if you know for certain you will
never be responding to any message.
That brings up a great shortcut if you use gmail. If you select some
text bef
On 04/27/2015 06:37 AM, Whom Isac wrote:
Hi, I am trying to build a python mini program to solve a math problem . I
wanted my program to ask two number from the operator and it can add those
number as a integer but as consecutive number in range. For example, if
num1 entry =1 & num2 entry = 100 ,
On 04/28/2015 02:37 PM, diliup gabadamudalige wrote:
I thank all those who responded to my question
Here is the code that I had written.
When updating is applied to a surface object the rotation works but when it
is applied through a class to an object it goes wrong in about 3 rotations.
As far
On 04/28/2015 09:24 PM, Jacqueline G Solis wrote:
hello,
I keep getting a syntax error. Could you please explain why that happens and
how to correct it.
def main ():
print( "Welcome to Gonzo Burger!")
order= int(input("Enter 1 if you want a hamburger,\
or 2 if you want a cheese
On 04/29/2015 03:15 AM, diliup gabadamudalige wrote:
Thanks all for the responses.
Charles Cossé - yes I can write a simple pygame program that makes a
sprite move in a circle but it may not be the style and order that many may
approve or accept. I consider myself a student. :)
No one has pointe
On 04/29/2015 08:47 AM, Albert-Jan Roskam wrote:
Hello,
Windows has the 'feature' that the CD command does not work with UNC paths.
So in the code below, I cannot use the 'cwd' parameter of subprocess.Popen.
Therefore I use pushd/popd to accomplish the same effect. Is there a better way
to do t
On 04/29/2015 02:37 PM, diliup gabadamudalige wrote:
I do not understand how Alan does not get the code that is in this thread.
There are at least 3 ways of posting to "this thread":
A) email
B) newsgroup
C) googlegroups
and at least 5 ways of looking at "this thread"
A) email
B
On 04/29/2015 09:05 PM, Jim Mooney Py3.4.3winXP wrote:
I raised an exception in the parse_string function in my math parser
program, function_tosser.py, and caught it in the calling routine, and that
worked fine. But when I imported function_tosser.py into a test program,
tester.py, it threw the
On 04/30/2015 12:28 AM, boB Stepp wrote:
The main danger as I see it is that if I am not careful, then the code
on the dev environment could diverge from the state of code on my
Windows PC, i.e., I forgot to do the scp part. But when I am actively
working on a section of code I always insert a fe
On 04/29/2015 11:58 PM, Jag Sherrington wrote:
Can anyone please tell me what I am doing wrong?As this code I have for the
Roulette Wheel colours exercise, won't work. number = int(input('Enter a number
between 0 and 36: '))green_number = (0) red_number = (1, 3, 5, 7, 9, 12, 14,
16, 18, 19, 21
On 04/30/2015 03:22 PM, Roel Schroeven wrote:
Alan Gauld schreef op 2015-04-30 00:51:
> ...
Trying to visually scan for _ or even __ is hard. Also different
fonts make _ and __ hard to distinguish.
> ...
But they will be. Almost for certain. It's human nature and the nature
of code maint
1) Please reply-list, or if your email program doesn't support that, do
a reply-all. The idea is to make sure tutor@python.org is in your To:
field. Otherwise you're just leaving private messages, and that's not
what a public forum like this is about.
2) Please use text email, not html. As
On 05/02/2015 04:36 AM, Peter Otten wrote:
Jag Sherrington wrote:
With that the calculation becomes
buns = 20
package_size = 8
whole_packages, missing_buns = divmod(buns, package_size)
total_packages = whole_packages
if missing_buns: total_packages += 1
...
total_packages
3
And that can b
On 05/04/2015 03:19 AM, yvan moses Levy wrote:
My code is wrong!
You'd find it a lot easier to get responses if you'd say in what way the
code is wrong. If you get an exception, show the full traceback. If
you get printed results, show what you expected, and what you got
instead. If it hu
On 05/04/2015 07:08 PM, Jag Sherrington wrote:
Hi, Alan>
Please don't top-post. Enter your new message *after* whatever portion
of the previous message you're quoting. I'm rearranging the portion of
your message to conform to that standard.
On Monday, 4 May 2015, 17:35, Alan Ga
mailer to use text.
On 05/04/2015 10:07 PM, yvan moses levy wrote:> Le 04/05/15 13:00, Dave
Angel a écrit :
>> On 05/04/2015 03:19 AM, yvan moses Levy wrote:
>>> My code is wrong!
>>
>> You'd find it a lot easier to get responses if you'd say in what wa
On 05/05/2015 12:29 AM, Brandon D wrote:
Hello tutors,
I'm having trouble understanding, as well as visualizing, how object
references work in the following situation. For demonstration purposes I
will keep it at the most rudimentary level:
x = 10
x = x ** x
If my knowledge serves me correct
On 05/06/2015 12:02 AM, Jim Mooney Py3.4.3winXP wrote:
actually worked in windows instead of using their awful screen
copy. What a surprise:
Many people don't realize that you can turn on a better screen copy
feature for the CMD window (DOS box) in Windows.
I've given up Windows, and no lon
On 05/06/2015 07:51 AM, Alan Gauld wrote:
Please use ReplyAll to include the list members.
Forwarded Message
Subject: Re: [Tutor] Adding consecutive numbers
Date: Wed, 6 May 2015 21:13:15 +1000
From: Whom Isac
To: Alan Gauld
Thanks for the reply. I am sorr
On 05/06/2015 01:41 PM, Jim Mooney Py3.4.3winXP wrote:
from msvcrt import *
while True:
if kbhit():
key = getch()
if key == b'\xe0' or key == b'\000':
print('special key follows')
key = getch()
print(str(key, encoding='utf-8')) #got
On 05/07/2015 04:03 PM, Emile van Sebille wrote:
On 5/7/2015 12:15 PM, Jim Mooney Py3.4.3winXP wrote:
I find this a bit confusing. Since the ID of K remains the same, so it's
the same object, why isn't it increasing each time. i.e, 20, 30, 40,. I
understand that it's immutable but doesn't that m
On 05/07/2015 03:15 PM, Jim Mooney Py3.4.3winXP wrote:
I find this a bit confusing. Since the ID of K remains the same, so it's
the same object, why isn't it increasing each time. i.e, 20, 30, 40,. I
understand that it's immutable but doesn't that mean K is created each time
in local scope so it
On 05/07/2015 04:54 PM, Jim Mooney Py3.4.3winXP wrote:
On 7 May 2015 at 13:03, Emile van Sebille wrote:
Compare to:
def testid(K=100):
K += 10
return 'the ID is', id(K), K
Ah, thanks. I forgot small integers are saved in a table. I was looking at
a demo that pointers to def
On 05/07/2015 05:25 PM, Alan Gauld wrote:
On 07/05/15 21:54, Jim Mooney Py3.4.3winXP wrote:
Ah, thanks. I forgot small integers are saved in a table. I was
looking at
a demo that pointers to defaults in function parameters are persistent.
But remember they variables are NOT pointers.
They are
On 05/07/2015 07:51 PM, Dave Angel wrote:
On 05/07/2015 04:54 PM, Jim Mooney Py3.4.3winXP wrote:
On 7 May 2015 at 13:03, Emile van Sebille wrote:
Compare to:
def testid(K=100):
K += 10
return 'the ID is', id(K), K
Ah, thanks. I forgot small integers are saved
On 05/07/2015 09:50 PM, Alex Kleider wrote:
On 2015-04-21 16:48, Cameron Simpson wrote:
But it would not be schizophrenic to write a function that returned a
name arbitrarily, by inspecting locals(). It depends whether you only
need a name, or if you need "the" name.
Write yourself a "find_nam
On 05/07/2015 11:23 PM, Alex Kleider wrote:
On 2015-05-07 19:10, Dave Angel wrote:
def get_name(localmap, item):
"""As suggested.
Returns 'a' name, not necessarily 'the' name."""
for name in localmap:
if localmap[
On 05/08/2015 02:26 AM, Alex Kleider wrote:
On 2015-05-07 20:45, Dave Angel wrote:
You also only showed it working on module globals. (For code at
top-level, locals() returns the same as globals() )
You could also try it inside functions, where locals() really makes
sense as a name. And you
On 05/08/2015 02:10 PM, Jim Mooney Py3.4.3winXP wrote:
On 7 May 2015 at 18:42, Dave Angel wrote:
Python doesn't have pointers
So what is the difference between a python name and a pointer? I'm a bit
fuzzy on that.
What's the difference between a painting of Obama and
On 05/07/2015 02:57 PM, Tudor, Bogdan - tudby001 wrote:
Hi,
This is my first time.
First time doing what? Presumably the first time on this forum. But
what is your history of using Python, or of programming in general?
I am using python 3.4.3 on windows 7 64bit.
I am trying to make a bi
On 05/08/2015 06:26 PM, Alan Gauld wrote:
On 08/05/15 19:10, Jim Mooney Py3.4.3winXP wrote:
On 7 May 2015 at 18:42, Dave Angel wrote:
Python doesn't have pointers
So what is the difference between a python name and a pointer?
OK, This could get deepo.
Lets start with the supoerf
On 05/09/2015 04:13 AM, Alan Gauld wrote:
On 09/05/15 04:24, Kayla Hiltermann wrote:
i want to account for variability in user input,
> like using commas or just spaces.
the user input is initially a string, but is converted to a list once
> run through .split() .
> I would like to split
On 11/04/2012 08:45 PM, Ashley Fowler wrote:
> I'm trying to initialize a list to several elements using the string method.
> I have some idea that you use a for loop I suppose...
>
> Could anybody help me out?
>
>
list has no string method, at least in the versions I tried.Could
you perhaps
On 11/04/2012 09:01 PM, Ashley Fowler wrote:
(You top-posted, so I have to remove all the historical context, or
it'll remain out of order)
> I have code for a Set ADT. The Set ADT is a container that stores a
> collection of values or elements.
>
>
>
>
> Below is some of my code...I have run in
On 11/05/2012 06:53 AM, Bala subramanian wrote:
> Friends,
> In the previous mail there was an "mistake" i was not aware of. So pls
> dnt get upset.
>
> For frame in trajectory-A:
>> cunt= str(frame.time)
> It is count =str(frame.time). A counter to find frame number.
>
> Thanks joel for le
On 11/05/2012 06:07 PM, Prasad, Ramit wrote:
> Frank Pontius wrote:
>> Sent: Saturday, October 27, 2012 12:27 PM
>> To: d...@davea.name; bgai...@gmail.com
>> Cc: tutor@python.org
>> Subject: Re: [Tutor] Help with class example
>>
>> Here ya go!
>> Can't do what you want as this is a programmatic er
On 11/06/2012 09:01 AM, Mark Lawrence wrote:
> On 31/10/2012 01:01, Brayden Zhao wrote:
>
>> def fieldict(filename):
>>D={}
>>with open(filename) as FileObject:
>> for lines in FileObject:
>>linelist=lines.split('\t')
>>Key=linelist[0]
>>ValCity=(linelist[12]).s
On 11/07/2012 10:44 AM, Seema V Srivastava wrote:
> Hi,
> I am new to Python, trying to learn it by carrying out specific tasks. I
> want to start with trying to scrap the contents of a web page. I have
> downloaded Python 3.3 and BeautifulSoup 4.
>
> If I call upon urlopen in any form, such as b
On 11/07/2012 11:25 AM, Walter Prins wrote:
> Seema,
>
> On 7 November 2012 15:44, Seema V Srivastava wrote:
>
>> Hi,
>> I am new to Python, trying to learn it by carrying out specific tasks. I
>> want to start with trying to scrap the contents of a web page. I have
>> downloaded Python 3.3 and
On 11/08/2012 09:33 PM, T. Girowall wrote:
>
> ip: 192.168.xx.xx
> port: 2332
>
> Any help is appreciated,
> Tim
> import getpass import sys import telnetlib HOST = "localhost" user =
> raw_input("Enter your remote account: ") password = getpass.getpass() tn =
> telnetlib.Telnet(HOST) tn.read_u
901 - 1000 of 1736 matches
Mail list logo