Re: Python, VIM: namespace, scope, life of a python object stuck in a << HERE

2014-11-04 Thread Peter Otten
Veek M wrote: > If i have two functions: > > function! foo() > python3 << HERE > import mylib > pass > HERE > > function! bar() > python3 << HERE > import mylib > pass > HERE > > The src says: > > 1. Python interpreter main program > 3. Implementation of the Vim module for Python > > So

Re: What is the difference between these two? (Assigning functions to variables)

2014-11-04 Thread Max Nathaniel Ho
On Wednesday, November 5, 2014 2:00:08 PM UTC+8, Cameron Simpson wrote: > On 04Nov2014 19:17, Max Nathaniel Ho wrote: > >Just to be clear, I was referring to these two lines > > > >greet = compose_greet_func() > > > >greet_someone = greet > > Please don't top-post. Thanks. > > Your first assignm

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Chris Angelico
On Wed, Nov 5, 2014 at 5:39 PM, Cameron Simpson wrote: > Bah! He asked if there were lower levels than binary. Ergo: chip design! > (And microcode, the intermediate layer. Or one of the layers, depending > where you draw the line.) Should we stop before we reach the quantum foam of > spacetime? C

Python, VIM: namespace, scope, life of a python object stuck in a << HERE

2014-11-04 Thread Veek M
If i have two functions: function! foo() python3 << HERE import mylib pass HERE function! bar() python3 << HERE import mylib pass HERE The src says: 1. Python interpreter main program 3. Implementation of the Vim module for Python So, is the python interpreter embedded in vim AND additio

Re: pkcs7 signing

2014-11-04 Thread dieter
Robin Becker writes: > Is there a way to do pkcs7 / 12 signing with python. Have you checked whether "OpenSSL" supports this kind of signing? If it does, then you likely can use this via several Python wrappings for "OpenSSL". -- https://mail.python.org/mailman/listinfo/python-list

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Cameron Simpson
On 04Nov2014 11:24, sohcahto...@gmail.com wrote: On Tuesday, November 4, 2014 10:51:53 AM UTC-8, ast wrote: a écrit dans le message de news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com... On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: >I can't think of any reason why

Re: Code review

2014-11-04 Thread C Smith
>Jean-Michel wrote: >replace > if left_to_act is None: >left_to_act = [] > self.left_to_act = left_to_act >by > self.left_to_act = left_to_act or [] I read that with 2.7 that I had to initialize class variables to immutable types. I think because I was working with the lists before they had

Re: What is the difference between these two? (Assigning functions to variables)

2014-11-04 Thread Cameron Simpson
On 04Nov2014 19:17, Max Nathaniel Ho wrote: Just to be clear, I was referring to these two lines greet = compose_greet_func() greet_someone = greet Please don't top-post. Thanks. Your first assignment: greet = compose_greet_func() _calls_ (runs) the compose_greet_func and assigns its re

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread alex23
On 11/04/2014 08:52 AM, Roberto Martínez wrote: I am trying to replace dinamically the __call__ method of an object using setattr. Example: $ cat testcall.py class A: def __init__(self): setattr(self, '__call__', self.newcall) def __call__(self): print("OLD") d

Re: What is the difference between these two? (Assigning functions to variables)

2014-11-04 Thread Max Nathaniel Ho
Just to be clear, I was referring to these two lines greet = compose_greet_func() greet_someone = greet On Wednesday, November 5, 2014 11:15:46 AM UTC+8, Max Nathaniel Ho wrote: > Example 1 > > def compose_greet_func(): > def get_message(): > return "Hello there!" > > return

What is the difference between these two? (Assigning functions to variables)

