Re: Separate Rows in reader

2013-03-24 Thread Jiewei Huang
On Sunday, March 24, 2013 9:10:45 PM UTC+10, ypsun wrote: > Jiewei Huang於 2013年3月24日星期日UTC+1上午6時20分29秒寫道: > > > Hi all, > > > > > > > > > > > > Currently create a simple text-based database of information about people > > > > > > > > > > > > > > > > > > I have a csv file which c

Re: io.BytesIO

2013-03-24 Thread Steven D'Aprano
On Mon, 25 Mar 2013 00:10:04 -0500, Fabian von Romberg wrote: > Hi Steven, > > > actually why I need is to know how much memory has been allocated for > buffering. > > getsizeof gets the size of the object structure. I can see at least four ways to get the current size of the BytesIO buffer:

Re: io.BytesIO

2013-03-24 Thread Fabian von Romberg
Hi Steven, actually why I need is to know how much memory has been allocated for buffering. getsizeof gets the size of the object structure. For example, if I do io.BytesIO.truncate(1), it will resize the buffer to 1 bytes. So my question is how to get those 1 back from an attribu

Re: io.BytesIO

2013-03-24 Thread Steven D'Aprano
On Sun, 24 Mar 2013 22:56:12 -0500, Fabian von Romberg wrote: > Hi, > > is there any way to get the allocated memory size from a io.BytesIO > object? The same as for any object: py> import io, sys py> obj = io.BytesIO() py> sys.getsizeof(obj) 48 Is this what you are after, the size of the obj

io.BytesIO

2013-03-24 Thread Fabian von Romberg
Hi, is there any way to get the allocated memory size from a io.BytesIO object? Thanks and regards, Fabian -- http://mail.python.org/mailman/listinfo/python-list

Re: Separate Rows in reader

2013-03-24 Thread rusi
On Mar 24, 11:28 pm, Tim Chase wrote: > > Sorry if my print-statements were misinterpreted--I meant them as a > "do what you want with the data here" stand-in (thus the ellipsis). Heh! I assumed the OP was a noob to whom this was directed (and whose original had the print statements in loops). >

Re: import in Python3.3

2013-03-24 Thread Fabian von Romberg
Hi Steven, thanks a lot for the explanation. I will keep in mind not to use names for my modules that can shadow the standard library. Regards, Fabian On 03/24/2013 07:27 PM, Steven D'Aprano wrote: > On Sun, 24 Mar 2013 18:12:49 -0500, Fabian von Romberg wrote: > >> Hi, >> >> I have a package

Re: Separate Rows in reader

2013-03-24 Thread Jiewei Huang
On Sunday, March 24, 2013 3:20:29 PM UTC+10, Jiewei Huang wrote: thanks to you guys i got my desire outcome! i will continue to code on writing and saving of csv file -- http://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 2.7.4 release candidate 1

2013-03-24 Thread Benjamin Peterson
I'm happy to announce the first release candidate of 2.7.4. 2.7.4 will be the latest maintenance release in the Python 2.7 series. It includes hundreds of bugfixes to the core language and standard library. There has recently been a lot of discussion about XML-based denial of service attacks. Spe

Re: import in Python3.3

2013-03-24 Thread Steven D'Aprano
On Sun, 24 Mar 2013 18:12:49 -0500, Fabian von Romberg wrote: > Hi, > > I have a package name collections and inside of my package I want to > import the collections package from the standard library, but there is > name conflicts. > > How do I import explicitly from the standard library? You c

Re: how does the % work?

2013-03-24 Thread Tim Roberts
leonardo wrote: > >thank you all! So, what was the problem? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

import in Python3.3

2013-03-24 Thread Fabian von Romberg
Hi, I have a package name collections and inside of my package I want to import the collections package from the standard library, but there is name conflicts. How do I import explicitly from the standard library? Im working on Python3.3 Thanks in advance and regards, Fabian -- http://mail.p

Re: ImportError: No module named multipli

2013-03-24 Thread yahya Kacem
+Mark Lawrence sorry for that I'm new here and I didn't know about that. -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named multipli

