Re: [Tutor] Get the structure values from a c file

2012-12-17 Thread Alan Gauld
On 17/12/12 03:12, Marefe Serentas wrote: I want to create a python script that will store the value of the structure /MainStruct/ from the c file. You will need to be a lot more specific about your requirements. A structure is a data definition, it does not have a value. It is like saying you

Re: [Tutor] Limitation of int() in converting strings

2012-12-17 Thread Alan Gauld
On 17/12/12 04:19, boB Stepp wrote: It is apparent that int() does not like strings with floating-point formats. None of my books (as far as my flipping can tell) or the below built-in help clarify this: ... Of course if I type int(float('10.0')) I get the desired 10 . as indeed will int(10.0

Re: [Tutor] Get the structure values from a c file

2012-12-17 Thread eryksun
On Sun, Dec 16, 2012 at 10:12 PM, Marefe Serentas wrote: > > I want to create a python script that will store the value of the structure > MainStruct from the c file. Try pycparser to parse C source code. To load a library and call its functions you can use ctypes. http://docs.python.org/2/libr

[Tutor] ssh connection

2012-12-17 Thread Ufuk Eskici
Hello All, Can we make an SSH connection with Pyhton 3.3 ? I want to connecto to my router, send commands and receive outputs. Thanks. Ufuk ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/ma

Re: [Tutor] ssh connection

2012-12-17 Thread Tom Tucker
One option is PyExpect http://www.noah.org/python/pexpect/ On Mon, Dec 17, 2012 at 8:40 AM, Ufuk Eskici wrote: > Hello All, > > Can we make an SSH connection with Pyhton 3.3 ? > > I want to connecto to my router, send commands and receive outputs. > > Thanks. > Ufuk > > __

Re: [Tutor] Limitation of int() in converting strings

2012-12-17 Thread Oscar Benjamin
On 17 December 2012 08:55, Alan Gauld wrote: > > On 17/12/12 04:19, boB Stepp wrote: > >> It is apparent that int() does not like strings with floating-point >> formats. None of my books (as far as my flipping can tell) or the >> below built-in help clarify this: >> ... >> >> Of course if I type i

Re: [Tutor] Limitation of int() in converting strings

2012-12-17 Thread eryksun
On Mon, Dec 17, 2012 at 3:55 AM, Alan Gauld wrote: > > So you are right, there is an inconsistency between how int() converts > floating point numbers and how it converts strings. Even stranger since the > underlying atoi() C function appears to handle float strings quite > happily... If you're u

Re: [Tutor] ssh connection

2012-12-17 Thread Brad Hudson
Look at the subprocess module. You can send your SSH connections via subprocess and collect the output for parsing. On Mon, Dec 17, 2012 at 7:40 AM, Ufuk Eskici wrote: > Hello All, > > Can we make an SSH connection with Pyhton 3.3 ? > > I want to connecto to my router, send commands and receive

Re: [Tutor] Limitation of int() in converting strings

2012-12-17 Thread Alan Gauld
On 17/12/12 14:36, Oscar Benjamin wrote: > Even stranger since the underlying atoi() C function Also, are you sure that atoi() is used in CPython? Nope, just making assumptions! :-0 As Eryksun points out Python uses its own C code for this. assume == ass u me :-( -- Alan G Author of the

Re: [Tutor] ssh connection

2012-12-17 Thread Prasad, Ramit
Ufuk Eskici wrote: > > Hello All, > > Can we make an SSH connection with Pyhton 3.3 ? > > I want to connecto to my router, send commands and receive outputs. > > Thanks. > Ufuk You can try to use Paramiko. You may need to build it and it seems like it may work except for SFTP. https://github

Re: [Tutor] Image Processing

2012-12-17 Thread Eike Welk
Hello Ashkan! On Saturday 15.12.2012 23:20:31 Ashkan Rahmani wrote: > I have developed some simple c++/qt/opencv application with face > detection functionality. > for some reasons I'm going to start again them and I wan to use python 3. > Unfortunately I found opencv not supported in python 3. >

Re: [Tutor] ssh connection

2012-12-17 Thread Prasad, Ramit
Please always include the list in your response (I have CC-ed the list). Ufuk Eskici wrote: > > Subprocess seems complicated, didnt understand. > > Also tried pexpect but couldnt install on Windows. Subprocess can be daunting to try and pick up, but it is not as bad as it looks at first glance.

Re: [Tutor] Limitation of int() in converting strings

2012-12-17 Thread eryksun
On Mon, Dec 17, 2012 at 1:00 PM, Alan Gauld wrote: > > Python uses its own C code for this. The important point here is that they use the strtol/strtod interface, however it's implemented. atoi and atof lack the end pointer argument that enables raising a ValueError for an incomplete conversion.

Re: [Tutor] Tutor Digest, Vol 106, Issue 42

2012-12-17 Thread Marefe Serentas
On 12/18/2012 12:38 AM, tutor-requ...@python.org wrote: Re: Get the structure values from a c file I apologize for some syntax errors in my c file. I would like to correct my mistakes and append some lines in the c file to make it clearer. #define max (3) #define max_data_size (9600*2*8)

Re: [Tutor] Get the structure values from a c file

2012-12-17 Thread Marefe Serentas
On 12/18/2012 12:38 AM, tutor-requ...@python.org wrote: Re: Get the structure values from a c file I apologize for some syntax errors in my c file. I would like to correct my mistakes and append some lines in the c file to make it clearer. #define max (3) #define max_data_size (9600*2*8)

Re: [Tutor] Image Processing

2012-12-17 Thread Ashkan Rahmani
Hello Eike, Thank you for reply... On Tue, Dec 18, 2012 at 1:09 AM, Eike Welk wrote: > Hello Ashkan! > > > On Saturday 15.12.2012 23:20:31 Ashkan Rahmani wrote: >> I have developed some simple c++/qt/opencv application with face >> detection functionality. >> for some reasons I'm going to start a

Re: [Tutor] Tutor Digest, Vol 106, Issue 42

2012-12-17 Thread Peter Otten
Marefe Serentas wrote: > On 12/18/2012 12:38 AM, tutor-requ...@python.org wrote: >> Re: Get the structure values from a c file > I apologize for some syntax errors in my c file. I would like to correct > my mistakes and append some lines in the c file to make it clearer. > > > > #define max