2014-11-04 Thread Max Nathaniel Ho
Example 1 def compose_greet_func(): def get_message(): return "Hello there!" return get_message greet = compose_greet_func() print greet() Example 2 def greet(name): return "hello "+name greet_someone = greet print greet_someone("John" In Example 1, the function compoe_

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Chris Angelico
On Wed, Nov 5, 2014 at 1:30 PM, Dennis Lee Bieber wrote: > "machine code" typically implies an instruction set specific to that > machine... ALL computers operate in BINARY logic (a bit only holds 0 or 1). > How you get those bits into the computer is irrelevant. Bah, those zeroes and one

Re: check_output

2014-11-04 Thread Kiuhnm
On Wednesday, November 5, 2014 3:05:32 AM UTC+1, Kiuhnm wrote: > When I call "subprocess.check_output()" I see the console window appear and > disappear very quickly. Is there a way to stop the console from showing up at > all? shell=True does the trick! -- https://mail.python.org/mailman/listi

check_output

2014-11-04 Thread Kiuhnm
When I call "subprocess.check_output()" I see the console window appear and disappear very quickly. Is there a way to stop the console from showing up at all? -- https://mail.python.org/mailman/listinfo/python-list

detect mouse pointer type

2014-11-04 Thread Peter Irbizon
Hello, please how can I detect mouse pointer type? I would like to print every mouse pointer change (arrow, hand, ...) while moving my mouse over screen. How can I do this? (for now I need it for windows, but cross-platform solution is highly appreciated) Many thanks. -- https://mail.python.org/m

Re: simple download manager

2014-11-04 Thread Kiuhnm
On Tuesday, November 4, 2014 4:10:59 PM UTC+1, Kiuhnm wrote: > On Tuesday, November 4, 2014 4:00:51 PM UTC+1, Chris Angelico wrote: > > On Wed, Nov 5, 2014 at 1:53 AM, Kiuhnm wrote: > > > I wish to automate the downloading from a particular site which has some > > > ADs and which requires to clic

Re: Code review

2014-11-04 Thread sohcahtoa82
On Tuesday, November 4, 2014 12:35:32 PM UTC-8, John Gordon wrote: > C Smith writes: > > > I was wondering if I could get some feedback on the biggest thing I > > have done as an amateur Python coder. > > Comments. > > You need a *lot* more comments. > > Like, every line or two of code should

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Theo van Werkhoven
You could go to and get the Altair 8800 or IMSAI 8080 emulator. Run the program and toggle in binary code for these easy to use 8 bit processors. There's a short manual for the IMSAI on the same page and the manual plus instruction s

Re: Idle on Mac issues

2014-11-04 Thread Andrea D'Amore
On 2014-11-04 19:55:00 +, Ned Deily said: […] all Apple 8.5 version have serious bugs that have been fixed upstream. The most serious involves an immediate, unrecoverable crash in Tk when typing a composition character in an edit window or the IDLE shell […] I stand corrected, I wasn't a

Re: Problem adding a Key Value pair

2014-11-04 Thread Anurag Patibandla
On Tuesday, November 4, 2014 2:37:49 PM UTC-5, Anurag Patibandla wrote: > I am trying to add a key value pair of ("Priority":"1") to queue1, > ("Priority":"2") to queue2, and ("Priority":"3") to queue3. > When I just add ("Priority":"1") to queue1, it works. > But when I run the above code, ("Pr

Re: Code review

2014-11-04 Thread John Gordon
C Smith writes: > I was wondering if I could get some feedback on the biggest thing I > have done as an amateur Python coder. Comments. You need a *lot* more comments. Like, every line or two of code should have a comment explaining what is being accomplished. Seriously. Every line or two.

Re: Problem adding a Key Value pair

2014-11-04 Thread MRAB
On 2014-11-04 19:37, Anurag Patibandla wrote: I am trying to add a key value pair of ("Priority":"1") to queue1, ("Priority":"2") to queue2, and ("Priority":"3") to queue3. When I just add ("Priority":"1") to queue1, it works. But when I run the above code, ("Priority":"3") is being added to al

Re: Idle on Mac issues

2014-11-04 Thread Ned Deily
In article , Andrea D'Amore wrote: > On 2014-11-04 12:43:59 +, Rustom Mody said: > > > I seem to be stuck with some issues of Idle on macs. > > The page https://www.python.org/download/mac/tcltk > > seems to talk only of Tcl/Tk versions 8.5 > > System's 8.5 should be enough, if not there's

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Grant Edwards
On 2014-11-04, ast wrote: > > a écrit dans le message de > news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com... > On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: > > >>I can't think of any reason why someone would WANT >>to program in binary/hex machine code. > > It happe

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Ethan Furman
On 11/04/2014 11:23 AM, Nathaniel Smith wrote: (Or alternatively I guess you could go all in: Iä! Iä! Metaclasses Fhtagn!) Metaclasses aren't that bad! I've written one. And the dizzy spells are getting better! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Problem adding a Key Value pair

2014-11-04 Thread Anurag Patibandla
I am trying to add a key value pair of ("Priority":"1") to queue1, ("Priority":"2") to queue2, and ("Priority":"3") to queue3. When I just add ("Priority":"1") to queue1, it works. But when I run the above code, ("Priority":"3") is being added to all the queues. This looks trivial and I don't

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Tobiah
On 11/04/2014 08:45 AM, françai s wrote: I intend to write in lowest level of computer programming as a hobby. It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? What is the lowest level of programming computers that you can wr

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread sohcahtoa82
On Tuesday, November 4, 2014 10:51:53 AM UTC-8, ast wrote: > a écrit dans le message de > news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com... > On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: > > > >I can't think of any reason why someone would WANT > >to program in bi

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Nathaniel Smith
On Tue, Nov 4, 2014 at 7:15 PM, Roberto Martínez wrote: > > > On Tue, Nov 4, 2014 at 8:06 PM, Skip Montanaro > wrote: >> >> >> On Tue, Nov 4, 2014 at 1:01 PM, Roberto Martínez >> wrote: >>> >>> The workaround of calling a different method inside __call__ is not valid >>> for my case because I wa

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Roberto Martínez
On Tue, Nov 4, 2014 at 8:06 PM, Skip Montanaro wrote: > > On Tue, Nov 4, 2014 at 1:01 PM, Roberto Martínez < > robertomartin...@gmail.com> wrote: > >> The workaround of calling a different method inside __call__ is not valid >> for my case because I want to change the *signature* of the function

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Ethan Furman
On 11/04/2014 11:01 AM, Roberto Martínez wrote: (Ethan, sorry for posting to python-dev, I thought that it was an implementation detail of CPython 3.X) No worries. It's good practice to post here first, just in case. ;) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Ethan Furman
On 11/04/2014 11:01 AM, Roberto Martínez wrote: Yikes, I didn't realize the difference in inheritance. The thing with this is tricky. I need the change in the instance, not in the class, because I have multiple instances and all of them must have different implementations of __call__. The work

Re: Code review

2014-11-04 Thread Jean-Michel Pichavant
- Original Message - > From: "C Smith" > To: python-list@python.org > Sent: Tuesday, 4 November, 2014 4:28:33 PM > Subject: Code review > > I was wondering if I could get some feedback on the biggest thing I > have done as an amateur Python coder. The sidepots algorithm isn't > correct ye

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Skip Montanaro
On Tue, Nov 4, 2014 at 1:01 PM, Roberto Martínez wrote: > The workaround of calling a different method inside __call__ is not valid > for my case because I want to change the *signature* of the function also > -for introspection reasons. You could define __call__ like so: def __call__(self, *a

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Roberto Martínez
Yikes, I didn't realize the difference in inheritance. The thing with this is tricky. I need the change in the instance, not in the class, because I have multiple instances and all of them must have different implementations of __call__. The workaround of calling a different method inside __call_

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread ast
a écrit dans le message de news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com... On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: I can't think of any reason why someone would WANT to program in binary/hex machine code. It happens if you design yourself a specialize

Re: generating unique variable name via loops

2014-11-04 Thread Tim Chase
On 2014-11-04 05:53, Fatih Güven wrote: > > > for x in range(1,10): > > > exec("list%d = []" % x) > > > > Why would you do this? > > I have a structured and repetitive data. I want to read a .txt file > line by line and classified it to call easily. For example > employee1 has a name, a salar

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
On Tue, 2014-11-04 at 23:03 +0630, Veek M wrote: > okay got it working - thanks Jason! The 3.2 docs are slightly different. What did you need to do to get it working? -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread Ethan Furman
This list is for the development _of_ Python, not development _with_ Python. Try asking on Python List. (forwarding...) On 11/04/2014 08:52 AM, Roberto Martínez wrote: I am trying to replace dinamically the __call__ method of an object using setattr. Example: $ cat testcall.py class A:

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread sohcahtoa82
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of prog

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread sjmsoft
Grant's statements are correct and his advice is sound. I would not waste my time writing machine code, even as a hobby (and not even if your other hobbies include juggling chain saws). It's too time-consuming, tedious, bug-prone, and eyeglass-prescription-enhancing. Programming in assembly la

pkcs7 signing

2014-11-04 Thread Robin Becker
Is there a way to do pkcs7 / 12 signing with python. I looked at various cryptographic packages, but it's not clear if any of them can do this. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Rustom Mody
On Tuesday, November 4, 2014 10:19:36 PM UTC+5:30, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
okay got it working - thanks Jason! The 3.2 docs are slightly different. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
On Tue, Nov 4, 2014 at 11:09 AM, Veek M wrote: > static PyMethodDef hellomethods[] = { > {"hello", py_hello, METH_VARARGS, py_hello_doc}, > {NULL, NULL, 0, NULL}, > }; > > It's basically the METH_VARARGS field that's giving the problem. Switching > it to NULL gives, > SystemError: Bad cal

Re: generating unique variable name via loops

2014-11-04 Thread Denis McMahon
On Tue, 04 Nov 2014 05:53:04 -0800, Fatih Güven wrote: > Call employee1.name or employee2.salary and assign it to a new variable, > something etc. 1) Put the file into a database. 2) database calls -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-li

Re: generating unique variable name via loops

2014-11-04 Thread Denis McMahon
On Tue, 04 Nov 2014 05:45:04 -0800, Fatih Güven wrote: > 4 Kasım 2014 Salı 15:19:20 UTC+2 tarihinde Veek M yazdı: >> Fatih Güven wrote: >> >> > 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: >> >> I want to generate a unique variable name for list using python. >> >> >> >> list1=.

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
static PyMethodDef hellomethods[] = { {"hello", py_hello, METH_VARARGS, py_hello_doc}, {NULL, NULL, 0, NULL}, }; It's basically the METH_VARARGS field that's giving the problem. Switching it to NULL gives, SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer suppor

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Grant Edwards
On 2014-11-04, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, No. You can write in binary if you want. If I were going to do something like that I'd pick a CPU like a PDP11 with a nice simple, reg

[OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread françai s
I intend to write in lowest level of computer programming as a hobby. It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? What is the lowest level of programming computers that you can write ? Is binary code? Is hex code? Is an

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
Jason Swails wrote: > What operating system are you running this on? It works fine for me on > Linux: Wheezy Debian, Linux deathstar 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux gcc (Debian 4.7.2-5) 4.7.2 Python 3.2.3 I ran it through gdb - not very useful: (gdb) bt #0 0x00

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
On Tue, 2014-11-04 at 21:45 +0630, Veek M wrote: > Jason Swails wrote: > > > I've submitted a PR to your github repo showing you the changes > > necessary to get your module working on my computer. > > Segfaults :p which is an improvement :) What operating system are you running this on? It wor

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
Søren wrote: > import ctypes Hi, yeah i kind of liked it - still reading the docs though, Beazley has the Python.h solution so I though I'd try that first. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
Jason Swails wrote: > I've submitted a PR to your github repo showing you the changes > necessary to get your module working on my computer. Segfaults :p which is an improvement :) open("./_hello.cpython-32mu.so", O_RDONLY) = 5 read(5, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\7\0\0\0

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Fatih Güven wrote: > 4 Kasım 2014 Salı 17:01:17 UTC+2 tarihinde Peter Otten yazdı: >> Fatih Güven wrote: >> >> > 4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: >> >> Veek M wrote: >> >> >> >> > Fatih Güven wrote: >> >> > >> >> >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih G

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 17:01:17 UTC+2 tarihinde Peter Otten yazdı: > Fatih Güven wrote: > > > 4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: > >> Veek M wrote: > >> > >> > Fatih Güven wrote: > >> > > >> >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: > >> >>> I want to

Code review

2014-11-04 Thread C Smith
I was wondering if I could get some feedback on the biggest thing I have done as an amateur Python coder. The sidepots algorithm isn't correct yet, but I haven't worked on it in a while and thought I would get some advice before diving back in. import random, os ###

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Søren
I'm not sure if it fits your needs, but we are very happy with calling c libs directly from python using ctypes: https://docs.python.org/2/library/ctypes.html It requires a few extra lines in Python to handle the parameter and return types. import ctypes result = ctypes.windll.Hello.hello()

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
On Tue, 2014-11-04 at 16:22 +0630, Veek M wrote: > https://github.com/Veek/Python/tree/master/junk/hello > doesn't work. > I have: > hello.c which contains: int hello(void); > hello.h > > To wrap that up, i have: > hello.py -> _hello (c extension) -> pyhello.c -> method py_hello() > > People usin

Re: simple download manager

2014-11-04 Thread Kiuhnm
On Tuesday, November 4, 2014 4:00:51 PM UTC+1, Chris Angelico wrote: > On Wed, Nov 5, 2014 at 1:53 AM, Kiuhnm wrote: > > I wish to automate the downloading from a particular site which has some > > ADs and which requires to click on a lot of buttons before the download > > starts. > > > > What l

Re: generating unique variable name via loops

2014-11-04 Thread Matthew Ruffalo
Hi- Questions like this appear so often in various places (mailing lists, forums, sites like Stack Overflow) that I think a very blunt/candid answer is appropriate. This is especially true since there's always someone who responds to the question as-is with some monstrosity of exec() and string fo

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Fatih Güven wrote: > 4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: >> Veek M wrote: >> >> > Fatih Güven wrote: >> > >> >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: >> >>> I want to generate a unique variable name for list using python. >> >>> >> >>> list1=...

Re: simple download manager

2014-11-04 Thread Chris Angelico
On Wed, Nov 5, 2014 at 1:53 AM, Kiuhnm wrote: > I wish to automate the downloading from a particular site which has some ADs > and which requires to click on a lot of buttons before the download starts. > > What library should I use to handle HTTP? > Also, I need to support big files (> 1 GB) so

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Chris Angelico
On Tue, Nov 4, 2014 at 8:52 PM, Veek M wrote: > https://github.com/Veek/Python/tree/master/junk/hello > doesn't work. > I have: > hello.c which contains: int hello(void); > hello.h > > To wrap that up, i have: > hello.py -> _hello (c extension) -> pyhello.c -> method py_hello() > > People using th

simple download manager

2014-11-04 Thread Kiuhnm
I wish to automate the downloading from a particular site which has some ADs and which requires to click on a lot of buttons before the download starts. What library should I use to handle HTTP? Also, I need to support big files (> 1 GB) so the library should hand the data to me chunk by chunk.

Re: fill, expand from tkinter.pack() layout manager

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 16:16:52 UTC+2 tarihinde ast yazdı: > Hi > > I dont really understood how "fill" and "expand" > works with layout manager tkinter.pack() > > Example: > > from tkinter import * > root = Tk() > w = Label(root, text="Red", bg="red", fg="white") > w.pack(side=LEFT, fill = BOTH) >

Re: generating unique variable name via loops

2014-11-04 Thread Jean-Michel Pichavant
- Original Message - > From: "Fatih Güven" > I have a structured and repetitive data. I want to read a .txt file > line by line and classified it to call easily. For example employee1 > has a name, a salary, shift, age etc. and employee2 and other 101 > employee have all of it. > > Call e

Re: fill, expand from tkinter.pack() layout manager

2014-11-04 Thread ast
"ast" a écrit dans le message de news:5458dfc6$0$27505$426a7...@news.free.fr... w.pack(side=LEFT, fill = BOTH) Why is the label "w" only extended vertically and not horizontally too ? with: w.pack(side=TOP, fill = BOTH) it expand horizontally but not vertically with: w.pack(side=LEFT, fil

fill, expand from tkinter.pack() layout manager

2014-11-04 Thread ast
Hi I dont really understood how "fill" and "expand" works with layout manager tkinter.pack() Example: from tkinter import * root = Tk() w = Label(root, text="Red", bg="red", fg="white") w.pack(side=LEFT, fill = BOTH) Here is the result: http://cjoint.com/?0Kepj1E3Tv3 Why is the label "w" onl

Re: Dictionaries with variable default.

2014-11-04 Thread Cousin Stanley
> So How should I call this: > > class ...dict(dict): > def __init__(self, fun): > self.fun = fun > > def __missing__(self, key): > return self.fun(key) I don't know how you should, but I tried the following which seems to work class KeyPlusOne( dict ) : def __

Re: generating unique variable name via loops

2014-11-04 Thread Veek M
Fatih Güven wrote: > This is okay but i can't use the method ".append" for example > list1.append("abc") works for me -- https://mail.python.org/mailman/listinfo/python-list

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: > Veek M wrote: > > > Fatih Güven wrote: > > > >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: > >>> I want to generate a unique variable name for list using python. > >>> > >>> list1=... > >>> list2=... > > > > for

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 15:19:20 UTC+2 tarihinde Veek M yazdı: > Fatih Güven wrote: > > > 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: > >> I want to generate a unique variable name for list using python. > >> > >> list1=... > >> list2=... > > for x in range(1,10): > exec("list%d

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Veek M wrote: > Fatih Güven wrote: > >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: >>> I want to generate a unique variable name for list using python. >>> >>> list1=... >>> list2=... > > for x in range(1,10): > exec("list%d = []" % x) Why would you do this? -- https

Re: Dictionaries with variable default.

2014-11-04 Thread Antoon Pardon
Op 03-11-14 om 12:09 schreef Chris Angelico: > On Mon, Nov 3, 2014 at 10:04 PM, Antoon Pardon > wrote: >> Is it possible to have a default dictionary where the default is dependant >> on the key? >> >> I was hoping something like this might work: > m = defaultdict(lambda key: key+1) >> But it

Re: Idle on Mac issues

2014-11-04 Thread Andrea D'Amore
On 2014-11-04 12:43:59 +, Rustom Mody said: I seem to be stuck with some issues of Idle on macs. The page https://www.python.org/download/mac/tcltk seems to talk only of Tcl/Tk versions 8.5 System's 8.5 should be enough, if not there's explicit mention of the ActiveTcl distribution. Ma

Re: generating unique variable name via loops

2014-11-04 Thread Veek M
Fatih Güven wrote: > 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: >> I want to generate a unique variable name for list using python. >> >> list1=... >> list2=... for x in range(1,10): exec("list%d = []" % x) -- https://mail.python.org/mailman/listinfo/python-list

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Fatih Güven wrote: > I want to generate a unique variable name for list using python. > > list1=... > list2=... > . > . > . > listx=... where x is a number. > > You can remember it from saving a file in a directory. If you have already > created a "new file", save dialog sugget that <<"new file

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 13:29:34 UTC+2 tarihinde Fatih Güven yazdı: Editted: Grammar revision. > Hi, > > I want to generate a unique variable name for list using python. > > list1=... > list2=... > . > . > . > listx=... where x is a number. > > You can remember it from saving a file in a directory. If

Idle on Mac issues

2014-11-04 Thread Rustom Mody
I seem to be stuck with some issues of Idle on macs. The page https://www.python.org/download/mac/tcltk seems to talk only of Tcl/Tk versions 8.5 Macports seem to have at 8.6 https://www.macports.org/ports.php?by=library&substr=tcl With a direct download of Tcl/Tk there are some security warnings

generating unique variable name via loops

2014-11-04 Thread Fatih Güven
Hi, I want to generate a unique variable name for list using python. list1=... list2=... . . . listx=... where x is a number. You can remember it from saving a file in a directory. If you have already created a "new file", save dialog sugget that <<"new file " is already exist, do you want to

Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
https://github.com/Veek/Python/tree/master/junk/hello doesn't work. I have: hello.c which contains: int hello(void); hello.h To wrap that up, i have: hello.py -> _hello (c extension) -> pyhello.c -> method py_hello() People using this will do: python3.2>> import hello python3.2>> hello.hello() I