Peter Otten wrote:
> for fileset in days.values():
> if len(fileset) > 1:
> # process only the list with one or more files
That should have been
# process only the lists with two or more files
> print(&qu
mark murphy wrote:
> Hello Python Tutor Community,
>
> This is my first post and I am just getting started with Python, so I
> apologize in advance for any lack of etiquette.
>
> I have a directory of several thousand daily satellite images that I need
> to process. Approximately 300 of these i
Ian, take a step back; the first step to solve a problem is to state it
clearly. You want to write a dict to a file.
(1) What would the dictionary look like? Give concrete example, e. g.
{"foo": 42, "bar": 'that\'s not "funny"'}
(2) What should the resulting file look like when you open it in a
Ben Sherman wrote:
> Whats a more pythony way to do this? I have a dict with a few dozen
> elements, and I want to pull a few out. I've already shortened it with
> itemgetter, but it still seems redundant. I feel like I can do something
> like I've seen with *kwargs, but I'm not sure.
>
> I'm
Aaron Misquith wrote:
> I'm trying to obtain the questions present in StackOverflow for a
> particular tag.
>
> Whenever I try to run the program i get this *error:*
>
> Message File Name Line Position
> Traceback
> C:\Users\Aaron\Desktop\question.py 20
> UnicodeEncodeError: 'ascii' codec c
Mirage Web Studio wrote:
> Try reading the file in chunks instead:
>
> CHUNKSIZE = 2**20
> hash = hashlib.md5()
> while True:
> chunk = f.read(CHUNKSIZE)
> if not chunk:
> break
> hash.update(chunk)
> hashvalue = hash.hexdigest()
>
&
Mirage Web Studio wrote:
> I am new to python programming. while trying it out i find that in my
> code file io.read is not reading large files particularly over 1 gb. my
> code is posted below. i am working on python 3.3 on windows with ntfs
> partition and intel corei3 ram 3gb. the execution a
Alan Gauld wrote:
> On 11/06/14 00:08, Jon Engle wrote:
>> Ok, so when I run the code it immediately terminates and never 'listens'
>
> This has nothing to do with your immediate problem but...
>
>> ***Code***
>>
>>#!/usr/bin/python # This is server.py file
>> from socket impo
Alan Gauld wrote:
> On 10/06/14 09:43, Peter Otten wrote:
>> I'm posting via gmane. Since last month there is a delay (usually a few
>> hours I think) until my posts appear and I seem to be getting a
>>
>> "Your message to Tutor awaits moderator
Jon Engle wrote:
> Ok, so when I run the code it immediately terminates and never 'listens'
> to the ports in the loop. I have verified by running netstat -an | grep
> 65530 and the startingPort is not binding.
As I've already hinted the easiest way to keep your listening threads alive
is to use
I'm posting via gmane. Since last month there is a delay (usually a few
hours I think) until my posts appear and I seem to be getting a
"Your message to Tutor awaits moderator approval, would you like to
cancel..."
mail every time I post. I'm trying hard to not get annoyed ;)
Is there somethin
Lukas Nemec wrote:
> Hi,
>
> fist - are you really triyng to have open 64 000 ports? ok, i suppose
> you have your reasons, but this is not a good idea - you'll block most
> applications that use these ports ..
>
> The problem is with your main function -
> you have PORT defined, but it is not g
Gabriele Brambilla wrote:
> 2014-06-05 22:10 GMT-04:00 Peter Romfeld :
>
> On Friday, June 06, 2014 10:04 AM, Gabriele Brambilla wrote:
>>>
>>> fiLUMOname = 'Lsum_' + period + '_' + parts[2] + '_' + parts[3] + '_'
>>
jarod...@libero.it wrote:
> Dear all thanks for your suggestion!!!
> Thanks to your suggestion I create this structure:with open("prova.csv")
> as p:
> for i in p:
> lines =i.rstrip("\n").split("\t")
>...: print lines
>...:
> ['programs ', 'sample', 'gene', 'values']
>
Ritwik Raghav wrote:
> I joined the topcoder community tomorrow and tried solving the
> PersistentNumber problem:
> "Given a number x, we can define p(x) as the product of the digits of x.
> We can then form a sequence x, p(x), p(p(x))... The persistence of x is
> then defined as the index (0-base
jarod...@libero.it wrote:
> Dear All
>
> clubA= ["mary","luke","amyr","marco","franco","lucia", "sally","genevra","
> electra"]
> clubB= ["mary","rebecca","jane","jessica","judit","sharon","lucia",
> "sally"," Castiel","Sam"]
>
> I have a list of names that I would to annotate in function of pr
diliup gabadamudalige wrote:
> I need to random pick a pygame sprite from a sprite class.
> The random module does not allow this to be used on a group.
> Is the shortest way to raed in the attributes thatr I need into a list and
> then random pick that or is there a shorter way? Sample code is gi
Alan Gauld wrote:
> On 23/05/14 12:57, SABARWAL, SHAL wrote:
>> Wondering if anyone came across this error in using form =
>> cgi.FieldStorage()
>>
>> import tempfile
>>
>> File /tempfile.py", line 83, in _once_lock
>> = _allocate_lock()
>>
>> thread.
Felipe Melo wrote:
> Hello,
>
> I want to read the below matrix, identify when the characters in front of
> "want = " are equal to "1" and then save in an array and in an output file
> the characters above. But I don't know how to identify the second line and
> store in a variable:
>
> alpha=0 b
ani wrote:
> So I thought it would be cool to read a sequence at three different
> frames, which I have pasted below. However, I've come across a conundrum:
> how to make a list of lists. See, I'd like a final output that displays
> data of the type of frame with a + or a - to signify the directio
Jake Blank wrote:
> I finally got it.
> This was the code:
> for k in sorted(word_count, key=lambda x:word_count[x], reverse=True):
> print (k, word_count[k])
>
> The only question i have now is how to limit the amount of returns the
> program runs to the first 15 results.
Hint:
Sithembewena Lloyd Dube wrote:
> Thanks, i was actually getting the error information to update the post.
> Apoligies to waste your time posting here - I could not find an
> appropriate PyCountry discussion list and my next best bet seemed to be a
> Python users' list.
>
> For those who care to l
C Smith wrote:
> I meant for example:
> list1 = [1,2,3]
> list2 = [3,4,5]
>
> newList = list1 + list2
>
> versus
>
> for x in list2:
>list1.append(x)
>
> Which is the preferred way to add elements from one list to another?
None of the above unless you need to keep the original list1. Use
event code from being executed on import by adding
if __name__ == "__main__":
... # executed only when run as a script
Example:
$ cat hello.py
def hello(name):
print("Hello, {}".format(name))
if __name__ == "__main__":
hello(&quo
Ian D wrote:
> I have this part of code and am unsure as to the effect of the array('c')
> part. Is it creating an array and adding 'c' as its first value?
No, the first arg to array.array() is the typecode; data may be passed as
the second argument. The typecode "c" creates an array of 8-bit ch
Ian D wrote:
> Can anyone clarify please?
>
>
> Just reading this:
> https://wiki.python.org/moin/BitwiseOperators
> The section on 2's complement binary for negative integers.
> It states:
> "Thus the number -5 is treated by bitwise operators as if it were written
> "...11101
Ian D wrote:
> I am trying to follow some code. It is basically a python scratch
> interfacing script.
> Anyway part of the script has this code.
> Searching google for >> greater than signs in code with python has its
> issues.
> Can anyone clarify this stuff.
> I know its about 4 bytes of data.
Stephen Mik wrote:
> Stephen Mik-novice programmer-getting desperate
Don't despair just yet! As a programmer you will be constantly producing and
fixing errors. That is business as usual.
What will change is that you will produce trickier bugs as your knowledge
level increases...
> Dear Sir(s)
Stephen Mik wrote:
> My program, Assignment4,does run partially. You can see the results of the
> Python Shell attached to this email. I also have included part of my code
> for your perusal.
>
> I must be doing something very wrong. The program is supposed to run a
> main loop ,for control of th
Alan Gauld wrote:
> I've been playing with the logging module - long overdue!
>
> I started with the basic tutorial but fell at the first hurdle.
> It says to specify a file in the logging.basicConfig() function then
> asks you to open the file after logging some events.
>
> But I can't find the
Albert-Jan Roskam wrote:
>
>
>
>
>
> - Original Message -
>> From: Steven D'Aprano
>> To: tutor@python.org
>> Cc:
>> Sent: Thursday, April 24, 2014 3:00 AM
>> Subject: Re: [Tutor] global list
>>
>
>
>
>> You only need to define variables as global if you assign to them:
>>
>> de
Peter Otten wrote:
> In mathematics there is a property called "transitivity" which basically
> says that an operation op is transitive if from
>
> (a op b) and (a op c)
>
> follows
>
> b op c
I opened the wikipedia article for the english word, but didn
Vipul Sharma wrote:
> Hello,
>
> Suppose we want some block of code to be executed when both '*a'* and
> '*b'*are equal to say 5. Then we can write like :
>
> *if a == 5 and b == 5:*
> *# do something*
>
> But a few days ago, I just involuntarily wrote a similar condition check
> as
> :
>
Wheeler, Gabriel wrote:
> Im having trouble completing this function with lists. Im supposed to
> create a function that will let me know if there are repeating elements so
> I wrote this and am not sure where the error lies.
It helps you (and us) a lot if you clearly state the error you are see
Qianyun Guo wrote:
> Hi all, I am trying to get a suffix tree from a string. I use three
> classes, Node, Edge, SuffixTree. I have two questions when implementing:
>
> 【1】
>
a = Edge(1,2,3,4)
>
a.length
>
> 1
> if I remove '@property' in my code, it returns as below:
>
a = Edg
bruce wrote:
> The following text contains sample data. I'm simply trying to parse it
> using libxml2dom as the lib to extract data.
>
> As an example, to get the name/desc
>
> test data
>
>
> d = libxml2dom.parseString(s, html=1)
>
> p1="//department/name"
> p2="//department/desc
Gabriele Brambilla wrote:
> Ok guys, when I wrote that email I was excited for the apparent speed
> increasing (it was jumping the bottleneck for loop for the reason peter
> otten outlined).
> Now, instead the changes, the speed is not improved (the code still
> running from this m
Gabriele Brambilla wrote:
> ok, it seems that the code don't enter in this for loop
>
> for gammar, MYMAP in zip(gmlis, MYMAPS):
>
> I don't understand why.
You have two variables with similar names, gmlis and gmils:
>> gmlis = []
>> gmils=[my_parts[7], my_part
Gabriele Brambilla wrote:
> Anyway I would like to try to speed it up using C functions (and maybe
> comparing the resuts of the two profile in the end)
I can't help you on your chosen path, but let me emphasise that the code you
posted looks like it has great potential for speed-up by replacing
Gregg Martinson wrote:
> I have been working through a fairly simple process to teach myself python
> and I am running into a problem with a comparison. Can anyone tell me
> where I am going wrong?
>
> #!/usr/bin/env python
>
> class Team(object):
> code = ""
> opponents_debated=[]
>
Dharmit Shah wrote:
> I am trying to create a script that will go through the
> /var/log/secure file on a Linux system and provide desktop
> notifications for failed login attempts.
>
> Here is the code - http://pastebin.com/MXP8Yd91
> And here's notification.py - http://pastebin.com/BhsSTP6H
>
Conner Crowe wrote:
> To whom this may concern:
>
> I am struggling on two questions:
> Problem 2.
> Suppose you are given a function leave(minute) which returns the number of
> students that leave an exam during its mth minute. Write a function
> already_left(t) that returns the number of studen
Alexis Prime wrote:
> Hello,
>
> My question is whether I should write a loop or a function to delete rows.
>
> I'm using pandas. But you may be able to help me as my question is about
> the reasoning behind programming.
>
> I have a pandas dataframe that looks like this, covering all countries
Steven D'Aprano wrote:
> On Tue, Apr 08, 2014 at 02:38:13PM -0600, Jared Nielsen wrote:
>> Hello,
>> Could someone explain why and how this list comprehension with strip()
>> works?
>>
>> f = open('file.txt')
>> t = [t for t in f.readlines() if t.strip()]
>> f.close()
>> print "".join(t)
>>
>> I
Alex Kleider wrote:
> On 2014-04-08 14:34, Peter Otten wrote:
>
>> That's a change in Python 3 where dict.keys() no longer creates a list,
>> but
>> instead creates a view on the underlying dict data thus saving time and
>> space. In the rare case whe
Alex Kleider wrote:
> I've got a fairly large script that uses a dictionary (called 'ipDic')
> each
> value of which is a dictionary which in turn also has values which are
> not
> simple types.
> Instead of producing a simple list,
> """
> ips = ipDic.keys()
> print(ips)
> """
> yields
> """
> di
John Aten wrote:
> I read the article on data driven programming that Danny linked too, and
> did some additional looking around. I couldn't find anything directly
> using Python, but I got an idea of the concept and went crazy with it.
> This may still be off the mark, but I created a complex com
spir wrote:
> On 04/01/2014 06:24 PM, Zachary Ware wrote:
>> Hi Patti,
>>
>> On Tue, Apr 1, 2014 at 11:07 AM, Patti Scott wrote:
>>> I've been cheating: comment out the conditional statement and adjust
>>> the indents. But, how do I make my program run with if __name__ ==
>>> 'main':
>>> main()
John Aten wrote:
> I apologize for the omissions, I thought that I had isolated the problem,
> but I was way off the mark. The problem was, as suggested by Danny and
> Peter, in the function where the dictionary is assigned. I ran the type
> function, as Alex advised, and lo an
leam hall wrote:
> I've been trying to so a simple "run a command and put the output into a
> variable". Using Python 2.4 and 2.6 with no option to move. The go is to
> do something like this:
>
> my_var = "ls -l my_file"
>
> So far the best I've seen is:
>
> line = os.popen('ls -l my_file', st
Albert-Jan Roskam wrote:
> The unittest module has some really handy decorators: @unittest.skip
> and @unittest.skipIf. I use the former for temporary TODO or FIXME things,
> but I use the latter for a more permanent thing:
> @unittest.skipif(sys.version_info()[0] > 2). Yet, in the test summary yo
John Aten wrote:
> Hey all,
>
> I am writing a program to drill the user on Latin demonstrative pronouns
> and adjectives (DPA). It displays a description, and the user has to enter
> the DPA that corresponds to the description. DPA vary for gender, number
> and case, and there are 3 separate DPA
street.swee...@mailworks.org wrote:
> I'm trying to sort the order of elements in an xml file, mostly
> to make visual inspection/comparison easier. The example xml and
> code on http://effbot.org/zone/element-sort.htm get me almost
> what I need, but the xml I'm working with has the element I'm
Jumana yousef wrote:
[Please don't reply to the digest. At the very least change the subject to
its original text. Thank you.]
> just a reminder of my data:
> it cossets of multiple sequences of DNA that I need to count the
bases(characters) and calculate the percentage of C+G and calculate the
Alan Gauld wrote:
> I confess I'm still not clear on your schema. What should the populated
> table(s) look like? It all feels very un-SQL like to me.
I'll make a bold guess that he wants to make a pivot table, something that
is indeed not supported by sqlite.
E. g., start with
week | os
robert.gutm...@dlr.de wrote:
> Hi guys,
>
> I've got the following problem: I tried to run the example-program
> apihelper.py in chapter IV of "Dive into Python" and got the following
> error message:
>
> Define the builtin 'help'.
> This is a wrapper around pydoc.help (with a twist).
>
> T
Peter Otten wrote:
> [locals()] does not capture
> the loop vars of genexps (all pythons) and listcomps (python3).
Sorry, I was totally wrong on that one.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
Jignesh Sutar wrote:
> Is it possible to get two nested for statements followed by a nested
> if/else statement all into a single list comprehension ie. the equivalent
> of the below:
>
>
> for i in xrange(1,20):
> for j in xrange(1,10):
> if j<6:
> j=int("8"+str(j))
>
MICHAEL BASHAGI wrote:
[Please send your posts to the mailing list, not individual posters. Thank
you.]
> But the PIL doesn't work in my version of Python, i use Python 3.4
If you are still working on this: as Tim hinted there is a fork of PIL
called Pillow with installers for Python 3.4. See
hind fathallah wrote:
> hi I need your help plz with this cods ( I want u to tell wht cod I miss
> to stop the while loop whene I get 3 stars) rm = []
I think you are comparing a string and an integer. That gives False even if
the values look the same:
>>> i = 3
>>> s = "3"
>>> print i, s
3 3
Ben Finney wrote:
> Welcome, Michael!
>
> MICHAEL BASHAGI writes:
>
>> when i run those codes i get this error message:-
>
> When showing an error, please show the entire traceback; it usually
> contains information useful for diagnosing the problem.
>
>> AttributeError: type object 'Image' h
Scott W Dunning wrote:
> I am trying to write a script for class for a game called guess the
> number. I’m almost done but, I’m having a hard time getting the hints to
> print correctly. I’ve tried ‘if’’ ‘elif’ nested, it seems like
> everything….I’m posting my code for the hints below, any help
Gabriele Brambilla wrote:
> for example I read this:
>
> On Pythons prior to 2.7 and 3.1, once you start experimenting with
> floating-point numbers, you're likely to stumble across something that may
> look a bit odd at first glance:
3.1415 * 2 # repr: as code (Pythons < 2.7 and 3.1)
> 6.28
rahmad akbar wrote:
> hey guys
>
> i have this file i wish to parse, the file looks something like bellow.
> there are only four entry here (AaaI, AacLI, AaeI, AagI). the complete
> file contains thousands of entries
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
Peter Otten wrote:
>> r'-f -F',
>> r'-H', '"%s"' % title,
>
> "title" becomes \"title\", i. e. Python puts in an extra effort to have
> the quotes survive the subsequent parsing process of the shell:
>
>>
Albert-Jan Roskam wrote:
> Hi,
>
> In the code below, cmd1 and cmd2 are equivalent, as in: " ".join(cmd1) ==
> cmd2. But the first example returns a code 2, whereas the second runs
> successfully. What is the difference? I prefer using a list as it looks a
> little cleaner. Btw, shell=True is nee
Sangeeth Saravanaraj wrote:
> On Mon, Feb 24, 2014 at 10:53 PM, Peter Otten <__pete...@web.de> wrote:
>
>> Sangeeth Saravanaraj wrote:
>>
>> > I am trying to capture an object initiation and deletion events using
>> > the __call__() and __del__() metho
Sangeeth Saravanaraj wrote:
> I am trying to capture an object initiation and deletion events using the
> __call__() and __del__() methods with the following approach.
Note that there is no guarantee that __dell__ will ever be called. Usually
it is better to introduce a weakref with callback.
>
Bob Williams wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> My operating system is Linux (openSUSE 13.1).
>
> I'm trying to create symlinks. The following code:
>
> if pathList[j][-3:] == "mp3":
> linkName1 = pathList[j][0:-3] + "mp3"
> linkName2 = destPath + linkName1[len
Scott W Dunning wrote:
>
> On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote:
>> If you want to make rows with more or less stars, or stars in other
>> colors you could add parameters:
>>
>> def star_row(numstars, starcolor):
>>fo
Scott W Dunning wrote:
>
> On Feb 23, 2014, at 1:12 AM, Scott W Dunning wrote:
>
>> I am VERY new to python (programming too). I had a question regarding
>> functions. Is there a way to call a function multiple times without
>> recalling it over and over. Meaning is there a way I can call a
Oscar Benjamin wrote:
> On 17 February 2014 20:13, Peter Otten <__pete...@web.de> wrote:
>> André Walker-Loud wrote:
>>>
>>> The 3rd party minimizer utilizes the .func_code.co_varnames and
>>> .func_code.co_argcount to determine the name an
André Walker-Loud wrote:
> Hello python tutors,
>
> I am utilizing a 3rd party numerical minimization routine. This routine
> requires an input function, which takes as arguments, only the variables
> with which to solve for. But I don’t want to define all possible input
> functions, in a gian
Aaron Misquith wrote:
> I have 2 different text files.
>
> File1.txt contains:
>
> file
> RAMPython
> parser
>
> File2.txt contains:
>
> file1234
> program
>
> I want to perform an union of these both files such that i get an output
> file3.txt which contains:
>
> file
> RAMPython
> parser12
Ian D wrote:
> Anyway thanks. I wondered why array was being mentioned ha ha
> So have I got this correct in that when I run a turtle program I am in
> fact using this forever loop, so I do not need to use a while True loop at
> all really in a turtle gui program?
Yes.
__
Santosh Kumar wrote:
> Hi all,
>
> I am using ipython.
>
> 1 ) Defined a string.
>
> In [88]: print string
> foo foobar
>
> 2) compiled the string to grab the "foo" word.
>
> In [89]: reg = re.compile("foo",re.IGNORECASE)
>
> 3) Now i am trying to match .
>
> In [90]: match = reg.match(stri
Peter Otten wrote:
> As a bonus the turtle changes its direction when you hit the left or right
> array.
I think "arrow" and my fingers decide they'd rather write "array". I'll
start proof-reading of these days...
Ian D wrote:
> Thanks for the help on the last one.
>
> Is it possible to restart a while loop? This doesn't work at all (surprise
> surprise)
>
> import turtle as t
>
> def start():
> global more
> more = True
>
> def stop():
> global more
> more = False
>
> more = True
>
eryksun wrote:
> On Tue, Feb 11, 2014 at 3:42 AM, Peter Otten <__pete...@web.de> wrote:
>>
>> Unfortunately the bytes --> bytes conversion codecs in Python 2 have no
>> convenient analog in Python 3 yet.
>>
>> This will change in Python 3.4
Ian D wrote:
> I am trying to exit a while loop whilst using turtle graphics.
> I don't seem to have the logic correct at all.
> I have tried a few different things
>
> These might seem a bit illogical to you guys but to me they make some
> sense, sadly
>
> I just don't really grasp these while
james campbell wrote:
> I have been currently trying to get a small piece of code to work, but
> keep getting an error:
>
> header_bin = header_hex.decode('hex')
> AttributeError: 'str' object has no attribute 'decode'
>
>
> The source of this code is from:
> https://en.bitcoin.it/wiki/Block_ha
rahmad akbar wrote:
> hey again guys, i am trying to understand these statements,
>
> if i do it like this, it will only print the 'print locus' part
>
> for element in in_file:
> if element.find('LOCUS'):
> locus += element
> elif element.find('ACCESSION'):
> accession += element
>
rahmad akbar wrote:
> he guys, i am trying to understand this code: i understand the first if
> statement (if line.startswith..) in read_fasta function but couldnt
> understand the next one(if index >=...). thanks in advance!!
Every time a line starts with a ">" sign the current Fasta instance is
Sivaram Neelakantan wrote:
>
> I've written this code that seems to work and I'd like to know how to get
> the record that causes the abort. Apparently 'executemany' doesn't
> support lastrow? And if it doesn't, any suggestions?
>
> --8<---cut here---start->
Denis Heidtmann wrote:
> Running python 2.7 on Ubuntu 12.04
>
> Code:
> def fib2(n):
> if n==1:
> return 1
> elif n==2:
> return 1
> else:
> return fib2(n-2) +fib2(n-1)
>
> The above works:
>
fib2(7)
> 13
fib2(4)
> 3
>
for i in range(4):
> ... print fib2(i)
> ...
>
> The ab
Ian D wrote:
Ian, please answer to the list, not me in private. Thank you.
> Most of this makes sense except for the c(a<=b)
> also
> if c(a<=b)
>
> It is the c(...) syntax that I don't understand.
>
> I dont recall seeing a statement like this.
c is just an arbitrary function, I put in the
Some Developer wrote:
> I'm currently trying to download emails from an IMAP server using
> Python. I can download the emails just fine but I'm having an issue when
> it comes to splitting the relevant headers. Basically I'm using the
> following to fetch the headers of an email message:
>
> typ,
Alan Gauld wrote:
> I'm playing with some bit twiddling code at present and started
> to get some unexpected results which i eventually realized
> were down to Python ints acting like signed ints in C (but
> with a 'flexible' sign bit!)
>
> This led me to wonder if there is a way to get unsigned
Gabriele Brambilla wrote:
> ok.
> the problem is that my "errors" are not always the same and sometimes they
> are only differences in the results displayed (with the same starting data
> and no random variables used between).
Sometimes randomness lurks where you don't expect it. Are there any di
Ian D wrote:
> Are:
>
> <=
> ==
> !=
>
> simple conditionals statements, conditionals, comparison operators,
> conditional expressions or what?
[comparison] operators:
http://docs.python.org/3.3/reference/lexical_analysis.html#operators
a <= b # expression (something is evaluated; ideally t
Thomas Maher wrote:
> I am teaching my students Python the second semester using
> www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some
> help. I am having a problem with the Lists-Set 1 exercise 18. The
> problem is below. I have put in several codes and the output is 5,
Dayo wrote:
> I wrote this script (http://bpaste.net/show/175284/) to help me
> automate some rsync backups, and whenever I run the script for large
> syncs, it just freezes after a while, and then I have to Ctrl+C it. I
Maybe you are just lacking patience ;)
> can find any clues in both source
Siobhan Wojcik wrote:
> Hello,
>
> I've been having an issue with a program that I'm writing. The program
> works until it has to compute something:
>
> def carPmt():
> cost = requestInteger("How much does the car cost?")
> downPmt = requestInteger("If there is a down payment, how much?")
>
Ian D wrote:
> Hello
>
> I used to use 2.7 and the input was pretty when inputting a numeric value,
> it would just get cast to an int.
>
> Seems that 3.3 I have to cast each input so :
> float(num1 = input("Enter a number")
You mean
num1 = float(input("Enter a number"))
> Is this just t
Gabriele Brambilla wrote:
> No, i'm not using lowlevel stuff...which part of the script do you want
> to see?
The part that remains when you throw out everything that has no effect on
the "strange errors" ;)
For example if you have a routine
def load_data(filename):
... # do complex proc
Gabriele Brambilla wrote:
> an example of errors that I obtain is: I build a matrix (SciPy array)
> using the same data.
> I search for the maximum and the minimum with the given function and I
> insert the two values in a tuple that I print.
> sometimes it print to me this: (0.0, 3.19266766501244
Kipton Moravec wrote:
> I am new to Python, and I do not know how to traverse lists like I
> traverse arrays in C. This is my first program other than "Hello World".
> I have a Raspberry Pi and they say Python is the language of choice for
> that little machine. So I am going to try to learn it.
>
Alan Gauld wrote:
> You need a loop such as
>
> for item in lab3int:
>intFile.write( str(item) )
You also need to separate the values, with a space, a newline or whatever.
So:
for item in lab3int:
intFile.write(str(item))
intFile.write("\n")
This can be simplified to
for item in
rick wrote:
> Hello Everyone,
>
> I think my approach is all wrong, but here goes.
>
> var1 = []; var2 = []; var3 = []; . . . ~50 lists
>
>
> each variable would be a list of two digit integers, or two digit
> integers stored as strings (I don't need to do any math, I just need to
> know whi
Rafael Knuth wrote:
> Hey there,
>
> I am having some issues with splitting strings.
> I already know how to split strings that are separated through empty
> spaces:
>
> def SplitMyStrings():
> Colors = "red blue green white black".split()
> return (Colors)
>
> print(SplitMyStrings())
>
701 - 800 of 1407 matches
Mail list logo