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
Peter Otten wrote:
> Emile van Sebille wrote:
>
>> On 01/12/2014 12:21 PM, Peter Otten wrote:
>>
>>>>>> test("axbxc", "abc")
>>> True
>>>>>> test("abbxc", "abc")
>>> False
>>&g
Emile van Sebille wrote:
> On 01/12/2014 12:21 PM, Peter Otten wrote:
>
>>>>> test("axbxc", "abc")
>> True
>>>>> test("abbxc", "abc")
>> False
>>
>> Is the second result desired?
>
&g
Emile van Sebille wrote:
> On 01/12/2014 06:43 AM, Dave Angel wrote:
>> Roelof Wobben Wrote in message:
>>
>> That documentation says nothing about order. And the test cases
>> specifically contradict it.
>>
>> so try
>>
>> if set (b) <= set (a):
>
> or, as the OP specified, if order is rel
Alan Gauld wrote:
> On 12/01/14 08:12, Roelof Wobben wrote:
>
>> # Write a Python procedure fix_machine to take 2 string inputs
>> # and returns the 2nd input string as the output if all of its
>> # characters can be found in the 1st input string and "Give me
>> # something that's not useless nex
Amrita Kumari wrote:
> On 17th Dec. I posted one question, how to arrange datafile in a
> particular fashion so that I can have only residue no. and chemical
> shift value of the atom as:
> 1 H=nil
> 2 H=8.8500
> 3 H=8.7530
> 4 H=7.9100
> 5 H=7.4450
>
Danny Yoo wrote:
> One of the common cases for split() is to break a line into a list of
> words, for example.
>
> #
'hello this is a test'.split()
> ['hello', 'this', 'is', 'a', 'test']
> #
>
> The Standard Library can
Keith Winston wrote:
> On Sun, Dec 22, 2013 at 3:04 PM, wrote:
>
>>
>> games = [p1.gameset(gamecount) for _ in range(multicount)]
>
>
> So Peter gave me a list of suggesttions, all of which I've incorporated
> and gotten running, and it's been instruct
Keith Winston wrote:
> On Sun, Dec 22, 2013 at 3:04 PM, wrote:
>
>> To sum it up: I like what you have, my hints are all about very minor
>> points
>> :)
>>
>
>
> Peter, that's a bunch of great suggestions, I knew there were a lot of
> places
Keith Winston wrote:
> I've put together my first small program. It's a simulation of the game
> Chutes & Ladders. It plays the game and amasses an array of ([multicount]
> [gamecount]) size, and then crunches simple stats on the average moves,
> chutes, and ladders for all games in each high-lev
Keith Winston wrote:
> I want to play with some stats, but I am having trouble installing numpy
> on mint 16 Petra/Saucy. Is there some way to do it, or some alternative,
> or do I not know what I'm talking about (largely true in this case)?
What did you try? I don't have Mint 16, but I'd expect
Oscar Benjamin wrote:
> I have to qualify my
> statement with this caveat to discourage pedants from correcting me.
Correction: no practical way to discourage pedants from correcting anyone
has been found yet. Your statement has no effect (at best).
;)
spir wrote:
> Hello,
>
> is it at all possible to set new vars (or any symbol) into an existing
> scope (typically locals())?
locals() normally contains a copy of the current namespace as a dict.
Setting items is possible but only alters the dict and has no effect on the
original namespace:
>
Amrita Kumari wrote:
> Hi,
>
> I am new in programming and want to try Python programming (which is
> simple and easy to learn) to solve one problem: in which
> I have various long file like this:
>
> 1 GLY HA2=3.7850 HA3=3.9130
> 2 SER H=8.8500 HA=4.3370 N=115.7570
> 3 LYS H=8.7530 HA=4.0340 HB
Rafael Knuth wrote:
> I just wrote a unittest for this function here:
>
> def PositiveCalculator(*summands):
> if all(x > 0 for x in summands):
> return sum(summands)
> else:
> raise ValueError("negative value")
>
> Here's the test (I want to test whether the function wor
Rafael Knuth wrote:
> Hej there,
>
>> I use any() and all() frequently. For example, suppose you have a
>> function that takes a list of numbers, and they are all supposed to be
>> positive.
>>
>> def calculate_values(numbers):
>> if all(number > 0 for number in numbers):
>> # do the
Alina Campana wrote:
> Hello dear tutorlist,
Welcome!
> I feel terribly ashamed for my bad english...
> Yet I'll try to form my question:
> It is about the continue statement in python.I wrote this code
> i = 0while (i < 10): if i == 5: continueprint i i+=1
> What i expecte
Rafael Knuth wrote:
> Hey there,
>
> I am currently looking into all built in functions in Python 3.3.0,
> one by one, in order to understand what each of them specifically does
> (I am familiar with some of them already, but most built in functions
> are still alien to me). I am working with the
Alan Gauld wrote:
> On 14/12/13 04:19, Steven D'Aprano wrote:
>
>> Lambda is just syntactic sugar for a function. It is exactly the same as
>> a def function, except with two limitations:
>>
>> - there is no name, or to be precise, the name of all lambda functions
>> is the same, "";
>
> Sorry,
Bo Morris wrote:
> Thank you for your assistance. Based on your direction, I figured it out.
>
> *This... *
>
> def add(number):
> print 1 + int(number)
>
> x = ['2', '4', '6', '8', '10', '12']
>
> [add(item) for item in x]
>
> *Is the same as... *
>
>
> def add(number):
> print
with colored code, tab
completion, etc
(see
http://ipython.org/ipython-doc/stable/api/generated/IPython.core.debugger.html?highlight=debugger#IPython.core.debugger)
Thanks,
Peter
On 27.11.2013 00:24, eryksun wrote:
On Tue, Nov 26, 2013 at 4:28 PM, Walter Prins wrote:
honest. Regarding
Steven D'Aprano wrote:
> On Wed, Nov 27, 2013 at 09:45:20AM +0100, Peter Otten wrote:
>
>> I took the freedom to report it myself:
>>
>> http://bugs.python.org/issue19808
>
> Thanks for reporting the issue!
>
>
> [off-topic]
>
> You might
Rafael Knuth wrote:
> simple issue I couldn't find a solution for:
>
> YourName = input(str("What is your name?"))
> print("Hello", YourName)
>
> When executing the program, in case the user input is "for", "not",
> "True", "while" Python interprets that as a command and changes the
> input's co
Alan Gauld wrote:
> On 26/11/13 16:49, Peter Otten wrote:
>
>>> When executing the program, in case the user input is "for", "not",
>>> "True", "while" Python interprets that as a command and changes the
>>> input'
Rafael Knuth wrote:
> Hej there,
>
> simple issue I couldn't find a solution for:
>
> YourName = input(str("What is your name?"))
> print("Hello", YourName)
>
> When executing the program, in case the user input is "for", "not",
> "True", "while" Python interprets that as a command and changes
Rafael Knuth wrote:
> Hej there,
>
> newbie question: I struggle to understand what exactly those two
> subsequent for loops in the program below do (Python 3.3.0):
>
> for x in range(2, 10):
> for y in range(2, x):
> if x % y == 0:
> print(x, "equals", y, "*", x//y)
>
Dominik George wrote:
>> Subject: [Tutor] (no subject)
>
> On a side note, please learn how to send e-mail.
Nik,
this is a beginners' list, so please be more constructive.
久場海人,
Nik may be unfriendly, but he is right; in future posts please take the time
to pick a subject that gives the read
G. McKinnon Ryall wrote:
> I have a script that outputs results to a file (one file, reused.) I would
> like to have an output file in this format
>
> #
> (blank line)
> (output from program (only one line))
> name
> (T/F)
> (result iteration, shortened to x.)
> #-
久場海人 wrote:
> Hi. I began programming literally 2 days ago.
>
> This is a code to setup password and confirms to make sure they both
> match, and I need to know what coding I can use to loop back to specific
> line to start the code over if the user were to incorrectly typed in the
> password.
>
Rafael Knuth wrote:
> Hej there,
>
> I want to use a while loop in a program (version used: Python 3.3.0),
> and I expect it to loop unless the user enters an integer or a
> floating-point number instead of a string.
>
> print("TIME TRACKING")
> hours_worked = input("How many hours did you work
Byron Ruffin wrote:
> Need a little help with finding a process for this:
>
> when a string of text is input, for example: abc def.
> I want to have each letter shift to the right one place in the alphabet.
> Thus..
> abc def would be output as bcd efg.
>
> Any ideas on how to do this?
Have a l
jarod...@libero.it wrote:
> Hi I want to merge many files like this:
> #file1
> A 10
> B 20
> C 30
> #file2
> B 45
> Z 10
> #file1
> A 60
> B 70
> C 10
>
> I want to obtain
>
> A 10 0 60
> B 20 45 70
> C 30 0 10
> Z 0 10 0
>
> I try to do like this:
> f = os.lis
To the people who kindly replied to my question: many thanks!
On 10/31/2013 06:29 PM, Danny Yoo wrote:
As an aside: It shouldn't be too bad to write a "generator" for the
geometric series, so that we can pick out the terms on-demand.
#
>>> def geometric(base):
Ulrich Goebel wrote:
> Hallo,
>
> from a SQLite database I get a value by SELECT s from... which normaly
> is a string, but can be the NULL value, wich means it is not defined. To
> put the value into a form (made by QT) I need a string representation.
>
> str(s) gives either the string itself (
Amal Thomas wrote:
> Yes I have found that after loading to RAM and then reading lines by lines
> saves a huge amount of time since my text files are very huge.
How exactly did you find out? You should only see a speed-up if you iterate
over the data at least twice.
Nitish Kunder wrote:
> I have a dictionary which is in this format
> for ex:
>
> {
> '5x' : {
> '50' : {
> 'update' : {
> 'update-from-esxi5.0-5.0_update01' : {
> 'call' : Update,
> 'name' : 'Update50u1',
> 'release' : '15/03/12'
> },
> 'update-from-esxi5.0-5.0_update02' : {
> 'call' : Update,
>
series_element
if series_element > 60:
break
print series
Many thanks,
Peter
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Marc wrote:
> Hi,
> I am having an issue with something that would seem have an easy solution,
> which escapes me. I have configuration files that I would like to parse.
> The data I am having issue with is a multi-line attribute that has the
> following structure:
>
> banner
> Banner text
> B
Alan Gauld wrote:
[Ruben Pinedo]
> def process_file(filename):
> hist = dict()
> fp = open(filename)
> for line in fp:
> process_line(line, hist)
> return hist
>
> def process_line(line, hist):
> line = line.replace('-', ' ')
>
> for word in line.split():
>
Mark Lawrence wrote:
> On 11/10/2013 15:23, Peter Otten wrote:
>> Alan Gauld wrote:
>>
>>>> Use the stripw() function we saw on individual words to make
>>>> finding hits more accurate
>>>
>>> No idea what that means but since the assignme
Alan Gauld wrote:
>> Use the stripw() function we saw on individual words to make
>> finding hits more accurate
>
> No idea what that means but since the assignment suggests
> it we should assume its correct.
My crystal ball says
def stripw(word):
return word.strip('",.')
or somesuch.
> Y
Jackie Canales wrote:
> Need assistance with a questions in regards to python:
> 1. function occurs(name, word) which looks for a word in the file with
> name name. 2. for each occurrence of the word we want to display its
> context by showing the 5 words (or so) preceding and following the
> occu
Alex Kleider wrote:
> On 2013-10-09 00:29, Peter Otten wrote:
>> While I did not read the documentation I did try your code:
>>
>> (docopt)$ cat test
>> #!/usr/bin/env python
>> # -*- coding : utf -8 -*-
>> # file: 'test'
>> "&
Alex Kleider wrote:
>
> A recent post recommended the docopt module so I've incorporated it into
> the code I'm using to learn SQLite. It's not behaving as I expected.
> Here's a snippet of code:
>
>
> #!/usr/bin/env python
> # -*- coding : utf -8 -*-
> # file: 'test'
> """Usage: test [new_data
Naman Kothari wrote:
> Can you please suggest a link from where i can download SendKeys module
> for python. Also provide an explanation to add the module to my library.
> PS: I am a Windows user.
I'd start installing a tool called "pip". I suggest that you follow the
instructions given here:
h
Jenny Allar wrote:
> I'm only a few days in to learning Python, so please bear with me.
Welcome!
> I need to line up the decimals on the printed information but I cannot get
> the text to look uniform at all.
> print("The cost of the carpet is $", format(subtotal,'9,.2f'))
> print("The
memilanuk wrote:
> I'm working thru a Flask tutorial, and when I get to the portion for
> querying the database (sqlite3) for the existing posts, i.e. 'SELECT *
> FROM posts', I get an error that says there is no such table 'posts' in
> my database. Yet I can query said db file from either the sq
Steven D'Aprano wrote:
> On Thu, Sep 05, 2013 at 09:11:50AM +1000, Steven D'Aprano wrote:
>
>> I don't believe there is a way to make
>> string literals unicode, you just have to get used to writing u"" and
>> b"" strings by hand.
>
> Sorry, that is unclear. I meant to say, there is no way to fo
Ismar Sehic wrote:
> hello.
Ismar, please post in plain text. The markup appears as funny stars over
here.
> i wrote the following code, to insert some values from a csv file to my
> postgres table :
>
> ***
> *import psycopg2*
> *conn = psycopg2.connect("host = ***.***.***.*** user=**
Duri Denoth wrote:
> Hello Tutor
>
> I have written a program that generates verb conjugations.
>
> There is a loop that generates the regular forms:
>
> for i in range(6):
> present[i] = stem + worded_present_ar[i]
An alternative way to write this is
present = [stem + suffix for suffix i
Alan Gauld wrote:
> On 22/08/13 21:27, Chris Down wrote:
>
>> You can also use the "else" clause if there is stuff you want to run if
>> the try block doesn't raise the caught exception, which avoids putting it
>> in "try" if you don't intend to exit from the exception.
>
> I admit that I've nev
eryksun wrote:
> Constant folding for binary operations has a length limit of 20 for
> sequences:
>
> >>> dis.dis(lambda: '0123456789' + '0123456789' + '0')
> 1 0 LOAD_CONST 3 ('0123456789
> 0123456789')
>
Albert-Jan Roskam wrote:
> ___
>>From: eryksun
>>To: Jim Mooney
>>Cc: tutor@python.org
>>Sent: Tuesday, June 25, 2013 2:14 PM
>>Subject: Re: [Tutor] mistaken about splitting expressions over lines
>
>
>
>>
> a = ('this' # this way
>>... ' string' ' is lon
Matt D wrote:
> On 06/24/2013 07:17 PM, Alan Gauld wrote:
>> On 24/06/13 23:05, Matt D wrote:
>>> I have been unable to find a way to write pickled data to text file.
>>
>> Probably because pickled data is not plain text.
>> You need to use binary mode. However...
>>
>>
>>> def __init__(se
Antonio Zagheni wrote:
>> I am a begginer in Pythonu
>> I did a function that returns a string and I want to copy this to the
>> clipboard. I have tried a lot of suggestions found at Google but nothing
>> works properly. Is there an easy way to do that?
>> I am using Python 2.7 and Windows 7.
>
>
John Steedman wrote:
> Hi Tutors,
>
> I'm confused by the following possible contradiction. Would someone please
> explain or point me to the right docs.
>
> FACT 1
>
> "Variables in python hold references to objects."
> http://en.wikipedia.org/wiki/Python_syntax_and_semantics
>
> FACT 2
>
>>
Dave Angel wrote:
> On 06/23/2013 02:18 AM, Jack Little wrote:
>> I am trying to use random.choice for a text based game. I am using
>> windows 7, 64-bit python. Here is my code:
>>
>> def lvl2():
>> print "COMMANDER: Who should you train with?"
>> trn=random.choice(1,2)
>> if trn==
Jim Byrnes wrote:
> I need to convert a series of digits like 060713 to a string so I can
> make it look like a date 06-07-13.
>
> >>> a = 060713
> >>> a[:2]
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: 'int' object has no attribute '__getitem__'
> >>> b = str(a)
Jim Mooney wrote:
> dictnumfarkadoodle = listnumfarkadoodle = setnumfarkadoodle = 0
> # Since these are global I'm using words not likely to be duplicated
> until I figure a different way and
> # replace 'farkadoodle' with '' ;')
Name clashes are generally not a problem if
(1) you keep module s
Alan Gauld wrote:
> rand_num = None
>
> def rand_int():
> global rand_num
> if not rand_num:
This will not recognize the (unlikely but possible) case that
random.random() returns 0.0. So you better check for None explicitly
if rand_num is None:
>rand_num = int(math.ceil (
Danilo Chilene wrote:
> Hello,
>
> Below is my code:
>
> #!/bin/env python
> # -*- coding: utf-8 -*-
> import requests
> from lxml import etree
>
> url = 'http://192.168.0.1/webservice.svc?wsdl'
> headers = {'Content-Type': 'text/xml;charset=UTF-8', 'SOAPAction': '
> http://tempuri.org/ITServic
Matt D wrote:
> Hey,
> I wrote some simple code to write data to a logfile and it works pretty
> well (thanks guys). Now my problem is that every time i run the program
> the old logfile.txt is overwritten.
The help() function in the interactive interpreter is a good tool hunt for
help on fea
Khalid Al-Ghamdi wrote:
>1. >>> class k:
>2. def __init__(self,n):
>3. return n*n
>4.
>5.
>6. >>> khalid=k(3)
>7. Traceback (most recent call last):
>8. File "", line 1, in
>9. khalid=k(3)
>10. TypeError: __init__() should retu
ook like numbers:
>>> number_strings = ["2", "20", "100", "1"]
>>> sorted(number_strings, key=lambda x: (len(x), x))
['1', '2', '20', '100']
>>> names = ["Abe", "Peter", &quo
Andrew Triplett wrote:
> I am on chapter two for Python Programming working on the challenges and
> the question is:
>
> 1. Create a list of legal and illegal variable names. Describe why each is
> either legal or illegal. Next, create a list of "good" and "bad" legal
> variable names. Describe w
spiff007 wrote:
> Hi there Tutor folks
>
> I need your help with a modified version of the subset sum problem [
> http://en.wikipedia.org/wiki/Subset_sum_problem].
>
> The problem i am facing is a bit hard to describe (as most complex problem
> always are :D ), so please bear with my longish art
spangled spanner wrote:
> G'day,
>
> I have a comprehension issue here! I have made two simple scripts:
>
> ## script1
>
> import os
>
> print os.getcwd()
>
> -
> ## script 2
>
> import os
>
> f = open('test', 'wb')
> f.write(os.getcwd())
> f.close()
>
> ___
Rafael Knuth wrote:
> Thank you, I am using Python 3.3.0
[Oscar]
> In Python 3 you should use input(). In Python 2 you should use
> raw_input(). I'm guessing that you're using Python 2. In Python 2 the
> input() function tries to evaluate whatever the user types in as if it
> was Python code. Sin
Phil wrote:
> My apatite having been whetted I'm now stymied because of a Ubuntu
> dependency problem during the installation of urllib3. This is listed as
> a bug. Has anyone overcome this problem?
>
> Perhaps there's another library that I can use to download data from a
> web page?
You mean y
Phil wrote:
> On 18/05/13 19:25, Peter Otten wrote:
>>
>> Are there alternatives that give the number as plain text?
>
> Further investigation shows that the numbers are available if I view the
> source of the page. So, all I have to do is parse the page and extract
>
Phil wrote:
> On 18/05/13 16:33, Alan Gauld wrote:
>> On 18/05/13 00:57, Phil wrote:
>>> I'd like to "download" eight digits from a web site where the digits are
>>> stored as individual graphics. Is this possible, using perhaps, one of
>>> the countless number of Python modules? Is this the funct
kyle seebohm wrote:
> I recently created a program that searches through a computer's drive to
> make a list of all the files in that drive. However, the drive I am
> attempting to parse through is extremely large and when I run my program,
> it runs for about 5 or 10 minutes then proceeds to not
Danilo Chilene wrote:
> Hello,
>
> I have the code below:
>
> import argparse
> class Myclass(object):
>
> def foo(self):
> print 'foo'
>
> def bar(self):
> print 'bar'
>
> def test(self,name,place):
> print name, place
>
> class Main(Myclass):
> def _
Ajin Abraham wrote:
> Please refer this paste: http://bpaste.net/show/vsTXLEjwTLrWjjnfmmKn/
> and suggest me the possible solutions.
> Regards,
Quoting the paste:
> i am executing these in Python 2.7 interpreter
> >>>import os
> >>> os.path.join(r'C:\win\apple.exe')
> #will returns me = 'C:\\win
Treder, Robert wrote:
> 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 categ
Andy McKenzie wrote:
> Hey folks,
>
> I'm trying to figure out how to do something, and it feels like it
> should
> be possible, but I can't figure out how. What I want is to define four
> expressions, like so:
>
> (\sNorth\s|\sN\s)(\sSouth\s|\sS\s)(\sEast\s|\sE\s)(\sWest\s|\sW\s)
>
> And
Prasad, Ramit wrote:
> Jim Mooney wrote:
>>
>> > In py3.x, iteritems was replaced by .items()
>>
>> Interesting, since iteritems was in my book, which was "updated" for
>> Py33. I guess the moral is you shouldn't trust an author 100% ;') I
>> must admit, iteritems did seem awkward and annoying
To "zoom" a matplotlib graph, the matplotlib docs all say "use R mouse button".
But my laptop has no mouse, only a touchpad (running OSX Mountain Lion).
I've tried lots of "click plus key" combinations, no luc
Phil wrote:
> I think I must be very close now so I'll post just the code that I think
> is relevant.
>
> This the main window class:
> import satListDialog
Here you are importing the module "satListDialog"
> class MainWindow(QMainWindow, Ui_MainWindow):
>
> This is the function to show the
Sayan Chatterjee wrote:
> Yes, when handled as a numpy array, it's working fine!
>
> Traceback (most recent call last):
> File "ZA.py", line 59, in
> if temp_za == j:
> ValueError: The truth value of an array with more than one element is
> ambiguous. Use a.any() or a.all()
>From the atta
Sayan Chatterjee wrote:
> Hi Walter,
> Thanks a lot!
>
> Yes, now I get your point. append is working perfectly fine.
>
> Hi Peter:
>
> Exactly. It's very nice. Indices needn't have to be mentioned explicitly.
> No explicit looping and the thing is done!
&g
Sayan Chatterjee wrote:
> When trying to print or assign array elements, getting the following
> error:
>
> Traceback (most recent call last):
> File "ZA.py", line 32, in
> p_za[i] = p_initial[i] + t*K*cos(K*p_initial[i]);
> IndexError: index out of bounds
>
> I am using Numpy, is it due
Sayan Chatterjee wrote:
> for t in range(0,200):
> fname = 'file_' + str(t)
>
> So it will assign fname values file_0, file_1 so on. Dropping the quotes
> is giving me
>
> IOError: [Errno 2] No such file or directory: 'file_0'
>
>
> Indeed the file is not present. In C we write,if we have to
michelle_low wrote:
> Hi Peter,
> Thanks for your help.
You're welcome. In the future, please send your mail to the list, not to an
individual poster. That way more people get a chance to read it and you are
more likely to get help.
> I have followed your advice:
>
>
michelle_low wrote:
> Can someone please help me with the following phyton script? I received
Python; write it on the blackboard one hundred times ;)
> the error message DeprecationWarning: the sets module is deprecated
> from sets import Set.
> After googling, I have tried the methods othe
Phil wrote:
> On 20/03/13 15:09, Mitya Sirenef wrote:
>
>
>>
>> By the way, you can further simplify it by doing:
>>
>> def histogram2(s):
>> return {c: d.get(c,0)+1 for c in s}
>>
>>
>> That will work in python 3, in python 2 you need:
>>
>> return dict((c: d.get(c,0)+1) for c in s)
>
Abhishek Pratap wrote:
> I am trying to use itertools.izip_longest to read a large file in
> chunks based on the examples I was able to find on the web. However I
> am not able to understand the behaviour of the following python code.
> (contrived form of example)
>
>
>
> for x in itertools.izi
Christopher Emery wrote:
> Hello Peter,
>
> Thank you this is much appreciated! It is much clear now. Thank you
>
> PO: Also, if you make it a habit to keep long option and dest in sync
> (something you get for free if you only specify the option) you can
> deduce the a
801 - 900 of 1407 matches
Mail list logo