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
Felipe Melo wrote:
[Felipe, please post plain text, your code examples are unreadable]
> Hello,
> I'm starting with Python and I'm trying to work with "import" but I'm
> having a problem. I have the file c.py (that works when executed) with a
> function performing a multiplication:
> def mult(a,x
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 and behold the functio
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())
>
Ahmed, Shakir wrote:
> I am trying to insert a record in the access table, the value has a quote
> and could not insert the record. Any idea how I can insert records like
> this quotes.
> cursor.execute("INSERT INTO PicsPostInfo(Pics_name) values ('Site Name's
> Harbor.JPG')") Traceback (most rec
Denis Heidtmann wrote:
> Running python 2.7 in linux
>
> Below are two extremes. Can I get some guidance on this?
a=zeros((2,3),dtype=int)
b=a
a[:,0]=[1,2]
a
> array([[1, 0, 0],
>[2, 0, 0]])
b
> array([[1, 0, 0],
>[2, 0, 0]])
a=2
a
> 2
b
>
spir wrote:
> On 01/24/2014 10:22 AM, Peter Otten wrote:
>>
>> There's an odd outlier that I probably shouldn't tell you about [...]
>
> I guess there is a whole class of outliers; not really sure how to
> classify them.
I think you are focusing on the de
Tobias Quezada wrote:
> hello community,i am a newbie to python and program in general.
> the script below works in python 2.7.3 on windows but not in the python
> 2.7.3 ubuntu terminal.
>
fp=open("prez.dat","r")>>>x=fp.read>>>(print(x)***i used fp for file
pointer.I am using windows 7 an
+--+++
| | __iter__ | __next__ |
+--+++
| iterable | return an iterator | not available |
+--+++
| i
Keith Winston wrote:
> On Thu, Jan 23, 2014 at 12:21 AM, Devin Jeanpierre
> wrote:
>> in Python 3, it should be __next__, not next.
>
> Ah! That's it! Thanks!!!
>
>> I'd suggest staying away from any old blog posts and articles, unless
>> you'd care to learn Python 2.x instead of 3.x. ;)
>
> Y
S Tareq wrote:
> this is the coding that i am trying to run it on python 3.3. the original
> coding was made on python 2.7 however i have made some changes to the
> coding to make it work on python 3.3. the changes that i have made on
> brackets and raw_input to input. the coding does not load th
rahmad akbar wrote:
> hey guys, super noob here, i am trying to understand the following code
> from google tutorial which i failed to comprehend
>
> #code start
> # E. not_bad
> # Given a string, find the first appearance of the
> # substring 'not' and 'bad'. If the 'bad' follows
> # the 'not',
Pierre Dagenais wrote:
> I wish to fill a list called years[] with a hundred lists called
> year1900[], year1901[], year1902[], ..., year1999[]. That is too much
> typing of course. Any way of doing this in a loop? I've tried stuff like
> ("year" + str(1900)) = [0,0] but nothing works.
> Any solut
Pierre Dagenais wrote:
>
>
> On 13-12-31 04:09 PM, Keith Winston wrote:
>> Hi PierreD, I think if you iterate over your strings with something like
>> this, it will do what you want, if I understand correctly (snum is your
>> string number, like "123,321"):
>>
>> fnum = float(snum.replace(",",
Keith Winston wrote:
> I don't really get iterators. I saw an interesting example on
> Stackoverflow, something like
>
> with open('workfile', 'r') as f:
> for a, b, c in zip(f, f, f):
>
>
> And this iterated through a, b, c assigned to 3 consecutive lines of
> the file as it iterates t
Christian Alexander wrote:
> Hello Tutorians,
>
> Why does the interactive prompt not recognize escape sequences in strings?
> It only works correctly if I use the print function in python 3.
>
"Hello\nWorld"
> "Hello\nWorld"
The way python shows objects in the interactive interpreter has
Alan Gauld wrote:
> On 13/01/14 18:22, Peter Otten wrote:
>> Peter Otten wrote:
>
>> In the mean time here is my candidate:
>>
>> def test(a, b):
>> a = iter(a)
>> return all(c in a for c in b)
>
> That's pretty close to my original
701 - 800 of 1325 matches
Mail list logo