2013-03-24 Thread yahya Kacem
On Sunday, March 24, 2013 4:35:29 PM UTC+1, yahya Kacem wrote: > Hi, i have this 2 files: > > > > file named multipli: > > > > #!/usr/bin/python3.2 > > #-* - coding : utf-8 -* > > def table(nb, max): > > i = 0 > > while i < max: > > print(i + 1, " * ", nb,

Re: Required arguments in argparse: at least one of a group

2013-03-24 Thread rurpy
On 03/23/2013 10:04 AM, Marco wrote: > Is there the possibility using the argparse module to group two or more > arguments in order to have at least one of them required? For instance, > I would like to have not an error only in the following cases: > >python finder.py --file myfile --dir my

Re: Required arguments in argparse: at least one of a group

2013-03-24 Thread Marco
On 03/23/2013 05:27 PM, Rob Day wrote: I don't know about argparse, but if you use docopt (http://docopt.org/) then this is easy to do with something like: """Usage: finder.py --file --dir finder.py --pattern --dir finder.py --file --pattern --dir """ Thanks Rob, but I was looking for

Re: Separate Rows in reader

2013-03-24 Thread Tim Chase
On 2013-03-24 08:57, rusi wrote: > On Mar 24, 6:49 pm, Tim Chase wrote: > After doing: > > >>> import csv > >>> original = file('friends.csv', 'rU') > >>> reader = csv.reader(original, delimiter='\t') > > > Stripping of the first line is: > >>> list(reader)[1:] > >>> [tuple(row) for row in list

i need advice

2013-03-24 Thread leonardo selmi
dear python programmers, i am focused on learning to program but i need help from all of you. i am a beginner but it is hard to find the right book or website to learn, i know that i have to do exercises but so far i found resources with gaps. i would be very grateful if you could give me sugge

Re: i need advice

2013-03-24 Thread Omer
I know some people will disagree with me, but I recommend on "Dive Into Python" by Mark Pilgrim. It assumes no prior knowledge whatsoever, and it explains all the foundations of the language from the bottom up, without skipping any steps. It also provides many examples that demonstrate how to get

Re: i need advice

2013-03-24 Thread Mark Lawrence
On 24/03/2013 17:24, leonardo selmi wrote: dear python programmers, i am focused on learning to program but i need help from all of you. i am a beginner but it is hard to find the right book or website to learn, i know that i have to do exercises but so far i found resources with gaps. i would

Re: i need advice

2013-03-24 Thread Joel Goldstick
On Sun, Mar 24, 2013 at 1:24 PM, leonardo selmi wrote: > dear python programmers, > > i am focused on learning to program but i need help from all of you. i am > a beginner but it is hard to find the right book or website to learn, i > know that i have to do exercises but so far i found resources

i need advice

2013-03-24 Thread leonardo selmi
dear python programmers, i am focused on learning to program but i need help from all of you. i am a beginner but it is hard to find the right book or website to learn, i know that i have to do exercises but so far i found resources with gaps. i would be very grateful if you could give me sugge

Re: ImportError: No module named multipli

2013-03-24 Thread Mark Lawrence
On 24/03/2013 16:03, yahya Kacem wrote: On Sunday, March 24, 2013 4:35:29 PM UTC+1, yahya Kacem wrote: Hi, i have this 2 files: file named multipli: #!/usr/bin/python3.2 #-* - coding : utf-8 -* def table(nb, max): i = 0 while i < max: print(i + 1,

Re: ImportError: No module named multipli

2013-03-24 Thread Chris Angelico
On Mon, Mar 25, 2013 at 3:10 AM, Mark Lawrence wrote: > On 24/03/2013 15:48, Chris Angelico wrote: >> >> On Mon, Mar 25, 2013 at 2:35 AM, yahya Kacem wrote: >>> >>> file named multipli: >>> >>> and file naled test: >>> >>> from multipli import table >> >> >> Try naming it multipli.py >> >> C

Re: Vowels [was Re: "monty" < "python"]

2013-03-24 Thread Mark Lawrence
On 24/03/2013 14:25, Stefan Behnel wrote: Terry Reedy, 22.03.2013 00:05: I never imagined that there were people who would mix up 'tuner' and 'tuna'. Live and learn. I assume you know "The Chaos" ? http://ncf.idallen.com/english.html Stefan For many years I've felt it was wrong that peop

Re: ImportError: No module named multipli

2013-03-24 Thread Mark Lawrence
On 24/03/2013 15:48, Chris Angelico wrote: On Mon, Mar 25, 2013 at 2:35 AM, yahya Kacem wrote: file named multipli: and file naled test: from multipli import table Try naming it multipli.py ChrisA Before or after fixing the infinite loop? :) -- Cheers. Mark Lawrence -- http://ma

