Re: How to tick checkboxes with the same name?

2013-07-26 Thread Peter Otten
malay...@gmail.com wrote: > вторник, 23 июля 2013 г., 11:25:00 UTC+4 пользователь Peter Otten написал: >> malay...@gmail.com wrote: >> For all but the most popular projects a url works wonders. I'm assuming >> http://grablib.org > Well, I have read the documentation, I guess the problem lies in

Newbie: Python 3 and web applications?

2013-07-26 Thread Rui Maciel
I'm currently learning Python, and I've been focusing on Python3. To try to kill two birds with one stone, I would also like to learn the basics of writing small web applications. These web applications don't need to do much more than provide an interface to a small database, and they may no

Re: Hello Everyone! A simple questions!

2013-07-26 Thread Florian Baumgartner
As alex23 already indicated you created a recursive data-structure (by inserting a reference to the list into the second place of the list) and the interpreter handles this gracefully by showing [...]. In case you really want to insert the lists members into the second place you can assign a copy

Re: embedded python and threading

2013-07-26 Thread Stefan Behnel
David M. Cotter, 26.07.2013 08:15: > in my app i initialize python on the main thread, then immediately call > PyEval_SaveThread() because i do no further python stuff on the main thread. > > then, for each script i want to run, i use boost::threads to create a new > thread, then on that thread

Re: Python Script Hashplings

2013-07-26 Thread Devyn Collier Johnson
On 07/25/2013 09:54 AM, MRAB wrote: On 25/07/2013 14:42, Devyn Collier Johnson wrote: If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) and Python3.3 is not installed, but Python3.2 is installed, would the script still work? Would it fall back to Python3.2? Why don't you

Re: Critic my module

2013-07-26 Thread Devyn Collier Johnson
On 07/25/2013 09:58 AM, Schneider wrote: Hi, nice idea. mybe - for security reasons - you should ensure, that the right tool is called and not some tool put the path with the same name. bg, Johannes On Thu 25 Jul 2013 03:24:30 PM CEST, Devyn Collier Johnson wrote: Aloha Python Users!

Re: Python Script Hashplings

2013-07-26 Thread Devyn Collier Johnson
On 07/25/2013 10:01 AM, Matthew Lefavor wrote: The answer is "probably not." If you just want to use the latest version of Python 3 you have installed on your system, use: "#!/usr/bin/python3". When you use the specific minor version numbers, they point to that specific minor version. Actual

Re: Python Script Hashplings

2013-07-26 Thread Chris Angelico
On Fri, Jul 26, 2013 at 11:37 AM, Devyn Collier Johnson wrote: > > On 07/25/2013 09:54 AM, MRAB wrote: >> >> On 25/07/2013 14:42, Devyn Collier Johnson wrote: >>> >>> If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) >>> and Python3.3 is not installed, but Python3.2 is instal

Re: Python Script Hashplings

2013-07-26 Thread Tim Golden
On 26/07/2013 11:37, Devyn Collier Johnson wrote: > > On 07/25/2013 09:54 AM, MRAB wrote: >> On 25/07/2013 14:42, Devyn Collier Johnson wrote: >>> If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) >>> and Python3.3 is not installed, but Python3.2 is installed, would the >>> s

Re: Critic my module

