• Member Avatar for Gribouillis
    Gribouillis

    Marked Solved Status for Python Bank System

    Hello, everybody. I was wondering if anybody could help me with something. I don't know if I'm taking things too fast but, I was wondering if somebody could help with …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Open frame from button

    > I wonder if there is a way in Python to simply import everything? There is a mechanism in the [py library](https://pypi.python.org/pypi/py): a [mapping](http://pylib.readthedocs.org/en/latest/misc.html#mapping-the-standard-python-library-into-py) of the standard library. With this, …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Chatango bot error

    All right. It seems strange to me that the bot2 folder is in C:\Python34 . You shouldn't clutter python's own directory with your modules under development.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Chatango bot error

    Are you the author of C:\Python34\bot2\chlib.py ? Open this file in your editor and look for the word RoomManager in this file.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Chatango bot error

    I only say that the statement print(ch) must print something in the output this is what I want to see. Try print(ch) raise SystemExit
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Chatango bot error

    Before `Traceback (most recent call last):` something was printed about ch. What does it say ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Chatango bot error

    What did the program print when you wrote `print(ch)` before `class Yakudi` ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Error in python script

    You can try something such as p = cfg.project command = ( "{cuffdiff} -p {threads} -b {fasta} -u {merged} " "-L {pheno0},{pheno1} -o {ofolder} {bam0} {bam1} {log}" ).format( cuffdiff=cfg.tool_cmd("cuffdiff"), threads=p["analysis"]["threads"], …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Error in python script

    Why shouldn't you replace `cfg.project["phenotype"]` with `d` ? d is shorter.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Error in python script

    It means that `cfg.project["phenotype"][0]` is a dictionary with a single key and you only want to print the key. You can get a key from a non empty dictionary with …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Chatango bot error

    It probably means that `ch` is a module, and that there is no variable named `RoomManager` in this module. Try to write print(ch) before `class Yakudi`, to see what `ch` …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in can't save the file in linux localhost after editing

    The file is probably not yours, or has wrong permissions. Open a terminal and type `ls -l file.php` to see the permissions. Post the result here.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in cannot cancel your daniweb account

    There is no fundamental difference between 5 years or 5 seconds from a computer's point of vue.
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to slate in Timing five isprime functions (Python)

    I hope nobody thinks these algos are used in the real world. There are much better [algos](http://en.wikipedia.org/wiki/Primality_test) to determine if a number is prime. Since the beginning of the 20th …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Timing five isprime functions (Python)

    There are [good functions](http://tnt.math.se.tmu.ac.jp/nzmath/manual/modules/prime.html) in the [nzmath](http://tnt.math.se.tmu.ac.jp/nzmath/) module. Here is a session with python 2.7 in linux >>> import nzmath >>> from nzmath.prime import primeq /usr/local/lib/python2.7/dist-packages/nzmath/config.py:328: UserWarning: no datadir found …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in creating new file in linux localhost

    `touch foo` creates file `foo`, if that's what you mean, but I probably missed something in your question. (?)
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I want to write a python code for plotting

    Sorry, I don't see how these data are related to the plot you showed above. You need to know where the curves come from.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I want to write a python code for plotting

    I see 2 ways: 1. Use the rpy2 python module to execute R statements from python until you get the cuff_data object, and extract python data from this pointer. 2. …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I want to write a python code for plotting

    You may be able to send the pdf if you zip it first. Anyway, this does not answer my question: where will you get the data from if you're not …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I want to write a python code for plotting

    > But in python code no need to use the package which I used in R. In order to plot anything, you need **data**. Where will you get the data …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I want to write a python code for plotting

    The problem is not with the plotting, there are very good libraries for plotting such as matplotlib or pyqtgraph or perhaps the gr framework, etc. The problem is rather that …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in iteritems() error

    `dict.iteritems()` [disappeared from python](https://docs.python.org/3/whatsnew/3.0.html?highlight=iteritem#views-and-iterators-instead-of-lists) in python 3.0. Use `dict.items()` in python 3, which returns a [*view*](https://docs.python.org/3/library/stdtypes.html?highlight=items#dict-views) (in python 2, `dict.items()` used to return a list).
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Grains of rice on a chessboard (Python)

    See this [wikipedia entry](https://en.wikipedia.org/wiki/Finite_geometric_series) for the finite geometric series which applies here. Take a=1 and r=2 in wikipedia's formula.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in unicode related problem when reading a collection of files

    > By default open() uses the ASCII encoding According to the documentation, the default encoding is `locale.getpreferredencoding()`. For me it is >>> import locale >>> locale.getpreferredencoding() 'UTF-8' You can try …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Sieve of Erastothenes simply with nested loops

    Well, it is not very important to understand the section between `###...###` (the definition of the `print_timing()` function). You can understand it later on, when you will study python's decorators. …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to vegaseat in A Timing Decorator (Python)

    With the advent of Python33 the module time has received a high resolution timer/counter. Here we use time.perf_counter() in a decorator to conveniently time two test functions.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Sieve of Erastothenes simply with nested loops

    A possibility is to use an `array.array` instead of a `list`. It is a little slower but it takes about 8 times less memory. #!/usr/bin/env python3 # -*-coding: utf8-*- '''Compares …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in how do I make a class instance act as a class??

    I have found 1 or 2 bugs in the last version. Here is a new version. The code currently cannot be applied for multiline because it does not detect the …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Grains of rice on a chessboard (Python)

    The first grain is missing in `grains_sum`. The result is `2**65-1`, an odd number.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in how could this be more efficient??

    I suggest to prepare a pattern once for all and then to trucate it for a given W # -*- coding: utf-8 -*- # first prepare 5 long lines with …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How could I reduce the length of this code?

    I don't think it can be reduced significantly. Why do you want a shorter code ?
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to ShouldAt3 in Jokes

    Two blondes were on their way to Disneyland and came to a fork in the road. The sign read: "Disneyland Left." So they went home.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in question regarding efficient programming methods

    Instances don't use less memory if the method is defined outside the class definition. Instances don't keep pointers to the method. They only keep a pointer to the class, which …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in tf idf calulation

    Then you must post the code that you ran together with the error traceback output and may be zip a text file and attach it to your post, so that …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in tf idf calulation

    You can start with computing the term frequencies for each term and every document. There is a snippet by Vegaseat [Click Here](https://www.daniweb.com/software-development/python/code/462632/word-frequency-count-revisited-python) Once you have these frequencies, [wikipedia](https://en.wikipedia.org/wiki/Tf–idf) has various …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Moderators On DaniWeb Becoming Abusive

    It is a rather unusual first post. How could anybody have abused you as you joined 30 minutes ago ?
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to snippsat in Using Memoization Instead of Recursion

    You have been told before to before to watch your coding style. Stop using `global`. There is a also build module that solve this in Python 3. from functools import …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to seperate two languages(English,Hindi) in python

    It seems very easy because the file is a TAB-separated file. Here is my code in python 2 #!/usr/bin/env python # -*-coding: utf8-*- '''doc ''' from __future__ import (absolute_import, division, …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to seperate two languages(English,Hindi) in python

    No it will be very fast. I suppose your data is stored in a file. Can you send such a file with say 10 lines of data ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Need help in unicode

    I think your data is not valid python code. For example to read the hindi part, I had to replace all the \N with \ \N (double backslash) otherwise python …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in My first custom PC

    I hope you checked compatibility of the RAM with the motherboard. I destroyed a motherboard once with incompatible RAM.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in "read" icon

    It seems fixed for me.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in "read" icon

    I have the same issue in qupzilla 1.8.6.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in seperating input number in thousands

    Yes, you can enter the commas explicitely and parse the input later. For example you can remove every comma before converting to float or int userdata = input('please enter the …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in seperating input number in thousands

    You need a GUI to do that, for example a tkinter Entry widget plus supporting code to handle each key stroke and mouse event sent to this widget.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in seperating input number in thousands

    Do you already have some code for the calculator ? Are you using a GUI toolkit ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Shell script for file traversing

    Why not grep -R "main("
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in fork() processes

    No, I only typed `man getpid` in a terminal and at the top of the man page, there was #include <sys/types.h> #include <unistd.h> See http://pubs.opengroup.org/onlinepubs/7908799/xsh/unistd.h.html for example. `sys/types.h` is for …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in fork() processes

    You only need to add prints to see what's going on. Here is my version, with pid numbers. Everything seems to run the way we described above #include <sys/types.h> #include …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in fork() processes

    No in principle B is created only at loop i=3. Can you post the whole code ?

The End.