Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: How does this code create a class?
Post: RE: How does this code create a class?
(10 hours ago)Pedroski55 Wrote: I don't understand classes in Python!
Why do I get a class like this, without declaring a class??Every object in python is an instance of some class. This applies to... |
|
Gribouillis |
General Coding Help |
3 |
114 |
9 hours ago |
|
|
Thread: convert to bin problem
Post: RE: convert to bin problem
Conversion to int removed the zeros at the beginning. You could simply add a 1 at the beginning
s = '1'+ a[2:]
c = int(s) |
|
Gribouillis |
General Coding Help |
3 |
129 |
Today, 05:21 AM |
|
|
Thread: python calculate float plus float is incorrect?
Post: RE: python calculate float plus float is incorrect...
I don't know PHP, but here is a warning about the same thing in PHP. I don't know why it displays 41.34 in your case (perhaps an effect of the echo command?). Try their example perhaps
Output:floor((0... |
|
Gribouillis |
General Coding Help |
6 |
256 |
Apr-16-2024, 10:34 AM |
|
|
Thread: python calculate float plus float is incorrect?
Post: RE: python calculate float plus float is incorrect...
It is all explained here. Also it has nothing to do with Python. It's due to the internal representation of floating point numbers by computers. The same issue exists in other programming languages. |
|
Gribouillis |
General Coding Help |
6 |
256 |
Apr-16-2024, 09:03 AM |
|
|
Thread: Hide CMD call window
Post: RE: Hide CMD call window
Is it the same if you use
cmd = ['arp', '-a'] |
|
Gribouillis |
General Coding Help |
8 |
225 |
Apr-15-2024, 07:53 PM |
|
|
Thread: Cubic spline Graph Interpretation how?
Post: RE: Cubic spline Graph Interpretation how?
I think the scipy package has a specialized function scipy.interpolate.CubicSpline() that computes a cubic spline interpolation given a set of abscissas and corresponding set of ordinates. Look for e... |
|
Gribouillis |
Data Science |
1 |
110 |
Apr-15-2024, 08:24 AM |
|
|
Thread: Custom importer and errors
Post: RE: Custom importer and errors
I think all this is a terrible idea. In Python it is very important to distinguish the modules hierarchy from the OS folders hierarchy. These are really two different things and the idea of using fold... |
|
Gribouillis |
General Coding Help |
6 |
248 |
Apr-14-2024, 08:58 AM |
|
|
Thread: Recommend a self-developed IDE to help Tinter developers
Post: RE: Recommend a self-developed IDE to help Tinter ...
I see the tree contains .exe files and .pyd files so that we can't see the code. This is not an open source project, is it? We don't really know what the files contain. |
|
Gribouillis |
GUI |
1 |
151 |
Apr-13-2024, 07:03 PM |
|
|
Thread: replacement for fpformat.extract
Post: RE: replacement for fpformat.extract
Here is the Python 2 code of fpformat.extract(), you could perhaps convert this function directly, or it may run out of the box in Python 3.
# Compiled regular expression to "decode" a number
decoder ... |
|
Gribouillis |
General Coding Help |
4 |
209 |
Apr-12-2024, 02:42 PM |
|
|
Thread: Open files in an existing window instead of new
Post: RE: Open files in an existing window instead of ne...
(Apr-12-2024, 09:58 AM)Kostov Wrote: How can I open a file in an existing VLC instance whenever the script runs? subprocess.run doesn’t seem to be right for this.I don't think the problem is with su... |
|
Gribouillis |
General Coding Help |
2 |
274 |
Apr-12-2024, 11:01 AM |
|
|
Thread: Next/Prev file without loading all filenames
Post: RE: Next/Prev file without loading all filenames
(Apr-11-2024, 03:32 PM)WilliamKappler Wrote: So, what I was hoping was that there was a lower level operationos.scandir is a lower level operation. It doesn't store all the filenames. |
|
Gribouillis |
General Coding Help |
9 |
469 |
Apr-11-2024, 04:04 PM |
|
|
Thread: [Solved] I'm not getting the good type
Post: RE: [almost solved] I'm not getting the good type
(Apr-11-2024, 12:35 PM)slain Wrote: Maybe I should give an instruction at the end of each case, like os.remove(audio1.mp3) or gc.collect()?Don't manipulate the garbage collector, it is completely us... |
|
Gribouillis |
General Coding Help |
18 |
526 |
Apr-11-2024, 01:06 PM |
|
|
Thread: xvfb - Python Module - simpe_3dviz - wxpython - gui
Post: RE: xvfb - Python Module - simpe_3dviz - wxpython ...
It's only a conjecture but I find the way you start the Xvfb process a little strange. Why use shell=True? Why use stdout=PIPE? The problem with stdout=PIPE is that if the process attempts to print so... |
|
Gribouillis |
GUI |
4 |
260 |
Apr-11-2024, 11:09 AM |
|
|
Thread: [Solved] I'm not getting the good type
Post: RE: [almost solved] I'm not getting the good type
(Apr-11-2024, 09:54 AM)slain Wrote: tried to add it at line 61, ls still shows me an audio1.mp3.Is audio1.mp3 the name of your temporary file? Or was it written by some other portion of the code? |
|
Gribouillis |
General Coding Help |
18 |
526 |
Apr-11-2024, 10:49 AM |
|
|
Thread: [Solved] I'm not getting the good type
Post: RE: [almost solved] I'm not getting the good type
(Apr-11-2024, 07:17 AM)slain Wrote: Or is it possible to use os.remove(temp_file.name) after calling transcriptor at line 58?Reading the documentation about NamedTemporaryFile, the temporary file sh... |
|
Gribouillis |
General Coding Help |
18 |
526 |
Apr-11-2024, 09:02 AM |
|
|
Thread: [Solved] I'm not getting the good type
Post: RE: I'm not getting the good type
(Apr-10-2024, 02:48 PM)slain Wrote: googled on my side and I could resolve a part of my problem.
I found a similar cas on Stack overflow;
With this example, I modified my line 45 : waveform = file.... |
|
Gribouillis |
General Coding Help |
18 |
526 |
Apr-10-2024, 03:01 PM |
|
|
Thread: [Solved] I'm not getting the good type
Post: RE: I'm not getting the good type
(Apr-10-2024, 01:49 PM)slain Wrote: And, as the error also occurs with an mp3 (so out of the case statements), it wouldn't solve the AttributeError, would it?The problem that we have is to understan... |
|
Gribouillis |
General Coding Help |
18 |
526 |
Apr-10-2024, 02:29 PM |
|
|
Thread: [Solved] I'm not getting the good type
Post: RE: I'm not getting the good type
(Apr-10-2024, 11:49 AM)slain Wrote: Might this be because I should type if(Path(file.name).suffix != ".mp3"): (the . would be important)That's probably the reason
>>> from pathlib import Pa... |
|
Gribouillis |
General Coding Help |
18 |
526 |
Apr-10-2024, 12:26 PM |
|
|
Thread: please help
Post: RE: please help
I'm not a pandas user but pandas.read_csv() seems to have a chunksize argument which allows you to read portions of the entire file. |
|
Gribouillis |
General Coding Help |
6 |
327 |
Apr-10-2024, 08:58 AM |
|
|
Thread: [Solved] I'm not getting the good type
Post: RE: I'm not getting the good type
If the filename's suffix is not one of m4a, wav, wma, the function convtomp3() will return None, this is probably what happens in your case. |
|
Gribouillis |
General Coding Help |
18 |
526 |
Apr-10-2024, 08:48 AM |