2013-07-26 Thread Devyn Collier Johnson
On 07/25/2013 10:09 AM, Alain Ketterlin wrote: Devyn Collier Johnson writes: I made a Python3 module that allows users to use certain Linux shell commands from Python3 more easily than using os.system(), subprocess.Popen(), or subprocess.getoutput(). This module (once placed with the othe

Re: virtualenv problem

2013-07-26 Thread D. Xenakis
Yeah trying to run virtualenv under IDLE was a desperate move as i couldnt make anything work under cmd. Apparently my problem was that i did not have correctly setup the new path.. Solution for me was the following from "http://forums.udacity.com/questions/100064678/pip-installation-instructi

Re: RE Module Performance

2013-07-26 Thread wxjmfauth
Le jeudi 25 juillet 2013 22:45:38 UTC+2, Ian a écrit : > On Thu, Jul 25, 2013 at 12:18 PM, Steven D'Aprano > > wrote: > > > On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote: > > > > > >> On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano > > >> wrote: > > >>> On Thu, 25 Jul 2013 14:36

Re: RE Module Performance

2013-07-26 Thread wxjmfauth
Le vendredi 26 juillet 2013 05:09:34 UTC+2, Michael Torrie a écrit : > On 07/25/2013 11:18 AM, Steven D'Aprano wrote: > > > JMF has explained that it is impossible, impossible I say!, to write an > > > editor using a flexible string representation. Since Emacs uses such a > > > flexible string

Re: PyGLet, 2to3...?

2013-07-26 Thread Jerry Hill
On Thu, Jul 25, 2013 at 7:49 PM, John Ladasky wrote: > === > > john@john:~/Desktop/pyglet-1.2alpha1$ sudo python3 setup.py install > > [sudo] password for john: > > running install > running build > running build_py > running install_lib > running install_egg_in

Re: RE Module Performance

2013-07-26 Thread wxjmfauth
Le vendredi 26 juillet 2013 05:20:45 UTC+2, Ian a écrit : > On Thu, Jul 25, 2013 at 8:48 PM, Steven D'Aprano > > wrote: > > > UTF-8 uses a flexible representation on a character-by-character basis. > > > When parsing UTF-8, one needs to look at EVERY character to decide how > > > many bytes yo

Re: Python Script Hashplings

2013-07-26 Thread MRAB
On 26/07/2013 11:43, Chris Angelico wrote: On Fri, Jul 26, 2013 at 11:37 AM, Devyn Collier Johnson wrote: On 07/25/2013 09:54 AM, MRAB wrote: On 25/07/2013 14:42, Devyn Collier Johnson wrote: If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) and Python3.3 is not insta

RE: Creating a Simple User Interface for a Function

