Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Process doesn't work but Thread work !
Post: RE: Process doesn't work but Thread work !

I got it. the code doesn't work on IDLE. I ran it from command line and it works !
mr_byte31 General Coding Help 4 354 Oct-18-2021, 06:29 PM
    Thread: Process doesn't work but Thread work !
Post: RE: Process doesn't work but Thread work !

(Oct-18-2021, 05:54 PM)buran Wrote: the second snippet works for me. I get Output:start sleeping 5 start sleeping 4 start sleeping 3 end sleeping 3 start sleeping 2 end sleeping 4 start sleep...
mr_byte31 General Coding Help 4 354 Oct-18-2021, 06:17 PM
    Thread: Process doesn't work but Thread work !
Post: Process doesn't work but Thread work !

I am just learning to work with multi threads/process. I wrote this code and it works well: import time import concurrent.futures numThreads = 3 def do_something(sec): print('start sleeping ',se...
mr_byte31 General Coding Help 4 354 Oct-18-2021, 05:25 PM
    Thread: Mult-threading and locking file
Post: RE: Mult-threading and locking file

(Oct-15-2021, 06:06 PM)Larz60+ Wrote: I wrote a tutorial on automatically creating a database from csv files. Note: Project uses sqlite database. Other DBMS can be used with a simple change to the m...
mr_byte31 General Coding Help 4 425 Oct-15-2021, 06:50 PM
    Thread: function that run once for all objects
Post: RE: function that run once for all objects

@deanhystad, this seem to work fine ! thanks
mr_byte31 General Coding Help 10 665 Oct-15-2021, 04:03 PM
    Thread: Mult-threading and locking file
Post: Mult-threading and locking file

I had a code which is running correctly but I feel it is not a professional code. I want your opinion to enhance it. Code : I create a lot of threads to web scrap some information that I am interest...
mr_byte31 General Coding Help 4 425 Oct-15-2021, 02:35 PM
    Thread: function that run once for all objects
Post: RE: function that run once for all objects

(Oct-14-2021, 03:22 PM)ndc85430 Wrote: You still haven't explained why you want to do this, or what's wrong with calling a method on the instance you want to use. It sounds like you've come up with ...
mr_byte31 General Coding Help 10 665 Oct-14-2021, 05:03 PM
    Thread: function that run once for all objects
Post: RE: function that run once for all objects

Thanks, I am aware about the __init__ method. I was thinking there is a specific magic method for this purpose.
mr_byte31 General Coding Help 10 665 Oct-14-2021, 01:02 PM
    Thread: Inheritance vs Instantiation for Python classes
Post: RE: Inheritance vs Instantiation for Python classe...

you explained it very well to me. thanks. I am coming from C language background and it is sometimes not easy to accept OOP concepts.
mr_byte31 General Coding Help 7 575 Oct-14-2021, 12:58 PM
    Thread: function that run once for all objects
Post: function that run once for all objects

I create a class and I added a code that download a file and parse it in the __init__ . for each object I create an object from my class it calls the init method. what I want is to automatically call...
mr_byte31 General Coding Help 10 665 Sep-30-2021, 07:15 PM
    Thread: Inheritance vs Instantiation for Python classes
Post: RE: Inheritance vs Instantiation for Python classe...

I didn't invent the examples. I just copied them I provided them to show the way they get written. someone can instantiate an object and get all functionality from methods and add his functionality a...
mr_byte31 General Coding Help 7 575 Sep-23-2021, 04:48 PM
    Thread: imaginary number i
Post: RE: imaginary number i

(Sep-23-2021, 03:59 PM)deanhystad Wrote: The reason -1**0.5 == -1 is that ** has higher precedence than unary -. The reason (-1)**5 ~= 1j is that the parenthesis change the order of operations. Un...
mr_byte31 General Coding Help 8 474 Sep-23-2021, 04:28 PM
    Thread: Inheritance vs Instantiation for Python classes
Post: RE: Inheritance vs Instantiation for Python classe...

I understand what you said some one can instantiate an object from a class and start to use its method to extend the functionality of other class. still inheritance was not needed !
mr_byte31 General Coding Help 7 575 Sep-23-2021, 04:21 PM
    Thread: imaginary number i
Post: RE: imaginary number i

then why the first one not correct?? >>> -1 ** 0.5 -1.0
mr_byte31 General Coding Help 8 474 Sep-23-2021, 04:01 PM
    Thread: Inheritance vs Instantiation for Python classes
Post: Inheritance vs Instantiation for Python classes

I know the meaning of Instantiation and Inheritance. I can inherit a class and use it methods and attributes. I also can instantiate a class and still can use the same methods and attributes !! I am ...
mr_byte31 General Coding Help 7 575 Sep-23-2021, 12:31 PM
    Thread: imaginary number i
Post: imaginary number i

I was trying the following commands : >>> -1 ** 0.5 -1.0 >>> (-1) ** 0.5 (6.123233995736766e-17+1j)I was expecting "1j" , "1i" or "i" I am just surprised to find different values...
mr_byte31 General Coding Help 8 474 Sep-23-2021, 12:08 PM
    Thread: multithreading issue with output
Post: RE: multithreading issue with output

just wrong post that was deleted
mr_byte31 General Coding Help 4 1,579 Sep-06-2019, 03:20 PM
    Thread: multithreading issue with output
Post: RE: multithreading issue with output

I think you are correct about safety using dataframe Ref: https://pandas.pydata.org/pandas-docs/st...tchas.html They stated: Quote:As of pandas 0.11, pandas is not 100% thread safe. The known issue...
mr_byte31 General Coding Help 4 1,579 Sep-06-2019, 01:53 PM
    Thread: multithreading issue with output
Post: multithreading issue with output

My script is working correctly when i have only one thread. when I make 50 threads, the output result in 'table' seems to have missing entries in each row ! for example column 'Average Volume' sometim...
mr_byte31 General Coding Help 4 1,579 Sep-05-2019, 12:45 PM
    Thread: Queue maxsize
Post: RE: Queue maxsize

I got where is my issue ! thanks
mr_byte31 General Coding Help 2 2,349 Sep-03-2019, 07:02 PM

User Panel Messages

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