Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: short way to combine tuples and int's
Post: RE: short way to combine tuples and int's

Thanks! Yeah, that is what I'm thinking, I guess I can try to find the int element in m, convert it to a tuple in m, then flatten the multi dimensional tuple
Annie General Coding Help 6 4,558 Jun-16-2017, 02:35 AM
    Thread: short way to combine tuples and int's
Post: RE: short way to combine tuples and int's

Hmm... Would one if statement be enough? there are three possibilities and they all need different treatment to get the desired result, right ? I mean something like (1,2,3,4,5) Just asking if there ...
Annie General Coding Help 6 4,558 Jun-16-2017, 02:17 AM
    Thread: short way to combine tuples and int's
Post: RE: short way to combine tuples and int's

Thank you! But what if I want (4,5) to be unpacked in the result ? so (1,4,5) instead of (1,(4,5))
Annie General Coding Help 6 4,558 Jun-16-2017, 01:52 AM
    Thread: short way to combine tuples and int's
Post: short way to combine tuples and int's

if I have four kinds of data like l1 = 1   #int l0 = 8   #int l2 = 2,3 #tuple l3 = 4,5 #tupleIs there an elegant single method to combine any two of these data and return a flattened tuple for examp...
Annie General Coding Help 6 4,558 Jun-16-2017, 12:42 AM
    Thread: Location of python library ?
Post: RE: Location of python library ?

Not quite sure what you mean but I didn't find a library file with extension .so. Mostly something like this: ... Error:cint/reflex/src/Union.o cint/reflex/src/UnionBuilder.o cint/reflex/src/Variabl...
Annie General Coding Help 17 15,718 Mar-24-2017, 03:46 AM
    Thread: Location of python library ?
Post: RE: Location of python library ?

... I don't quiet understand what you said since I don't have much professional knowledge about these things. Of course I have Python installed... What do you mean by "using the system python installa...
Annie General Coding Help 17 15,718 Mar-24-2017, 02:37 AM
    Thread: Location of python library ?
Post: RE: Location of python library ?

Yes, I tried and it crashed... The package is called ROOT, like a data analysis framework.Here is the website: https://root.cern.ch And I'm trying to follow the instruction from here: https://root.c...
Annie General Coding Help 17 15,718 Mar-22-2017, 09:39 PM
    Thread: Location of python library ?
Post: RE: Location of python library ?

Thank you again. I'm trying to install a package(written in C++) to include Python extension in ./configure stage, The user manual asks me to add a flag --with-python-libdir whit this explanation: ...
Annie General Coding Help 17 15,718 Mar-22-2017, 06:56 PM
    Thread: Location of python library ?
Post: RE: Location of python library ?

Hi, thank you for your patience This time I did find something similar but I don't have a libpython3.5.so file I have a libpython3.5.dylib file. Maybe they represent the same thing?
Annie General Coding Help 17 15,718 Mar-22-2017, 08:34 AM
    Thread: Location of python library ?
Post: RE: Location of python library ?

...Thank you but I got absolutely nothing (or nothing meaningful)after trying all sorts of combinations according to what you said. Is it possible that I simply don't have that file even if I have Pyt...
Annie General Coding Help 17 15,718 Mar-22-2017, 02:07 AM
    Thread: Location of python library ?
Post: RE: Location of python library ?

Hi, Yes I'm using OSX. that is what I did before but I got this: find: /Users/kumakenkoji/Library/Saved Application State/com.adobe.flashplayer.installmanager.savedState: Permission denied find: /Us...
Annie General Coding Help 17 15,718 Mar-22-2017, 12:08 AM
    Thread: Location of python library ?
Post: Location of python library ?

Hi, How do I find the directory of libpython3.5.so file in my local machine, am I suppose to have this file if I have downloaded Python3.5 ? I'm using anaconda distribution by the way.
Annie General Coding Help 17 15,718 Mar-21-2017, 11:18 PM
    Thread: Importing module from outside of the current directory
Post: RE: Importing module from outside of the current d...

Thank you, I believe that is a program. I think there is a way to set up that in the package I'm using.
Annie General Coding Help 4 4,573 Mar-21-2017, 11:13 PM
    Thread: Importing module from outside of the current directory
Post: RE: Importing module from outside of the current d...

Thank you, yeah, of course it's not possible...directly. There is something I didn't set up correctly.
Annie General Coding Help 4 4,573 Mar-19-2017, 01:26 AM
    Thread: Importing module from outside of the current directory
Post: Importing module from outside of the current direc...

Hi guys, If I'm in say /home/a and I want to import a module name "file.h"  in   /home/b/c/d I tried : import sys sys.path.insert(0, '/home/b/c/d')but when I did import file.hIt still says no modu...
Annie General Coding Help 4 4,573 Mar-17-2017, 10:31 PM
    Thread: dictionary, list and iteration
Post: RE: dictionary, list and iteration

Thanks a lot !
Annie General Coding Help 2 3,755 Jan-08-2017, 10:44 AM
    Thread: dictionary, list and iteration
Post: dictionary, list and iteration

a = {7: 0.1, 8: 0.2, 11: 0.1, 12:0.2, 13:0.1, 14: 0.2} b = [   100,              200,             300 ] c = {}expected result  c = {7: 100,         11:200,          13:300} I want to replace ...
Annie General Coding Help 2 3,755 Jan-08-2017, 09:50 AM
    Thread: having dictionary and list to iterate in for loop
Post: RE: having dictionary and list to iterate in for l...

the error message is like too many things to unpack Sorry should have used [] for list, Oh, this seems cute, so the enumerate method turns the keys into something like [0: key0, 1: key1, 2: key2...]?
Annie General Coding Help 5 5,395 Jan-05-2017, 07:45 AM
    Thread: having dictionary and list to iterate in for loop
Post: having dictionary and list to iterate in for loop

dic = {3: 0.1, 4: 0.2, 5: 0.1, 6:0.2, 7:0.1, 8:0.2} ls =  {0.2,   0.1,     0.2,    0.1,   0.2,   0.1} n = {} for i, v, l in list(dic.keys()),list(dic.values()),ls:    add = v + l    n[i] = add # e...
Annie General Coding Help 5 5,395 Jan-04-2017, 07:50 AM
    Thread: calling a function which takes a dictionary as argument
Post: RE: calling a function which takes a dictionary as...

Oh, I see, but I'm actually working on another much more complicated code in which I need to call this function in main, maybe it's safer to do the return... Anyway, thank you !
Annie General Coding Help 4 4,589 Jan-04-2017, 07:42 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020