2013-07-26 Thread Prasad, Ramit
CTSB01 wrote: > On Thursday, July 25, 2013 3:19:27 PM UTC-4, Dave Angel wrote: > > On 07/25/2013 12:03 PM, CTSB01 wrote: > > > > > I have the following code that runs perfectly: > > > > > > > def psi_j(x, j): > > > > >rtn = [] > > > > >for n2 in range(0, len(x) * j - 2

Re: Python Script Hashplings

2013-07-26 Thread Chris Angelico
On Fri, Jul 26, 2013 at 2:53 PM, MRAB wrote: > If you want to test what would happen if that version wasn't installed, > set the shebang line to a future version, such as Python 3.4. I doubt > you have that installed! :-) Be careful, some people DO have a python3.4 binary :) Go for 3.5 for a bit

Re: Newbie: Python 3 and web applications?

2013-07-26 Thread John Gordon
In Rui Maciel writes: > I'm currently learning Python, and I've been focusing on Python3. To try to > kill two birds with one stone, I would also like to learn the basics of > writing small web applications. > These web applications don't need to do much more than provide an interface > t

Re: PyGLet, 2to3...?

2013-07-26 Thread Kushal Kumaran
John Ladasky writes: > On Thursday, July 25, 2013 3:26:01 PM UTC-7, John Ladasky wrote: >> I'll try again from scratch, and see whether that clears up my problems. > > Nope, that didn't work. > > === > > john@john:~/Desktop/pyglet-1.2alpha1$ sudo python3 setup.

Re: Python Script Hashplings

2013-07-26 Thread Matthew Lefavor
> > > Thanks Matthew Lefavor! But specifically, why use "#!/usr/bin/env python3" > instead of "#!/usr/bin/python3"? > The "env" program looks up its argument in the current $PATH environment variable, and then executes that. This means you aren't necessarily tied to /usr/bin/python3. It makes thin

Re: Critic my module

2013-07-26 Thread Alister
> > The main point of this is for shell users that are using Python and do > not know some of the Python commands. This module would make Python more > like a Linux shell. For instance, a shell user would type boash.uname() > because they may not know they can type "import platform; > platform.una

RE: Python Script Hashplings

2013-07-26 Thread Prasad, Ramit
Devyn Collier Johnson wrote: > Thanks Matthew Lefavor! But specifically, why use "#!/usr/bin/env python3" > instead of > "#!/usr/bin/python3"? > > Mahalo, > > DCJ I believe this will work on Windows for Python 3.3+ and also with virtualenv. https://pypi.python.org/pypi/virtualenv Virtualenv i

Re: RE Module Performance

2013-07-26 Thread wxjmfauth
Le vendredi 26 juillet 2013 05:20:45 UTC+2, Ian a écrit : > On Thu, Jul 25, 2013 at 8:48 PM, Steven D'Aprano > > wrote: > > > UTF-8 uses a flexible representation on a character-by-character basis. > > > When parsing UTF-8, one needs to look at EVERY character to decide how > > > many bytes yo

Re: how to package embedded python?

2013-07-26 Thread David M. Cotter
does nobody know how to do this? does nobody know where proper documentation on this is? -- http://mail.python.org/mailman/listinfo/python-list

Re: embedded python and threading

2013-07-26 Thread David M. Cotter
okay, i have simplified it: here is the code == import time def main(): while True: print "i'm alive" time.sleep(0.25) #- if __name__ == "__main__": main() ===

Re: embedded python and threading

2013-07-26 Thread David Robinow
Works for me. Except that if I then do: touch time.py I get the same error as you do. Can you figure out the problem now? On Fri, Jul 26, 2013 at 11:57 AM, David M. Cotter wrote: > okay, i have simplified it: here is the code > > == > import time > > d

Re: embedded python and threading

2013-07-26 Thread John Gordon
In <965b463e-e5bf-4ccd-9a3c-b0cb964b3...@googlegroups.com> "David M. Cotter" writes: > == > 9: Traceback (most recent call last): > 9: File "", line 10, in ? > 9: File "", line 6, in main > 9: AttributeError: 'builtin_function_or_method

Re: Critic my module

2013-07-26 Thread Joshua Landau
On 26 July 2013 16:08, Alister wrote: > > > > The main point of this is for shell users that are using Python and do > > not know some of the Python commands. This module would make Python more > > like a Linux shell. For instance, a shell user would type boash.uname() > > because they may not kn

Re: embedded python and threading

2013-07-26 Thread David M. Cotter
no, there is no "time.py" anywhere (except perhaps as the actual python library originally imported) did you understand that the function works perfectly, looping as it should, up until the time i run a second script on a separate thread? -- http://mail.python.org/mailman/listinfo/python-list

Re: embedded python and threading

2013-07-26 Thread David M. Cotter
DOH! as my second thread, i had been using a sample script that i had copy-pasted without much looking at it. guess what? it prints the time. and yes, it did "from time import time", which explains it all. thanks for the hints here, that helped me figure it out! -- http://mail.python.org/mai

Re: embedded python and threading

2013-07-26 Thread Stefan Behnel
David M. Cotter, 26.07.2013 19:28: > DOH! as my second thread, i had been using a sample script that i had > copy-pasted without much looking at it. guess what? it prints the time. and > yes, it did "from time import time", which explains it all. Ah, and you were using the same globals dict f

dump a multi dimensional dictionary

2013-07-26 Thread cerr
Hi, Can I somehow use pickle.dump() to store a dictionary of lists to a file? I tried this: >>> import pickle >>> mylist = [] >>> mydict = {} >>> mylist = '1','2' >>> mydict['3'] = mylist >>> fhg = open ("test", 'w') >>> pickle.dump(fhg,mydict) Traceback (most rece

Re: dump a multi dimensional dictionary

2013-07-26 Thread John Gordon
In cerr writes: > Can I somehow use pickle.dump() to store a dictionary of lists to a file? > I tried this: > >>> import pickle > >>> mylist = [] > >>> mydict = {} > >>> mylist = '1','2' > >>> mydict['3'] = mylist > >>> fhg = open ("test", 'w') > >>> pickle.dump(fhg

RE: dump a multi dimensional dictionary

2013-07-26 Thread Prasad, Ramit
cerr wrote: > Hi, > > Can I somehow use pickle.dump() to store a dictionary of lists to a file? > I tried this: > > >>> import pickle > >>> mylist = [] > >>> mydict = {} > >>> mylist = '1','2' > >>> mydict['3'] = mylist > >>> fhg = open ("test", 'w') > >>> pickle.dump(

Re: Python Script Hashplings

2013-07-26 Thread Ben Finney
Tim Golden writes: > Devyn, I'm not a *nix person so someone can point out if I'm wrong, > but my understanding is that the shebang line (or whatever you want to > call it) just tells the shell: run this command to run this file. So > you can put "#!/usr/bin/fish-and-chips" as the first line and

Re: Python Script Hashplings

2013-07-26 Thread Devyn Collier Johnson
On 07/26/2013 10:14 AM, Chris Angelico wrote: On Fri, Jul 26, 2013 at 2:53 PM, MRAB wrote: If you want to test what would happen if that version wasn't installed, set the shebang line to a future version, such as Python 3.4. I doubt you have that installed! :-) Be careful, some people DO have

Re: dump a multi dimensional dictionary

2013-07-26 Thread Chris Angelico
On Fri, Jul 26, 2013 at 9:21 PM, cerr wrote: > >>> mylist = [] > >>> mydict = {} > >>> mylist = '1','2' Side point: mylist is no longer a list, it's a tuple. I don't think pickle has problems with tuples, but it's worth noting that difference. ChrisA -- http://mail.python.org/mailm

Re: PyGLet, 2to3...?

2013-07-26 Thread John Ladasky
On Thursday, July 25, 2013 4:49:16 PM UTC-7, John Ladasky wrote: > On Thursday, July 25, 2013 3:26:01 PM UTC-7, John Ladasky wrote: > > > I'll try again from scratch, and see whether that clears up my problems. > > Nope, that didn't work. Thanks to both Jerry and Kushal. You were right, I was d

Re: PyGLet, 2to3...?

2013-07-26 Thread John Ladasky
I'm making progress, but I'm not out of the woods yet. I'm trying to run some of the programs from the tutorial web pages, and from the pyglet1.2alpha1/examples directory. I've realized that I will probably need to run 2to3 on the many of the latter. The Hello, World example runs. http://ww

Re: RE Module Performance

2013-07-26 Thread Michael Torrie
On 07/26/2013 07:21 AM, wxjmfa...@gmail.com wrote: sys.getsizeof('––') - sys.getsizeof('–') > > I have already explained / commented this. Maybe it got lost in translation, but I don't understand your point with that. > Hint: To understand Unicode (and every coding scheme), you should > und

Re: Critic my module

2013-07-26 Thread Steven D'Aprano
As requested, some constructive criticism of your module. On Thu, 25 Jul 2013 09:24:30 -0400, Devyn Collier Johnson wrote: > #!/usr/bin/python3 > #Made by Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS What's NCLA, Linux+, LPIC-1, DCTS? Do these mean anything? Are we supposed to know what th

Re: dump a multi dimensional dictionary

2013-07-26 Thread Steven D'Aprano
On Fri, 26 Jul 2013 13:21:47 -0700, cerr wrote: > or should I just write my own dump function that can hanle thiS? > > Please advise! Given the choice between reading the documentation to pickle.dump: help(pickle.dump) or spending the next month writing a replacement for pickle, testing it,

Re: RE Module Performance

2013-07-26 Thread Steven D'Aprano
On Thu, 25 Jul 2013 21:20:45 -0600, Ian Kelly wrote: > On Thu, Jul 25, 2013 at 8:48 PM, Steven D'Aprano > wrote: >> UTF-8 uses a flexible representation on a character-by-character basis. >> When parsing UTF-8, one needs to look at EVERY character to decide how >> many bytes you need to read. In

Re: Help

2013-07-26 Thread tyler
Thank you everybody who replied. The problem is fixed now and the program is running correctly. I will also try to use your suggestions in the future to make sure I don't make the same mistake. Thanks again :). -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGLet, 2to3...?

2013-07-26 Thread John Ladasky
On Friday, July 26, 2013 6:19:48 PM UTC-7, John Ladasky wrote: > I'm making progress, but I'm not out of the woods yet. And while I appreciate any comments that may appear here, I've just found the pyglet-users group... https://groups.google.com/forum/#!forum/pyglet-users ...so that's probably

Re: RE Module Performance

2013-07-26 Thread Ian Kelly
On Fri, Jul 26, 2013 at 9:37 PM, Steven D'Aprano wrote: > See the similarity now? Both flexibly change the width used by code- > points, UTF-8 based on the code-point itself regardless of the rest of > the string, Python based on the largest code-point in the string. No, I think we're just using

Re: RE Module Performance

2013-07-26 Thread Steven D'Aprano
On Fri, 26 Jul 2013 22:12:36 -0600, Ian Kelly wrote: > On Fri, Jul 26, 2013 at 9:37 PM, Steven D'Aprano > wrote: >> See the similarity now? Both flexibly change the width used by code- >> points, UTF-8 based on the code-point itself regardless of the rest of >> the string, Python based on the lar

Best python web framework to build university/academic website

2013-07-26 Thread b . krishna2020
Hi, I got a chance to build an university website, within very short period of time. I know web2py, little bit of Django, so please suggest me the best to build rapidly. Thanks in advance Raghu -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-26 Thread Steven D'Aprano
On Fri, 26 Jul 2013 08:46:58 -0700, wxjmfauth wrote: > BTW, I'm pleased to read "sequence of bits" and not bytes. Again, utf > transformers are producing sequence of bits, call Unicode Transformation > Units, with lengths of 8/16/32 *bits*, from there the names utf8/16/32. > UCS transformers are (