Re: ImportError: No module named multipli

2013-03-24 Thread yahya Kacem
On Sunday, March 24, 2013 4:35:29 PM UTC+1, yahya Kacem wrote: > Hi, i have this 2 files: > > > > file named multipli: > > > > #!/usr/bin/python3.2 > > #-* - coding : utf-8 -* > > def table(nb, max): > > i = 0 > > while i < max: > > print(i + 1, " * ", nb,

Re: Separate Rows in reader

2013-03-24 Thread rusi
On Mar 24, 6:49 pm, Tim Chase wrote: > On 2013-03-24 09:03, Dave Angel wrote: > > > >> > > [THANK YOU!] > > > > Sorry my typo in the output here is the correct output that i > > > need : > > > > [('John Konon', 'Ministry of moon Walks', '4567882', '27-Feb'), > > > ( 'Stacy Kisha', 'Ministry of Ma

Re: ImportError: No module named multipli

2013-03-24 Thread Chris Angelico
On Mon, Mar 25, 2013 at 2:35 AM, yahya Kacem wrote: > file named multipli: > > and file naled test: > > from multipli import table Try naming it multipli.py ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named multipli

2013-03-24 Thread Kwpolska
On Sun, Mar 24, 2013 at 4:35 PM, yahya Kacem wrote: > Hi, i have this 2 files: > > file named multipli: > > #!/usr/bin/python3.2 > #-* - coding : utf-8 -* > def table(nb, max): > i = 0 > while i < max: > print(i + 1, " * ", nb, "= ", (i + 1) * nb) > > and file naled

ImportError: No module named multipli

2013-03-24 Thread yahya Kacem
Hi, i have this 2 files: file named multipli: #!/usr/bin/python3.2 #-* - coding : utf-8 -* def table(nb, max): i = 0 while i < max: print(i + 1, " * ", nb, "= ", (i + 1) * nb) and file naled test: #!/usr/bin/python3.2 # -* - coding : utf-8 -* import o

Re: Vowels [was Re: "monty" < "python"]

2013-03-24 Thread rusi
On Mar 24, 7:25 pm, Stefan Behnel wrote: > > I assume you know "The Chaos" ? > > http://ncf.idallen.com/english.html Ha! Sweet! (Or should I say suet?) -- http://mail.python.org/mailman/listinfo/python-list

Re: Vowels [was Re: "monty" < "python"]

2013-03-24 Thread Stefan Behnel
Terry Reedy, 22.03.2013 00:05: > I never imagined that there were people who would mix up 'tuner' and > 'tuna'. Live and learn. I assume you know "The Chaos" ? http://ncf.idallen.com/english.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: "monty" < "python"

2013-03-24 Thread Mark Lawrence
On 24/03/2013 13:31, jmfauth wrote: The problem here is that this PEP 393 should not have been created. The first time I read it, I quickly understood, it can not work! How come you couldn't pursuade the Python devs that PEP393 was so flawed? This is illustrated by all the examples I give o

Re: Separate Rows in reader

2013-03-24 Thread Tim Chase
On 2013-03-24 09:03, Dave Angel wrote: > >> [THANK YOU!] > > Sorry my typo in the output here is the correct output that i > > need : > > > > [('John Konon', 'Ministry of moon Walks', '4567882', '27-Feb'), > > ( 'Stacy Kisha', 'Ministry of Man Power', '1234567', 17-Jan')] > > > > the difference

Re: "monty" < "python"

2013-03-24 Thread Chris Angelico
On Mon, Mar 25, 2013 at 12:31 AM, jmfauth wrote: > The problem here is that this PEP 393 should not have been > created. > The first time I read it, I quickly understood, it can > not work! I fail to understand how something can "not work" when it is clearly working, and very successfully too, in

Re: "monty" < "python"

2013-03-24 Thread jmfauth
On 23 mar, 17:17, Mark Lawrence wrote: > On 23/03/2013 09:24, jmfauth wrote: > > > > > > > > > > > On 20 mar, 22:02, Tim Delaney wrote: > >> On 21 March 2013 06:40, jmfauth wrote: > > >>> > >>> [snip usual rant from jmf] > > >> It has been acknowledged as a real regression, but he keeps hij

Re: Separate Rows in reader

2013-03-24 Thread Dave Angel
On 03/24/2013 04:11 AM, Jiewei Huang wrote: Sorry my typo in the output here is the correct output that i need : [('John Konon', 'Ministry of moon Walks', '4567882', '27-Feb'), ( 'Stacy Kisha', 'Ministry of Man Power', '1234567', 17-Jan')] the difference is that i need a [(row two), (row

Re: Separate Rows in reader

2013-03-24 Thread ypsun
Jiewei Huang於 2013年3月24日星期日UTC+1上午6時20分29秒寫道: > Hi all, > > > > Currently create a simple text-based database of information about people > > > > > > I have a csv file which consist of 3 rows , row 1 2 and 3 is as such: > > Name AddressTelephone Birthday > > John Konon

Re: Separate Rows in reader

2013-03-24 Thread ypsun
Jiewei Huang於 2013年3月24日星期日UTC+1上午6時20分29秒寫道: > Hi all, > > > > Currently create a simple text-based database of information about people > > > > > > I have a csv file which consist of 3 rows , row 1 2 and 3 is as such: > > Name AddressTelephone Birthday > > John Konon

Re: addressof object with id()

2013-03-24 Thread Steven D'Aprano
On Sun, 24 Mar 2013 06:54:08 +, Nobody wrote: > More generally, an implementation *may* intern any immutable value, > although it's not guaranteed to do so for anything except (IIRC) False, > True and None. I believe the same also applies to NotImplemented and Ellipsis, although I'm too lazy

Re: Separate Rows in reader

2013-03-24 Thread Jiewei Huang
On Sunday, March 24, 2013 5:34:03 PM UTC+10, rusi wrote: > On Mar 24, 10:46 am, Dave Angel wrote: > > > On 03/24/2013 01:20 AM, Jiewei Huang wrote: > > > > > > > > > > > >this is the data in csv file http://imgur.com/L4qUkGQ and this is the correct output that i need to get: [('John Konon', '

Re: Separate Rows in reader

2013-03-24 Thread Jiewei Huang
On Sunday, March 24, 2013 3:46:49 PM UTC+10, Dave Angel wrote: > On 03/24/2013 01:20 AM, Jiewei Huang wrote: > > > Hi all, > > > > > > Currently create a simple text-based database of information about people > > > > > > > > > I have a csv file which consist of 3 rows , row 1 2 and 3 is as su

Re: addressof object with id()

2013-03-24 Thread Peter Otten
Steven D'Aprano wrote: > On Sat, 23 Mar 2013 21:00:07 -0400, Roy Smith wrote: > >> In article , >> Fabian von Romberg wrote: >> >>> Hi, >>> >>> I have a single questions regarding id() built-in function. >>> >>> example 1: >>> >>> var1 = "some string" >>> var2 = "some string" >>> >>> if us

Re: SOAPpy.Types.faultType: Cannot use object of type stdClass as array

2013-03-24 Thread Tamer Higazi
Hi Chris! The example from the website is buggy because the WSDL urls are not correct... $WSDL_AUTH = 'https://kasapi.kasserver.com/soap/wsdl/KasAuth.wsdl' $WSDL_API ='https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl' which I had replaced so far. then you will see the results, even if the logi

Re: Separate Rows in reader

2013-03-24 Thread rusi
On Mar 24, 10:46 am, Dave Angel wrote: > On 03/24/2013 01:20 AM, Jiewei Huang wrote: > > > > > > > > > > > Hi all, > > > Currently create a simple text-based database of information about people > > > I have a csv file which consist of 3 rows , row 1 2 and 3 is as such: > > Name        Address